[LilyPond] Strait slurs and more.

Recommendations concerning notation and publishing software in a non-partisan environment.
User avatar
Schneider
Posts: 58
Joined: 09 Oct 2015, 06:50
Location: Paris

[LilyPond] Strait slurs and more.

Post by Schneider » 22 Sep 2016, 18:17

Hi OCTO, hi All,

Few hours ago, I was very happy to see a major slur shape improvement for LP users:
http://lilypond.1069038.n5.nabble.com/a ... xample.pdf

And also:
http://lilypond.1069038.n5.nabble.com/a ... xample.pdf

Thread here:
http://lilypond.1069038.n5.nabble.com/C ... 94837.html

Cheers, ;)
~Pierre

MJCube
Posts: 130
Joined: 15 Dec 2015, 13:32
Location: NYC

Re: [LilyPond] Strait slurs and more.

Post by MJCube » 23 Sep 2016, 13:06

Great news! Weird examples. Perhaps someone can post in this thread a more practical example of what Lilypond can do with a slur now that it couldn’t before.

User avatar
Schneider
Posts: 58
Joined: 09 Oct 2015, 06:50
Location: Paris

Re: [LilyPond] Strait slurs and more.

Post by Schneider » 23 Sep 2016, 22:34

Ok, interesting challenge ;)

So let start with this one : viewtopic.php?p=622#p622
Here you go:
mjcubeSlursRavel.png
mjcubeSlursRavel.png (51.77 KiB) Viewed 2937 times
The code:

Code: Select all

\version "2.19"
#(set-global-staff-size 16)
%\include "myTools.ily"
\pointAndClickOff
%% This has to be available:
%\include "../compound-slurs.ily"

#(define (suppress message x)
  (let loop ((c x))
    (if (> c 0)
       (begin
        (ly:expect-warning message)
        (loop (1- c))))))
#(suppress "already have slur" 2)

\layout {
  \context {
    \Staff
    \omit TimeSignature
  }
}

muset-slur =
#(define-event-function (ann? end-x end-y)((boolean?) number? number?)
   #{
     ^\compoundSlur \with {
       annotate = #ann?
       show-grid = #ann?
       start-ratio = #-.1
       end-point = #`(,end-x . ,end-y)
       end-ratio = #-.2
       
       inflection = 
       #'((X-ratio . .02)
          (Y-offset . -8.5)
          (angle . 15)
          )
       
       inflection =
       #'((X-ratio . .085)
          (Y-offset . -7.7)
          (angle . 40)
          (label . "A")
          )

       inflection = 
       #'((X-ratio . .105)
          (Y-offset . 11)
          (angle . -35)
          )
       
       inflection = 
       #'((X-ratio . .235)
          (Y-offset . 11)
          (angle . -45)
          (label . "B")
          )
       
       inflection = 
       #'((X-ratio . .27)
          (Y-offset . -7.5)
          (angle . 45)
          )
       
       inflection = 
       #'((X-ratio . .36)
          (Y-offset . -7.5)
          (angle . 40)
          (label . "C")
          )
       
       inflection = 
       #'((X-ratio . .39)
          (Y-offset . 11)
          (angle . -35)
          )
       
       inflection = 
       #'((X-ratio . .53)
          (Y-offset . 11)
          (angle . -45)
          (label . "D")
          )
       
       inflection = 
       #'((X-ratio . .56)
          (Y-offset . -7.5)
          (angle . 40)
          )
       
       inflection = 
       #'((X-ratio . .652)
          (Y-offset . -7.5)
          (angle . 40)
          (label . "E")
          )
       
       inflection = 
       #'((X-ratio . .68)
          (Y-offset . 11)
          (angle . -35)
          )
       
       inflection = 
       #'((X-ratio . .81)
          (Y-offset . 11)
          (angle . -45)
          (label . "F")
          )
       
       inflection = 
       #'((X-ratio . .84)
          (Y-offset . -8.5)
          (angle . 40)
          )
       
       inflection = 
       #'((X-ratio . .935)
          (Y-offset . -10)
          (angle . 40)
          (label . "G")
          )
       
       inflection = 
       #'((X-ratio . .97)
          (Y-offset . 7.8)
          (angle . -50)
          )
     }
   #})

RH = \fixed c' {
  \time 3/4
  \key d\minor
  | % mes.1
    r4 d''( d')
  | % mes.2
    <g, bes, d g>2 <f, a, c f>4
  | % mes.3
    r4 d''( d')
  | % mes.4
    <a, c e a>4 <bes, d f bes> <d, f, a, d>
  | % mes.5
    r4 d''( d')  
  | % mes.6
    <a, c e a>2 <g, bes, d g>4
  | % mes.7
    r4 d''( d')  
  | % mes.8
    <d, f, a, d>2.
  \bar "||"
}

%% Left hand clef positions:
cleF = { \once\override Staff.Clef.space-alist = #'((staff-bar extra-space . 0.2)) \clef F }
cleG = { \once\override Staff.Clef.space-alist = #'((staff-bar extra-space . 1.5)) \clef G }

LH = \fixed c' {
  \time 3/4
  \key d\minor
  | % mes.1
    \tag #'coord { <bes, f d bes>2_\muset-slur ##t 91.6 12 }
    \tag #'clean { <bes, f d bes>2_\muset-slur ##f 91.6 12 }
    <a, c e a>4
  | % mes.2
    \cleF g,,4_( \once\stemUp d,2)
  | % mes.3
    \cleG <bes, d f bes>2 <d f a \parenthesize d'>4
  | % mes.4
    \cleF g,,4_( \once\stemUp d,2)
  | % mes.5
    \cleG <a, c e a>2 <bes, d f bes>4
  | % mes.6
    \cleF g,,4_( \once\stemUp d,2)
  | % mes.7
    \cleG <f, a, c f>4 <g, bes, d g> <c, e, g, c>
  | % mes.8
    \cleF g,,4^( d, d)
  \bar "||"
}

\paper {
  indent = 0
  ragged-right = ##f
}
\header {
  title = "Le tombeau de Couperin"
  composer = \markup { "Maurice" \caps "Ravel" }
  piece = \markup\left-column { "Musette (extract)" \vspace #1 }
}
\markup\vspace #1
\score { \new PianoStaff << \new Staff \RH \new Staff { \keepWithTag #'clean \LH } >> }
\markup\vspace #5
\score { \new PianoStaff << \new Staff \RH \new Staff { \keepWithTag #'coord \LH } >> }
PDF also enclosed for better view.

Cheers :)
Attachments
mjcubeSlursRavel.pdf
(63.42 KiB) Downloaded 100 times
~Pierre

User avatar
tisimst
Posts: 294
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

[LilyPond] Strait slurs and more.

Post by tisimst » 24 Sep 2016, 03:42

Nice work, Pierre!
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
http://www.musictypefoundry.com

User avatar
Schneider
Posts: 58
Joined: 09 Oct 2015, 06:50
Location: Paris

Re: [LilyPond] Strait slurs and more.

Post by Schneider » 24 Sep 2016, 19:09

Thank you Abraham :)
~Pierre

User avatar
OCTO
Posts: 1034
Joined: 05 Oct 2015, 06:52
Location: Sweden

Re: [LilyPond] Strait slurs and more.

Post by OCTO » 27 Sep 2016, 09:39

Well done - indeed!! Can LP make flat slurs?
viewtopic.php?t=48

User avatar
tisimst
Posts: 294
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

Re: [LilyPond] Strait slurs and more.

Post by tisimst » 27 Sep 2016, 14:26

OCTO wrote:Well done - indeed!! Can LP make flat slurs?
viewtopic.php?t=48
It can, using the functionality that Schneider is using, but all segments maintain the normal curve thickness profile (i.e., thin at the ends and thick in the middle). So, they don't look the best (yet), but we have a number of individuals investigating what it would take to change this so each segment has more control over its thickness profile. The internal code has the functionality to handle this beautifully, but the pieces just need to be connected.

Slightly OT, I have manually created code for flat ties which works quite nicely and is quite flexible, including accounting for optical thickness correction, but I think the flatness is more helpful with slurs, so I'm excited for this functionality to be created! Here's an example showing a variety of flat slur shapes vs. a few normal curved slurs. Everything is customizable and is built using regularly available tie properties.
flat-ties-LilyPond.png
flat-ties-LilyPond.png (31.1 KiB) Viewed 2871 times
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
http://www.musictypefoundry.com

User avatar
John Ruggero
Posts: 1240
Joined: 05 Oct 2015, 14:25
Location: Raleigh, NC USA

Re: [LilyPond] Strait slurs and more.

Post by John Ruggero » 27 Sep 2016, 23:22

Congratulations to LilyPond on its new capabilities as shown by Schneider's excellent "rendition" of the Ravel!

I do think that all slurs should maintain at least a slight arch. Flat areas are not attractive.
Mac mini (OS 10.8.5) with dual monitors, Kurzweil Mark 5 with M-Audio Midisport 2 x 2,
Finale 2014d with GPO 4, JW Plug-ins, SmartScore X Pro, Adobe InDesign CS4,
Inkscape .48.5 and .91, FontForge 20150526
http://www.cantilenapress.com

User avatar
OCTO
Posts: 1034
Joined: 05 Oct 2015, 06:52
Location: Sweden

Re: [LilyPond] Strait slurs and more.

Post by OCTO » 28 Sep 2016, 04:11

John Ruggero wrote:I do think that all slurs should maintain at least a slight arch. Flat areas are not attractive.
Slurs shown by tisimst are a bit to straight in my opinion too, yet some composers would love to use just these in Finale.
However, not all straight or flat slurs are uncommon. Many old publishers practice flat slurs in some degree (as discussed at viewtopic.php?t=48 and viewtopic.php?f=7&t=52 ).

User avatar
John Ruggero
Posts: 1240
Joined: 05 Oct 2015, 14:25
Location: Raleigh, NC USA

Re: [LilyPond] Strait slurs and more.

Post by John Ruggero » 28 Sep 2016, 16:39

OCTO., we did discuss this extensively and, of course, notation programs should be capable of producing slurs of any shape including perfectly flat.

I bring it up again only because it could be interesting to see how LilyPond might modify flat areas to give them a very slight arch, which would make them more pleasing for those who prefer that style.

Here is an interesting example, taken somewhat at random from Chopin's Ballade no 4 (Breitkopf Complete Works). The long slur might appear to be a "straight line with two ends bending uniformly" (T. Ross) but comparison of the center area of the slur with the straight upper border of the example will show that this is not so. I see this tendency to avoid flat areas when possible in much fine engraving.
Chopin slur.jpg
Chopin slur.jpg (111.67 KiB) Viewed 2848 times
Mac mini (OS 10.8.5) with dual monitors, Kurzweil Mark 5 with M-Audio Midisport 2 x 2,
Finale 2014d with GPO 4, JW Plug-ins, SmartScore X Pro, Adobe InDesign CS4,
Inkscape .48.5 and .91, FontForge 20150526
http://www.cantilenapress.com

Post Reply