lilypond-user
[Top][All Lists]
Advanced

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

Re: Using strings and other types to return markup


From: Urs Liska
Subject: Re: Using strings and other types to return markup
Date: Wed, 11 May 2016 11:46:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0


Am 11.05.2016 um 11:43 schrieb Jan-Peter Voigt:
> Hi Phil,
>
> you just need to remove the parens around 'theText'. Also inside
> (markup ...) everything is interpreted as a parameter for the function
> (macro or whatever) 'markup' and evaluated as a scheme-expression for
> thet purpose.

To clarify that more:

(theText)

tries to invoke a procedure 'theText', while

theText

represents the variable as passed into the function as an argument.

HTH
Urs

>
> HTH
> Jan-Peter
>
> #(define-markup-command (do-tilde layout props theText) (string?)
>   (interpret-markup layout props
>         (markup theText )
> ))
>
>
> Am 11.05.2016 um 11:31 schrieb Phil Holmes:
>>> I'm not top posting
>>
>> I want to create a function in scheme that will take a string argument
>> something like "san~t" and return a markup which will place the tilde
>> above the n.  I know how to create the markup using markup functions
>> like
>> combine and translate, but I want to make this easier by using a scheme
>> function.  I'm struggling to work out how to take a string argument and
>> use it to return markup.  My test function is:
>>
>> #(define-markup-command (do-tilde layout props theText) (string?)
>>    (interpret-markup layout props
>>          (markup (theText) )
>> ))
>>
>> I call it with:
>>
>> mel = \relative c'' { c4  }
>> lyr = \lyricmode { \markup { \do-tilde #"Testing" } }
>> <<
>> \new Voice = melody \mel
>> \new Lyrics \lyricsto melody \lyr
>>>>
>>
>> I get the error
>>
>> In expression (theText):
>> LyricTest.ly:13:17: Wrong type to apply: "Testing"
>>
>> Can anyone point out to me what I'm doing wrong (or how to do this
>> correctly?)
>>
>> TIA
>>
>>
>> _______________________________________________
>> lilypond-user mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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