Hugh Myers wrote:
Given:
flashNote = #(define-music-function (parser location note)(ly:music?) #{
$note s2. \pageBreak
#}
)
I'd like to modify it so that a fixed duration for the note can be
within the function rather than in the calling sequence. [...]
I've tried various versions of $note4, {$note}4 etc--- all producing
errors of course. Clues? Suggestions?
Inside the music function, note is essentially an arbitrary music
expression, so you can't just attach the length, as you recognized.
Basically, you'd have to parse the whole music expression, and replace
the chord durations by a quarter.
Luckily, there's already a function called \makeRhythm in
http://lsr.dsi.unimi.it/LSR/Item?id=390 , doing exactly this. With this
included,
flashNote = #(define-music-function (parser location note)(ly:music?) #{
\makeRhythm $note "4" s2. \pageBreak
#}
)
should do what you want.
Cheers,
Alexander
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user