lilypond-user
[Top][All Lists]
Advanced

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

Re: Programmatically building music-function names


From: Caio Giovaneti de Barros
Subject: Re: Programmatically building music-function names
Date: Fri, 15 Jan 2016 15:40:46 -0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 15-01-2016 15:06, Chris Yate wrote:
 What I'm trying to do instead looks like:


```
printTheScore = 
#(define-music-function
     (parser location number )
     (string? )
#{     
\score {
 \music#number
}
#})

\printTheScore "One"
\printTheScore "Two"
```

Maybe something like this... but If I uncomment the \score block it doesn't work

musicOne = { c' d' e' }

musicTwo = { e' f' g' }


printTheScore = #(define-music-function (parser location number) (string?)

(let* ((number number) (function (string->symbol (string-append "music" number))))

#{

%\score {

#(eval function (interaction-environment))

%

#}))


\printTheScore "One"

\printTheScore "Two"



reply via email to

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