(LY_DEFINE): ly:output-formats. New function.
[lilypond.git] / ly / music-functions-init.ly
blobe13994fe3fb50b37b718416ffef6a0422d40f4d0
1 \version "2.3.2"
4 applymusic = #(def-music-function (location func music) (procedure? ly:music?)
5 (func music))
7 addlyrics = #(def-music-function (location music lyrics) (ly:music? ly:music?)
8 (make-music 'LyricCombineMusic
9 'origin location
10 'elements (list music lyrics)))
12 grace = #(def-grace-function startGraceMusic stopGraceMusic)
13 acciaccatura = #(def-grace-function startAcciaccaturaMusic stopAcciaccaturaMusic)
14 appoggiatura = #(def-grace-function startAppoggiaturaMusic stopAppoggiaturaMusic)
16 partcombine = #(def-music-function (location part1 part2) (ly:music? ly:music?)
17 (make-part-combine-music (list part1 part2)))
19 autochange = #(def-music-function (location music) (ly:music?)
20 (make-autochange-music music))
22 applycontext = #(def-music-function (location proc) (procedure?)
23 (make-music 'ApplyContext
24 'origin location
25 'procedure proc))
27 applyoutput = #(def-music-function (location proc) (procedure?)
28 (make-music 'ApplyOutputEvent
29 'origin location
30 'procedure proc))
32 breathe = #(def-music-function (location) ()
33 (make-music 'EventChord
34 'origin location
35 'elements (list (make-music 'BreathingSignEvent))))
37 %% \mytag #'foo { ... } ==> OK
38 %% c-\mytag #'foo ^4 ==> KO
40 #(use-modules (srfi srfi-1))
41 #(define-public (symbol-or-symbols? obj)
42 "Return #t iif obj is a symbol or a symbol list."
43 (or (symbol? obj)
44 (and (list? obj)
45 (null? (remove symbol? obj)))))
47 mytag = #(def-music-function (location tagname music) (symbol-or-symbols? ly:music?)
48 (set! (ly:music-property music 'tags)
49 ((if (list? tagname) append cons) tagname (ly:music-property music 'tags)))
50 music)
55 TODO:
57 remove these from the parser, and softcode here:
59 * \tag
61 with small syntax changes, we could also do
63 * \bar
64 * ?