4

I created this minimal example :

\version "2.21.0"

\include "italiano.ly"

soprano_notes = \relative do' {
  fad fad16 sold8 la16 re4 re16 re8 re16
  re4 re16 dod8 si16 dod2 
}

alto_notes = \relative do' {
  re2 re mi2. mi4
}

tenor_notes = \relative do {
  \clef "G_8"
  la2 fad sol2. ( fad4 ~ fad2) 
}


bass_notes = \relative do {
  \clef bass
  re4 dod si lad
  si2 lad
}

\score {
  \new ChoirStaff <<
    \new Staff
    <<
      \new Voice = "soprano" {
        \soprano_notes
      }
    >>
    \new Staff
    <<
      \new Voice = "alto" {
        \alto_notes
      }
    >>
    \new Staff
    <<
      \new Voice = "bass" {
        \bass_notes
      }
    >>    
  >>
}

And here is the result I have :

minimal example result

As you can see in the third stave, the 4 notes have the same duration but the spacing is incorrect (and the same kind of problem appears in the second measure). I want to have all the notes with the same duration to take the same horizontal space, is that possible?

  • 2
    What you want is possible, but is frowned upon IMHO. It does not increase the legibility of the score. – yo' Feb 8 '18 at 12:49
  • Right. Horizontal space is not supposed to represent the exact duration of notes, that is indicated by the notes themselves! – leftaroundabout Feb 8 '18 at 15:58
  • @yo' to me it is tremendously helpful when I see a score like this since it provides a second visual cue about where the notes fall in respect to one another. If I was to take your argument to the extreme, we wouldn't need to align bars either since the notes would provide the duration anyways – Thomas Feb 8 '18 at 16:06
  • Well, I can count to four quite well :) But counting to 800 in a 200-bar piece would be tougher :) And also, the point is that simultaneous notes are vertically aligned either way! – yo' Feb 8 '18 at 16:26
7

LilyPond calls this "proportional duration," and you can find it in the manual here.

Within your score block, you'll want to add a layout block:

\layout {
  \context {
    \Score
      proportionalNotationDuration = #(ly:make-moment 1/20)
  }
}

You can adjust the ly:make-moment 1/20 to be 1/16, 1/8, etc. That number tells LilyPond "use this fraction of a whole note as the unit of spacing." It can be any fraction, so experiment to see what works best for you.

The entire code would thus be:

\version "2.21.0"

\include "italiano.ly"

soprano_notes = \relative do' {
  fad fad16 sold8 la16 re4 re16 re8 re16
  re4 re16 dod8 si16 dod2 
}

alto_notes = \relative do' {
  re2 re mi2. mi4
}

tenor_notes = \relative do {
  \clef "G_8"
  la2 fad sol2. ( fad4 ~ fad2) 
}


bass_notes = \relative do {
  \clef bass
  re4 dod si lad
  si2 lad
}

\score {
  \new ChoirStaff <<
    \new Staff
    <<
      \new Voice = "soprano" {
        \soprano_notes
      }
    >>
    \new Staff
    <<
      \new Voice = "alto" {
        \alto_notes
      }
    >>
    \new Staff
    <<
      \new Voice = "bass" {
        \bass_notes
      }
    >>    
  >>
  \layout {
    \context {
      \Score
        proportionalNotationDuration = #(ly:make-moment 1/20)
    }
  }
}

Which creates:

enter image description here

  • Thanks a lot. If I want a small spacing between notes I will always have this strange spacing when different durations are involved but now I have something to play with ;-) And I don't know how I didn't see it in the manual... :-( – Lhooq Feb 8 '18 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.