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