]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/apply-output.ly
Make the length of beamlets configurable.
[lilypond.git] / input / regression / apply-output.ly
1 \version "2.11.51"
2
3 \header {
4   texidoc = "The @code{\applyOutput} expression is the most flexible way to
5 tune properties for individual grobs.
6
7 Here, the layout of a note head is changed depending on its vertical
8 position.
9 "
10 }
11
12 #(define (mc-squared gr org cur)
13   (let*
14     (
15       (ifs (ly:grob-interfaces gr))
16       (sp (ly:grob-property gr 'staff-position))
17       )
18     (if (memq 'note-head-interface ifs)
19       (begin
20         (ly:grob-set-property! gr 'stencil
21           (grob-interpret-markup gr
22             (make-raise-markup -0.5
23               (case sp
24                 ((-5) (make-simple-markup "m"))
25                 ((-3) (make-simple-markup "c "))
26                 ((-2) (make-smaller-markup (make-bold-markup "2")))
27                 (else (make-simple-markup "bla"))
28                 ))))
29         ))))
30
31 \new Voice \relative c' {
32   \set autoBeaming = ##f
33
34   <d f g b>8
35
36   \applyOutput #'Voice #mc-squared
37   <d f g b>8
38 }