The end goal is to have some function that takes a rest and optional text and outputs the rest with a fermata, boxed "vocals", and the optional key words.
Inspired by this question, I was able to make the following function. It somewhat works.
vocal-cue = #(define-music-function
(parser location rest key-phrase)
(ly:music? markup?)
(make-relative (rest) rest
#{
$rest _\markup \center-column {
\box { Vocals }
\line \smaller { $key-phrase }
}^\fermata #}))
HOWEVER,
- The markup alignment is all wrong. Even if I
\center-align
the markup, it still is not correctly centered. - The primary use case will be on full-measure rests (though there are one or two cues that last less than a full measure). Using
\vocal-cue R1 "something"
instead of\vocal-cue r1 "this somewhat works"
puts the fermata and markup into the bar AFTER the rest it's supposed to annotate (but the markup is centered correctly relative to the fermata that time) - (related to 2) When using
R1
, I getwarning: Unattached TextScriptEvent
in the console; usingr1
gives no warnings or errors.
How can I make this have correct alignment and play nicely with full-bar rests?