1 %------------------------------------------------------------------%
2 % Opéra Libre -- functions.ly %
4 % (c) Valentin Villenave, 2008 %
6 %------------------------------------------------------------------%
8 % Core structure functions (with great help from Nicolas Sceaux and
11 %%%%%%%%%%%%%%%%%%%%%%%%% Scores inclusion %%%%%%%%%%%%%%%%%%%%%%%%%
13 %% Prefix/postfix defs --------------------------------------------%
14 #(define text-id
"Texte")
16 %% Variables handling ---------------------------------------------%
17 #(define
(make-sym prefix-or-name name-or-postfix
)
18 (if
(symbol? prefix-or-name
)
19 (string-
>symbol
(string-append
20 (symbol-
>string prefix-or-name
)
22 (string-
>symbol
(string-append
24 (symbol-
>string name-or-postfix
)))))
26 #(define
(make-this-music name
)
27 (let
((music
(ly
:parser-lookup parser name
)))
30 (make-music
'Music
'void
#t
))))
32 #(define
(make-this-text name
)
33 (let
((mark
(ly
:parser-lookup parser name
)))
37 (ly
:warning
"no text found in markup")
41 %% LilyPond commands ----------------------------------------------%
43 #(define-music-function
(parser location variable-names
) (list?
)
44 (map
(lambda
(variable-name
)
45 (let
* ((music
(make-this-music variable-name
))
46 (score
(scorify-music music parser
))
47 (layout
(ly
:output-def-clone $defaultlayout
))
48 (header
(make-module
))
49 (title
(make-this-text
(make-sym text-id variable-name
))))
50 (module-define
! header
'piece title
)
52 (ly
:score-set-header
! score header
)
53 (ly
:score-add-output-def
! score layout
)
54 (add-score parser score
)))
57 (make-music
'Music
'void
#t
))