]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-text-script.ly
Added raggedright, removed two old input/test files.
[lilypond.git] / input / test / add-text-script.ly
1 \version "1.7.18"  %% or actually: 1.7.1 ...
2 \header {
3 texidoc= "@cindex make-music Fingering
4 You can add various stuff to notes using make-music.
5 Here is an example of how to add an extra fingering. 
6
7 In general, first do a display of the music you want to
8 create, then write a function that will build the structure for you.
9 "
10
11
12 #(define (make-text-script x) 
13    (let ((m (make-music-by-name 'TextScriptEvent)))
14      (ly:set-mus-property! m 'text-type 'finger)
15      (ly:set-mus-property! m 'text x)
16      m))
17      
18 #(define (add-text-script m x)
19    (if (equal? (ly:music-name m) 'RequestChord)
20        (ly:set-mus-property! m 'elements
21                             (cons (make-text-script x)
22                                   (ly:get-mus-property m 'elements)))
23        
24        (let ((es (ly:get-mus-property m 'elements))
25              (e (ly:get-mus-property m 'element)) )
26          (map (lambda (y) (add-text-script y x)) es)
27          (if (ly:music? e)
28              (add-text-script e x))))
29    m)
30
31 \score {
32   \apply #(lambda (x) (add-text-script x "6") (display x) x ) \notes { c4-3 }
33         \paper{ raggedright = ##t }
34 }
35
36 %% new-chords-done %%