On 03/02/17 23:39, David Kastrup wrote:
[email protected] 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.


That seems to work perfectly. I'll have to add a `ly:pitch?` to ensure the input is valid, but that's beside the point.

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to