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: Valentin Villenave
Subject: Re: custom metronome-markup procedure causes weird goops-error
Date: Fri, 25 Apr 2008 12:29:10 +0200

2008/4/25 Valentin Villenave <address@hidden>:

>  Here's my code; it works quite well on simple examples, but on complex
>  scores it triggers an error I've never seen:

OK, I've fixed it; it actually involved using a different name for the
metronomeMarkFormatter procedure:

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: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)))))


Now it works perfectly -- sorry for the noise!

(by the way, if anyone has some clues to clean or optimize my code,
feel free to suggest any improvements you can think of)

Cheers,
Valentin




reply via email to

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