Fixes Issue 1504, allowing feather beam line breaking.
[lilypond/patrick.git] / input / regression / lily-in-scheme.ly
blob7fd4f5b14f7ea1ae95c2ffac2154416b84b5b7dd
1 \header { texidoc = "LilyPond syntax can be used inside scheme to
2 build music expressions, with the @code{#@{ ... #@}} syntax.
3 Scheme forms can be introduced inside these blocks by escaping
4 them with a @code{$}, both in a LilyPond context or in a Scheme
5 context.
7 In this example, the @code{\\withpaddingA}, @code{\\withpaddingB} and
8 @code{\\withpaddingC} music functions set different kinds of padding on
9 the @code{TextScript} grob.
15 \version "2.12.0"
16 \layout { ragged-right = ##t }
18 withPaddingA = #(define-music-function (parser location padding music) (number? ly:music?)
19 #{ \override TextScript #'padding = #$padding
20 $music
21 \revert TextScript #'padding #})
23 withPaddingB = #(define-music-function (parser location padding music) (number? ly:music?)
24 #{ \override TextScript #'padding = #$(* padding 2)
25 $music
26 \revert TextScript #'padding #})
28 withPaddingC = #(define-music-function (parser location padding music) (number? ly:music?)
29 #{ \override TextScript #'padding = #(+ 1 $(* padding 2))
30 $music
31 \revert TextScript #'padding #})
34 c'^"1"
35 \withPaddingA #2
36 { c'^"2" c'^"3"}
37 c'^"4"
38 \withPaddingB #2
39 { c'^"5" c'^"6"}
40 c'^"7"
41 \withPaddingC #2
42 { c'^"8" c'^"9"}
43 c'^"10"