Paired substitution functions - GNU LilyPond
Description: GNU LilyPond

Next: Mathematics in functions, Previous: Simple substitution functions, Up: Music functions

#### 12.1.3 Paired substitution functions

Some `\override` commands require a pair of numbers (called a `cons cell` in Scheme). To pass these numbers into a function, either use a `pair?` variable, or insert the `cons` into the music function.

>          manualBeam =
>          #(define-music-function (parser location beg-end)
>                                  (pair?)
>          #{
>            \once \override Beam #'positions = #$beg-end
>          #})

>          \relative {
>            \manualBeam #'(3 . 6) c8 d e f
>          }

or

>          manualBeam =
>          #(define-music-function (parser location beg end)
>                                  (number? number?)
>          #{
>            \once \override Beam #'positions = #(cons $beg $end)
>          #})

>          \relative {
>            \manualBeam #3 #6 c8 d e f
>          }

Next: Mathematics in functions, Previous: Simple substitution functions, Up: Music functions

This page is for LilyPond-2.10.33 (stable-branch).