]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/apply-output.ly
aa615eaa7184debe067c9da8e4577f9f39149dfa
[lilypond.git] / input / regression / apply-output.ly
1
2 \version "2.6.0" 
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
14 #(define  (mc-squared gr org cur)
15   (let*
16       (
17        (ifs (ly:grob-property gr 'interfaces))
18        (sp (ly:grob-property gr 'staff-position))
19        )
20   (if (and (memq 'note-head-interface ifs)
21            (memq sp '(-2 -3 -5)))
22       (begin
23         (ly:grob-set-property! gr 'print-function Text_interface::print)
24         (ly:grob-set-property! gr 'font-family 'roman)
25         (ly:grob-set-property!
26          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       )))
35
36 \score {
37
38  \context Voice \relative  c' {
39                                       \stemUp
40                                       \set autoBeaming =  ##f
41    { <d f g b>8
42      \context Voice \applyoutput #mc-squared
43
44          <d f g b>
45    }
46               
47    }
48 \layout { raggedright = ##t
49 %                    outputscale = 5
50                      } 
51 }