* lily/beam-engraver.cc: move new-beam-event to beam-event
[lilypond.git] / input / regression / apply-output.ly
blob88e9b7045f3e37cd6b4032dcad9935c467350762
2 \version "1.9.1"
3 \header {
5 texidoc = "The @code{\applyoutput} expression is the most flexible way to
6 tune properties for individual grobs.
8 Here, the layout of a note head is changed depending on its vertical
9 position.
14 #(define (mc-squared gr org cur)
15 (let*
17 (ifs (ly:get-grob-property gr 'interfaces))
18 (sp (ly:get-grob-property gr 'staff-position))
20 (if (and (memq 'note-head-interface ifs)
21 (memq sp '(-2 -3 -5)))
22 (begin
23 (ly:set-grob-property! gr 'molecule-callback brew-new-markup-molecule)
24 (ly:set-grob-property! gr 'font-family 'roman)
25 (ly:set-grob-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 )))
36 \score {
38 \notes \context Voice \relative c' {
39 \stemUp
40 \property Voice.autoBeaming = ##f
41 { <<d f g b>>8
42 \context Voice \applyoutput #mc-squared
44 <<d f g b>>
48 \paper { raggedright = ##t
49 % outputscale = 5