lilypond-user
[Top][All Lists]
Advanced

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

Re: Convert Scheme symbol to pitch


From: David Kastrup
Subject: Re: Convert Scheme symbol to pitch
Date: Thu, 02 Mar 2017 23:39:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

address@hidden writes:

> Is it possible to convert a symbol (such as `'bes'`) to a pitch (in
> this case `(ly:make-pitch 1 0 0)`)? I know you can do `#{ bes' #}` to
> get a pitch, but that only appears to work for constants.
>
> Or, for a more general question: is there some way to eval() a string
> as Lilypond code?

In newer 2.19 versions

(ly:parse-string-expression (ly:parser-clone) "bes'")

In older versions, ly:parser-clone may need an argument and in most
user-level uses just writing  parser  will likely work as such an
argument.

-- 
David Kastrup



reply via email to

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