lilypond-user
[Top][All Lists]
Advanced

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

Music function that attaches text to a music argument


From: Nathan Reed
Subject: Music function that attaches text to a music argument
Date: Mon, 3 May 2010 23:00:07 -0700

Hello all,

I would like to write a music function that takes a single-note music
expression and attaches some markup text to it.  I tried to write:

\version "2.12.3"
myfunc = #(define-music-function (parser location mymusic) (ly:music?)
        #{ $mymusic ^"Hello, world!" #}
)
\relative c' {
        \myfunc c1
}

But Lilypond chokes with a syntax error on the ^.  Similarly it does
not work to take a music expression and attach an articulation,
dynamic, etc.  I guess this is because a music expression can
potentially be a whole series of notes, and I need to somehow unpack
it using Scheme and get to the single note inside it.  Can anyone
help?

Thanks,
Nathan Reed




reply via email to

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