Skip to main content
edited tags
Link
Aaron
  • 94.9k
  • 13
  • 122
  • 308
Tweeted twitter.com/StackMusic/status/1527937251606413313
Source Link
Thom Smith
  • 527
  • 2
  • 8

Get the current time signature numerator/denominator

I'm transcribing a piece with extremely frequent time changes. Some parts have a lot of full-measure rests. I'm trying to define a function that produces a full-measure rest based on the current time signature, but as a relative Lilypond Scheme novice I can't figure out how to get the current time signature. I think I could get it from the timing context, but I can't figure out how to get that context from inside a music function.

Here's what I have:

autoRest = (define-music-function
  (parser location) ()
  (make-music
    'MultiMeasureRestEvent
    'duration
    (ly:make-duration 0 0 11 8) ; An 11/8 bar
  )
)

I'm sure I'm missing something basic here. How do I get the time signature?