Am 22.06.2018 um 14:46 schrieb Gianmaria Lari:
Is there any scheme function returning the number of beats and the duration of each beat of the mesure where the function is invoked?
For instance, I would like this code..

    \version "2.19.81"
    {
      \time 3/4
      \writeBeats \writeBeatDuration
      a4 b a %just some music
      \time 4/4
      \writeBeats \writeBeatDuration
      a4 b a b
      \time 2/8
      \writeBeats \writeBeatDuration
      a8 b
    }


... output:

3 4
4 4
2 8

How about this?

writeBeats = \applyContext
#(lambda (context)
   (let ((fraction (ly:context-property context 'timeSignatureFraction)))
     (display (car fraction))))

writeBeatDuration = \applyContext
#(lambda (context)
   (let ((fraction (ly:context-property context 'timeSignatureFraction)))
     (display (cdr fraction))))

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to