1 ;------------------------------------------------------------------;
2 ; opus_libre -- 80-buildskel.scm ;
4 ; (c) 2008-2010 Valentin Villenave <valentin@villenave.net> ;
6 ; opus_libre is a free framework for GNU LilyPond: you may ;
7 ; redistribute it and/or modify it under the terms of the GNU ;
8 ; General Public License, version 3 or later: gnu.org/licenses ;
10 ;------------------------------------------------------------------;
13 (define (include-music name)
14 (let ((mus (ly:parser-lookup parser (string->symbol name))))
16 (begin (if (ly:get-option 'debug-messages)
17 (ly:message "Loading music from ~a..." name))
19 (begin (if (ly:get-option 'debug-messages)
20 (ly:message "Variable ~a doesn't exist." name))
21 (make-music 'Music 'void #t)))))
24 (define-music-function (parser location name) (string?)
25 (let* ((name (assoc-name lang:instruments name))
26 (mus-name (string-append current-part name))
27 (music (ly:parser-lookup parser (string->symbol mus-name)))
28 (instr (make-this-text name lang:instr-suffix))
29 (short-instr (make-this-text name lang:short-instr-suffix))
30 (lyrics (ly:parser-lookup parser
32 (string-append mus-name lang:lyrics-suffix)))))
33 (if (ly:get-option 'debug-messages) (ly:message "Loading music from ~a..." mus-name))
35 ;; (if (ly:moment<? (ly:music-length music) (ly:make-moment 1 1000))
38 instrumentName = $instr
39 shortInstrumentName = $short-instr
41 \new Voice = $name $music
42 $(if (ly:music? lyrics)
43 #{ \new Lyrics \lyricsto $name $lyrics #})
45 (begin (if (ly:get-option 'debug-messages)
46 (ly:message "Variable ~a doesn't exist." mus-name))
47 (make-music 'Music 'void #t))))))
50 (define-music-function (parser location name) (string?)
51 (let* ((name (assoc-name lang:instruments name))
52 (mus-name (string-append current-part name)))
54 $(let* ((musiclist (list #{ {} #}))
55 (numlist (if (ly:get-option 'only-suffixed-varnames)
57 (cons "" lang:numbers))))
59 (let* ((lyr-name (string-append mus-name lang:lyrics-suffix
60 (string-capitalize x)))
61 (lyrics (ly:parser-lookup parser (string->symbol lyr-name))))
62 (if (ly:music? lyrics)
63 (append! musiclist (list
64 #{ \new Lyrics \lyricsto $name $lyrics #})))))
66 (make-simultaneous-music musiclist))
70 (define-music-function (parser location name) (string?)
72 $(let* ((name (assoc-name lang:instruments name))
73 (mus-name (string-append current-part name))
74 (musiclist (list #{ {} #}))
75 (numlist (if (ly:get-option 'only-suffixed-varnames)
77 (cons "" lang:numbers))))
79 (let ((staff-name (string-append mus-name (string-capitalize x))))
80 (append! musiclist (list
81 #{ \newStaff $staff-name #}))))
83 (make-simultaneous-music musiclist))
86 (define newPianoStaff ;; TODO: include lyrics?
87 (define-music-function (parser location name) (string?)
88 (let* ((current-name (string-append current-part (assoc-name lang:instruments name)))
89 (upper (string-append current-name (string-capitalize lang:upper-hand)))
90 (lower (string-append current-name (string-capitalize lang:lower-hand)))
91 (dynamics (string-append current-name lang:dynamics-suffix))
92 (instr (make-this-text name lang:instr-suffix))
93 (short-instr (make-this-text name lang:short-instr-suffix)))
94 #{ \new PianoStaff \with {
95 instrumentName = $instr
96 shortInstrumentName = $short-instr
99 \new Staff = $lang:upper-hand $(include-music upper)
100 \new Dynamics $(include-music dynamics)
101 \new Staff = $lang:lower-hand $(include-music lower)