]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/apply-output.ly
* Website fixes:
[lilypond.git] / input / regression / apply-output.ly
1 \version "1.7.18" 
2 \header {
3
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
13 #(define  (mc-squared gr org cur)
14   (let*
15       (
16        (ifs (ly:get-grob-property gr 'interfaces))
17        (sp (ly:get-grob-property gr 'staff-position))
18        )
19   (if (and (memq 'note-head-interface ifs)
20            (memq sp '(-2 -3 -5)))
21       (begin
22         (ly:set-grob-property! gr 'molecule-callback brew-new-markup-molecule)
23         (ly:set-grob-property! gr 'font-family 'roman)
24         (ly:set-grob-property!
25          gr 'text
26          (make-raise-markup -0.5
27                             (case sp
28                               ((-5) (make-simple-markup "m"))
29                               ((-3) (make-simple-markup "c "))
30                               ((-2) (make-smaller-markup (make-bold-markup "2")))
31                               (else (make-simple-markup "bla"))
32                               ))))
33       )))
34
35 \score {
36
37 \notes \context Voice \relative  c' {
38                                       \stemUp
39                                       \property Voice.autoBeaming = ##f
40    { <<d f g b>>8
41      \context Voice \applyoutput #mc-squared
42
43          <<d f g b>>
44    }
45               
46    }
47 \paper { raggedright = ##t
48 %                    outputscale = 5
49                      } 
50 }