lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to generate \scaleDurations values procedurally


From: Lib Lists
Subject: How to generate \scaleDurations values procedurally
Date: Sun, 11 Jun 2023 23:55:57 +0200

Hello,
I'm (re)working on a series of pieces for player piano. I'd like to
find a way to generate all the \scaleDurations values so that I don't
have to type them by hand. In the example below they follow a simple
pattern (60/60k 60/59, 60/58, etc.). Unfortunately my knowledge of
Scheme is very limited. Moreover, I wouldn't know how to insert the
generated values to the right staves.
Any hint would be really appreciated!

Cheers,
Lib

\version "2.25.5"

partOne = \relative c' {
  \repeat unfold 3 { c c c c }
}

partTwo = \relative c' {
  \scaleDurations 60/59
  \repeat unfold 3 { c c c c }
}

partThree = \relative c' {
  \scaleDurations 60/58
  \repeat unfold 3 { c c c c }
}

\score {
  \new StaffGroup  <<
    \new Staff = "one" {\partOne }
    \new Staff = "two" { \partTwo }
    \new Staff = "three" {\partThree }
  >>

   \layout {
    \enablePolymeter
    \context {
      \Score
      \override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/4)
      proportionalNotationDuration = #(ly:make-moment 1/10)
      \override SpacingSpanner.uniform-stretching = ##t
      \override SpacingSpanner.strict-note-spacing = ##t
      \remove "Timing_translator"
      forbidBreakBetweenBarLines = ##f
    }

    \context {
      \Staff
      \remove "Time_signature_engraver"
      \override BarLine.stencil = ##f
      \override BarLine.allow-span-bar = ##f
    }

    \context {
      \Voice
      \remove Forbid_line_break_engraver
    }
  }
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]