On Tue, Oct 20, 2015 at 12:03:37PM -0400, Kieren MacMillan wrote:
> Hello,
>
> I’m trying to put together a bunch of syntactical sugar around
> octavation. (n.b. I am aware that there are open issues regarding
> octavation; even when those are solved, there will need to be some
> sugar.)
>
> I would like to have a single command which ends an octavation *and*
> places the “loco” mark appropriately. Right now, I believe one needs
> two commands, e.g.
>
> \octU c’ d’ e’ f’ \loco g-\markup “loco”
>
> If I just use a simple “single-moment” shorthand like
>
> loco = { \ottava #0 -\markup “loco” }
>
> then obviously the markup would get placed incorrectly.
>
> How can loco be defined so that it ends the octavation (and thus
> closes the OttavaBracket) at *this* moment, but postpones the markup
> until the *next* moment [in the same context], if one exists?
[...]
Here's my beginner's attempt at this:
\version "2.19.2"
loco = #(define-music-function (note) (ly:music?)
(make-music 'SequentialMusic
'elements (list
(make-music 'OttavaMusic
'ottava-number 0)
(make-music
'NoteEvent
'articulations (cons
(make-music 'TextScriptEvent
'text "loco")
(ly:music-property note
'articulations))
'duration (ly:music-property note
'duration)
'pitch (ly:music-property note 'pitch))
)))
\score {
\new Staff {
\clef bass
c \ottava #1 d e f \loco g a b
}
}
I'm pretty sure there's a cleaner way of doing this, though.
T
--
Amateurs built the Ark; professionals built the Titanic.
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user