lilypond-user
[Top][All Lists]
Advanced

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

Use String to reference Variable


From: Pedro Pessoa
Subject: Use String to reference Variable
Date: Mon, 3 Dec 2018 20:28:41 -0700 (MST)

Hello!
I want a function that takes a string as arg an from that produces a valid
variable reference, as follows:

%%% pseudo 
Nabc={a1 d e f}
Nxyz={b1 e a d}

fun=
#(define-music-function (x)(string?)
   #{
     <<
       #(concat x "abc")
       \\
       #(concat x "xyz")
     >>
   #})

\fun "N" %produces parallel music with Nabc and Nxyz
%%%

---

I've ran this test:

%%%
\Nabc={some music}
(display (string->symbol (string-append "N" "abc")))
%%%

It outputs "Nabc", not the music content of Nabc, as I expected.
Why is that? How do I make it point to the actual music?




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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