lilypond-user
[Top][All Lists]
Advanced

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

Re: composing Scheme identifiers?


From: David Kastrup
Subject: Re: composing Scheme identifiers?
Date: Sun, 02 Mar 2014 15:39:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Simon Albrecht <address@hidden> writes:

> Hello,
>
> I currently work on a mass setting by Palestrina. The music is stored
> in variables sopranoK, altoK, tenorK, bassK, sopranoVerseK, …,
> sopranoG, altoG, etc. etc. for the different parts and movements. Now
> since I need a separate \score block for each movement, but these
> score blocks will all be identical except for the single letter
> appended to the variables, I thought it would be elegant to define a
> music function like (in short)
> scoreSetup =
> #(define-music-function
> (parser location letter)
> (string?)
> #{
> \score {
> \new Staff = "bassus" \with { instrumentName = "bassus" }
> % this is supposed to give the same result as @code{\bassK} for example…
> #(string->identifier (string-append "bass" $letter))
> }
> #}
> )
>
> Unfortunately, there is no such procedure like string->identifier in
> Scheme and string->symbol doesn’t work. Can you help me (as a newbie
> in Scheme) to find a working solution?

$(ly:parser-lookup parser (string->symbol (string-append "bass" letter)))

-- 
David Kastrup



reply via email to

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