lilypond-user
[Top][All Lists]
Advanced

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

Re: custom metronome-markup procedure causes weird goops-error


From: Neil Puttock
Subject: Re: custom metronome-markup procedure causes weird goops-error
Date: Fri, 25 Apr 2008 17:12:14 +0100

On 25/04/2008, Neil Puttock <address@hidden> wrote:

>  If the MIDI problem can be solved, I think this would prove a better
>  snippet than the one I added, since it works under 2.10.

It's almost too simple; I was thinking up all sorts of outlandish
constructs to get the right value, but the answer's right there in
ly-syntax-constructors.scm:

mov =
#(define-music-function (parser location texte duration count music)
(string? string? integer? ly:music?)
(define (format-movement-markup dur count context)
   (make-line-markup
    (list
     (markup #:mvt texte #:hspace 1)
     (make-simple-markup  "(")
     (make-general-align-markup Y DOWN (make-smaller-markup
                    (make-note-by-number-markup (ly:duration-log dur)
                                                (ly:duration-dot-count dur) 1)))
     (make-simple-markup  "=")
     (make-simple-markup (number->string count))
     (make-simple-markup  ")"))))
(make-music 'SequentialMusic 'elements
     (list (make-music 'ContextSpeccedMusic
             'context-type 'Score 'element
             (make-music 'PropertySet
               'value format-movement-markup
               'symbol 'metronomeMarkFormatter))
           (make-music 'ContextSpeccedMusic
             'context-type 'Score 'element
             (make-music 'SequentialMusic 'elements
             (list (make-music 'PropertySet
                    'value (ly:moment-mul (ly:make-moment count 1)
                                          (ly:duration-length
                                            (string->duration duration)))
                    'symbol 'tempoWholesPerMinute)
                   (make-music 'PropertySet
                    'value (string->duration duration)
                    'symbol 'tempoUnitDuration)
                   (make-music 'PropertySet
                    'value count
                    'symbol 'tempoUnitCount))))
                    music
                    (make-music 'ContextSpeccedMusic
             'context-type 'Score 'element
             (make-music 'PropertySet
               'value format-metronome-markup
               'symbol 'metronomeMarkFormatter)))))

Regards,
Neil




reply via email to

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