lilypond-user
[Top][All Lists]
Advanced

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

variables for specific kinds of markup?


From: Marc Evanstein (formerly Evans)
Subject: variables for specific kinds of markup?
Date: Mon, 17 Sep 2018 01:04:25 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi all,

I'm trying to create a variable to handle a certain type of markup text. For instance, I'd like percussion strikings to be in small caps above the staff, and what I really want is to define some sort of macro that replaces all instances of "\striking { theText }" with "^\markup\smallCaps { theText }".

The following clearly doesn't work (much as I would like it to):

striking = ^\markup\smallCaps

From searching around, it seems like I need to define a function using scheme. I tried this:

striking = #(define-music-function (parser location text)
         (string?)
         #{
           ^\markup\smallCaps { #text }
         #})

... and while the single line "\striking mallet" seems to render the word mallet as a smallCaps markup above a dummy staff, when I try to incorporate it into a series of notes, e.g.:

{c'4 \striking mallet d'4 e'4 f'4 }

I get an "error: unexpected post-event". What exactly does that mean?

I did notice something close to what I want here:

http://lilypond.org/doc/v2.19/Documentation/extending/new-markup-command-definition.en.html

But it still would require me to put something like \markup\striking, as opposed to \striking.

I'm pretty new to lilypond, so apologies if I've said something that betrays a lack of understanding. I guess I'd just mostly like to know what that "unexpected post-event" error means.

Thanks in advance!

Marc


--
Marc Evans
PhD Candidate in Music Composition at UCSB
Stanford BA '10, Music; MA '11, Music, Science and Technology
www.marcevansmusic.com

---

"I'm a random guy. I shake a hand and make a friend. I don't do egotistical 
things."
– Vanilla Ice




reply via email to

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