]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/changing-properties-for-individual-grobs.ly
Imported Upstream version 2.19.45
[lilypond.git] / Documentation / snippets / new / changing-properties-for-individual-grobs.ly
1 \version "2.19.24"
2
3 \header {
4   lsrtags = "really-cool, scheme-language, tweaks-and-overrides"
5
6   texidoc = "
7 The @code{\\applyOutput} command allows the tuning of any layout
8 object, in any context. It requires a Scheme function with three
9 arguments.
10
11 "
12   doctitle = "Changing properties for individual grobs"
13 }
14 #(define (mc-squared grob grob-origin context)
15    (let ((sp (ly:grob-property grob 'staff-position)))
16      (ly:grob-set-property!
17       grob 'stencil
18       (grob-interpret-markup grob
19                              #{ \markup \lower #0.5
20                                 #(case sp
21                                    ((-5) "m")
22                                    ((-3) "c ")
23                                    ((-2) #{ \markup \teeny \bold 2 #})
24                                    (else "bla")) #}))))
25
26 \relative c' {
27   <d f g b>2
28   \applyOutput Voice.NoteHead #mc-squared
29   <d f g b>2
30 }