lilypond-user
[Top][All Lists]
Advanced

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

Re: tiny function


From: Br. Gabriel-Marie | SSPX
Subject: Re: tiny function
Date: Thu, 30 Jun 2016 16:54:05 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2


I've also tried this, but I get a compiler error for "wrong number of arguments", which makes me wonder if I can replace whatnumber more than once.

verseNumber = #(define-music-function(whatnumber)(string?)#{
    \with { instrumentName = whatnumber shortInstrumentName = whatnumber }
#})


On 6/30/2016 3:59 PM, Jeffery Shivers wrote:
In my music script I want to use this:

\new Lyrics \with { instrumentName = "1." shortInstrumentName = "1." }

However, I would like to make a function out of it.  I'm looking at this page:
http://lilypond.org/doc/v2.18/Documentation/learning/saving-typing-with-variables-and-functions

and this is what I have come up with, but I know this isn't right.  Can someone correct this for me?
Basically, I want to do this:
\new Lyrics \verseNumber #1

and have it create this: 
\new Lyrics \with { instrumentName = "1." shortInstrumentName = "1." }


reply via email to

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