|
From: | Simon Albrecht |
Subject: | composing Scheme identifiers? |
Date: | Sun, 02 Mar 2014 15:18:28 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
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?
Thanks in advance, Simon
[Prev in Thread] | Current Thread | [Next in Thread] |