lilypond-user
[Top][All Lists]
Advanced

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

Re: Call a score variable by a scheme expression


From: Marc Hohl
Subject: Re: Call a score variable by a scheme expression
Date: Thu, 27 Dec 2012 22:33:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

Am 27.12.2012 18:55, schrieb David Kastrup:
Marc Hohl <address@hidden> writes:

[...]

Any hints are highly welcome!
#(string-append ...) is a string.

Maybe you want something like

$(module-ref (current-module) (string->symbol ...))

or

$(ly:parser-lookup parser (string->symbol ...))

Not particularly fond of this kind of interface, though.
David, thanks for your quick answer!

For the record: I defined

#(define (clo-score prefix) ;; command line option score
   (let ((option (symbol->string
           (or (ly:get-option 'score)
               'Full))))

        (ly:parser-lookup parser
          (string->symbol
            (string-append prefix option)))))

so I can use

testScoreA = \score { ... }

testScoreB = \score { ... }

testScoreFull = \score { ... }

\score {
  $(clo-score "testScore")
}

Not fully elegant, but a working solution for my next bigger project ...

Regards,

Marc








reply via email to

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