]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/music-function.ly
Merge branch 'stable'
[lilypond.git] / input / regression / music-function.ly
1 \header
2 {
3     
4 texidoc = "Music functions are generic music transformation functions,
5 which can be used to extend music syntax seamlessly.  Here we
6 demonstrate a @code{\myBar} function, which works similar to
7 @code{\bar}, but is implemented completely in Scheme."
8
9 }
10 \version "2.12.0"
11
12 myBar = #(define-music-function (parser location bar-type) (string?)
13           (context-spec-music
14            (context-spec-music (make-property-set 'whichBar bar-type) 'Timing)
15            'Score))
16
17 \layout { ragged-right = ##t }
18
19 {
20     d4 \myBar "|:" d4
21 }
22