]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/test/add-text-script.ly
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / input / test / add-text-script.ly
index e3cca2fab9c1fbfd07abb9471fddf705da58c6f1..12a0604cb3fabbbd9a1fd3bcb8ea52a843018605 100644 (file)
@@ -1,36 +1,35 @@
-\version "1.3.146"
+\version "2.7.39"
+
 \header {
-texidoc= "Using make-music, you can add
-various stuff to notes. Here is an example
-how to add an extra fingering
+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 display of the music you want ot
-create, then write a function that will build the structure for you."
+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.
+"
 } 
 
-#(define (make-script x) 
-     (let* (  (m (ly-make-music "Text_script_req"))
-     )
-     
-     (ly-set-mus-property m 'text-type 'finger)
-     (ly-set-mus-property m 'text x)
-     m
-     ))
+#(define (make-text-script x) 
+   (make-music 'TextScriptEvent
+               'direction DOWN
+               'text (make-simple-markup x)))
      
-#(define (add-script m x)
-  (if (equal? (ly-music-name m) "Request_chord")
-    (ly-set-mus-property m 'elements
-      (cons (make-script x) (ly-get-mus-property m 'elements)))
+#(define (add-text-script m x)
+   (if (equal? (ly:music-property m 'name) 'EventChord)
+       (set! (ly:music-property m 'elements)
+             (cons (make-text-script x)
+                  (ly:music-property m 'elements)))       
+       (let ((es (ly:music-property m 'elements))
+            (e (ly:music-property m 'element)))
+        (map (lambda (y) (add-text-script y x)) es)
+        (if (ly:music? e)
+            (add-text-script e x))))
+   m)
 
-    (let* ( (es (ly-get-mus-property m 'elements))
-            (e (ly-get-mus-property m 'element)) )
-     (map (lambda (y) (add-script y x)) es)
-     (if (music? e)
-       (add-script e x))
-    )
-  )
-  m
-)
+\score {
+  \applyMusic #(lambda (x)  (add-text-script x "6") (display-music x) x )  { c'4-3 }
+       \layout{ ragged-right = ##t }
+}
 
-\score {  \apply #(lambda (x) (add-script x "6") (display x) x ) \notes { c4-3 } }