]> git.donarmstrong.com Git - lilypond.git/blob - input/new/changing-properties-for-individual-grobs.ly
Merge branch 'stable'
[lilypond.git] / input / new / changing-properties-for-individual-grobs.ly
1 \version "2.12.0"
2
3 \header {
4   lsrtags = "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   doctitle = "Changing properties for individual grobs"
12 }
13
14 #(define (mc-squared grob grob-origin context)
15   (let*
16     (
17       (ifs (ly:grob-interfaces grob))
18       (sp (ly:grob-property grob 'staff-position))
19     )
20     (if (memq 'note-head-interface ifs)
21       (begin
22         (ly:grob-set-property! grob 'stencil
23           (grob-interpret-markup grob
24             (make-lower-markup 0.5
25               (case sp
26                 ((-5) "m")
27                 ((-3) "c ")
28                 ((-2) (make-smaller-markup (make-bold-markup "2")))
29                 (else "bla")
30                 ))))
31         ))))
32
33 \relative c' {
34   <d f g b>2
35   \applyOutput #'Voice #mc-squared
36   <d f g b>2
37 }