Merge branch 'fret-diagram-details'
[lilypond/csorensen.git] / input / regression / apply-output.ly
blob488807170665771069645c622f0ee1f346085f9a
1 \version "2.10.0"
3 \header {
4 texidoc = "The @code{\applyOutput} expression is the most flexible way to
5 tune properties for individual grobs.
7 Here, the layout of a note head is changed depending on its vertical
8 position.
12 \layout {
13 ragged-right = ##t
16 #(define (mc-squared gr org cur)
17 (let*
19 (ifs (ly:grob-interfaces gr))
20 (sp (ly:grob-property gr 'staff-position))
22 (if (memq 'note-head-interface ifs)
23 (begin
24 (ly:grob-set-property! gr 'stencil ly:text-interface::print)
25 (ly:grob-set-property! gr 'font-family 'roman)
26 (ly:grob-set-property! gr 'text
27 (make-raise-markup -0.5
28 (case sp
29 ((-5) (make-simple-markup "m"))
30 ((-3) (make-simple-markup "c "))
31 ((-2) (make-smaller-markup (make-bold-markup "2")))
32 (else (make-simple-markup "bla"))
33 ))))
34 )))
36 \context Voice \relative c' {
37 \stemUp
38 \set autoBeaming = ##f
40 { <d f g b>8
42 \applyOutput #'Voice #mc-squared
43 <d f g b>
47 % EOF