"Trevor Daniels" <[EMAIL PROTECTED]> writes: > Being relatively new to lilypond I wanted to encapsulate useful expressions > in variables and functions as I came across them. For music-related > expressions I find these very useful, and I wanted to do the same for other > types of sequences. Here's a simple example (thanks, Kieren) to reduce the > size of a piano grand staff which I've failed to recast as a more general > function for use in a \with clause: > > \new PianoStaff \with { > fontSize = #-2 % reduce size of all fonts > \override StaffSymbol #'staff-space = #(magstep -2) % reduce size of staves > by same amount > \override VerticalAlignment #'forced-distance = #11 % increase distance > between staves for piano dynamics > } > ... rest of staves and music > > I wanted to define a void function something like > > staffSize=#( > define-music-function (parser location fontsize separation) (number? > number?) #{ > fontSize = #$fontsize % change size of all fonts > \override StaffSymbol #'staff-space = #(magstep #$fontsize) % change size > of staves by same amount > \override VerticalAlignment #'forced-distance = #$separation % change > distance between staves for piano dynamics > #} > (make-music 'SequentialMusic 'void #t) > )
[not tested] staffWithSize = #(define-music-function (parser location size distance music) (number? number? ly:music?) #{ \new PianoStaff \with { fontSize = #$size \override StaffSymbol #'staff-space = #(magstep $size) \override VerticalAlignment #'forced-distance = #$distance } $music #}) ==> \staffWithSize #-2 #11 { ..music.. } nicolas _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user