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