]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/test/add-text-script.ly
* stepmake/aclocal.m4: version check patch (thanks MWD)
[lilypond.git] / input / test / add-text-script.ly
index ed08cbfb8e618cf707155658c41da639e895dff6..6d66b21fe73d9f19d9e9e83725f1b0c400138810 100644 (file)
@@ -1,12 +1,10 @@
-\version "2.7.13"
+\version "2.9.7"
+\sourcefilename "add-text-script.ly"
 
 \header {
 texidoc= "@cindex make-music Fingering
 You can add various stuff to notes using @code{make-music}.
 In this example, an extra fingering is attached to a note. 
-
-In general, first do a @code{display} of the music you want to
-create, then write a function that will structure the music for you.
 "
 } 
 
@@ -14,7 +12,7 @@ create, then write a function that will structure the music for you.
    (make-music 'TextScriptEvent
                'direction DOWN
                'text (make-simple-markup x)))
-     
+
 #(define (add-text-script m x)
    (if (equal? (ly:music-property m 'name) 'EventChord)
        (set! (ly:music-property m 'elements)
@@ -27,9 +25,14 @@ create, then write a function that will structure the music for you.
             (add-text-script e x))))
    m)
 
+addScript =
+#(define-music-function (parser location script music )
+                                       ( string? ly:music? )
+               (add-text-script music script))
+
 \score {
-  \applyMusic #(lambda (x)  (add-text-script x "6") (display-music x) x )  { c'4-3 }
-       \layout{ raggedright = ##t }
+  {
+    \addScript "6" { c'4-3 }
+  }
 }
 
-