]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/changing-properties-for-individual-grobs.ly
Imported Upstream version 2.19.45
[lilypond.git] / Documentation / snippets / changing-properties-for-individual-grobs.ly
1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.19.24
8 \version "2.19.24"
9
10 \header {
11   lsrtags = "really-cool, scheme-language, tweaks-and-overrides"
12
13   texidoc = "
14 The @code{\\applyOutput} command allows the tuning of any layout
15 object, in any context. It requires a Scheme function with three
16 arguments.
17
18 "
19   doctitle = "Changing properties for individual grobs"
20 } % begin verbatim
21
22 #(define (mc-squared grob grob-origin context)
23    (let ((sp (ly:grob-property grob 'staff-position)))
24      (ly:grob-set-property!
25       grob 'stencil
26       (grob-interpret-markup grob
27                              #{ \markup \lower #0.5
28                                 #(case sp
29                                    ((-5) "m")
30                                    ((-3) "c ")
31                                    ((-2) #{ \markup \teeny \bold 2 #})
32                                    (else "bla")) #}))))
33
34 \relative c' {
35   <d f g b>2
36   \applyOutput Voice.NoteHead #mc-squared
37   <d f g b>2
38 }