X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Ftest%2Fadd-text-script.ly;h=c0ce18bf7f8b59e3980c62a42cbb718bbd07f19f;hb=80b7f97bfa820179549ae2febacfd356aa11d92c;hp=1da2f8a852f4f35eba33ea8624b31b21fad1c465;hpb=79b728d4583177252f44644471e40766e6c4b676;p=lilypond.git diff --git a/input/test/add-text-script.ly b/input/test/add-text-script.ly index 1da2f8a852..c0ce18bf7f 100644 --- a/input/test/add-text-script.ly +++ b/input/test/add-text-script.ly @@ -1,12 +1,10 @@ -\version "2.3.8" +\version "2.10.0" +\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 } - \paper{ raggedright = ##t } + { + \addScript "6" { c'4-3 } + } } -