1 %------------------------------------------------------------------%
2 % Opéra Libre -- functions.ly %
4 % (c) Valentin Villenave, 2008, 2009 %
5 %------------------------------------------------------------------%
7 % Core structure functions (with great help from Nicolas Sceaux and
10 %%%%%%%%%%%%%%%%%%%%%%%%% Scores inclusion %%%%%%%%%%%%%%%%%%%%%%%%%
12 %% Prefix/postfix defs --------------------------------------------%
13 #(define text-id
"Texte")
15 %% Variables handling ---------------------------------------------%
16 #(define
(make-sym prefix-or-name name-or-postfix
)
17 (if
(symbol? prefix-or-name
)
18 (string-
>symbol
(string-append
19 (symbol-
>string prefix-or-name
)
21 (string-
>symbol
(string-append
23 (symbol-
>string name-or-postfix
)))))
25 #(define
(make-this-music name
)
26 (let
((music
(ly
:parser-lookup parser name
)))
29 (make-music
'Music
'void
#t
))))
31 #(define
(make-this-text name
)
32 (let
((mark
(ly
:parser-lookup parser name
)))
36 (ly
:warning
"no text found in markup")
40 %% LilyPond commands ----------------------------------------------%
42 #(define-music-function
(parser location variable-names
) (list?
)
43 (map
(lambda
(variable-name
)
44 (let
* ((music
(make-this-music variable-name
))
45 (score
(scorify-music music parser
))
46 (layout
(ly
:output-def-clone $defaultlayout
))
47 (header
(make-module
))
48 (title
(make-this-text
(make-sym text-id variable-name
))))
49 (module-define
! header
'piece title
)
51 (ly
:score-set-header
! score header
)
52 (ly
:score-add-output-def
! score layout
)
53 (add-score parser score
)))
56 (make-music
'Music
'void
#t
))