]> git.donarmstrong.com Git - lilypond.git/commitdiff
Explanation for #{ ... #} syntax.
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Mon, 26 Apr 2004 21:45:57 +0000 (21:45 +0000)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Mon, 26 Apr 2004 21:45:57 +0000 (21:45 +0000)
Documentation/topdocs/NEWS.texi

index 6f9b0db3d00f6d43ac96aec9ac12fa3b0eb774ba..5c82d2aa1e8f27a72632d44b211f75e4099e73c9 100644 (file)
@@ -8,6 +8,29 @@
 
 @itemize @bullet
 
+@item LilyPond expressions can be embedded into Scheme, thanks to the
+@code{#@{ ... #@}} syntax. Within such a block, Scheme forms, for
+instance variable names, can be introduced thanks to a @code{$}
+character (@code{$$} has to be used to issue a single `$' character).
+These forms are then 'printed' in the pattern, as if they were called
+by (display).
+
+@example
+#(define (textoffset dx dy)
+   (ly:export
+     #@{ \override Voice.TextScript #'extra-offset = #(cons $dx $dy) #@}))
+
+\score @{
+  \notes @{
+    c'^"normal text"
+    %% the following statement is the same as
+    %% \override Voice.TextScript #'extra-offset = #(cons 2 -3)
+    #(textoffset 2 -3)
+    c'^"text with offset" 
+  @}
+@}
+@end example
+
 @c FIXME: un-geekify
 @item Music lists are allowed at toplevel, and are handled by
 @code{default-toplevel-music-handler}.  Similarly, a @code{score} block