\new Staff { c'4 }
The LilyPond input file looks like its own language with backslash-prefixed commands similar to LaTeX. But LilyPond input is in fact Scheme. Pure Scheme commands prefixed with
#
mix freely in LilyPond input. The following examples mix LilyPond and pure Scheme together.Example 1.
#(print "hello!")
\new Staff { c'4 }
Example 2.
#(define foo "FOO")
#(print foo)
\new Staff { c'4 }
Example 3.
#(define bar 7)
#(print (number->string bar))
\new Staff { c'4 }
Other examples are possible. Best of all will be functions to print out LilyPond context names or grob settings during interpretation.
No comments:
Post a Comment