]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/changing-properties-for-individual-grobs.ly
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / input / lsr / changing-properties-for-individual-grobs.ly
1 %% Do not edit this file; it is auto-generated from LSR!
2 %% Tags: tweaks-and-overrides
3 \version "2.11.35"
4
5 \header { texidoc = "
6 The @code{\\applyOutput} command gives you the ability to tune any
7 layout object, in any context. It requires a Scheme function with three
8 arguments; advanced users can write it quite easily, whereas new users
9 may want to use pre-defined functions such as this snippet, or the
10 example in the manual.
11 " }
12 % begin verbatim
13 % ****************************************************************
14 % ly snippet:
15 % ****************************************************************
16
17 \layout {
18   ragged-right = ##t
19 }
20
21 #(define (mc-squared gr org cur)
22   (let*
23    (
24      (ifs (ly:grob-interfaces gr))
25      (sp (ly:grob-property gr 'staff-position))
26    )
27    (if (memq 'note-head-interface ifs)
28     (begin
29      (ly:grob-set-property! gr 'stencil ly:text-interface::print)
30      (ly:grob-set-property! gr 'font-family 'roman)
31      (ly:grob-set-property! gr 'text
32       (make-raise-markup -0.5
33        (case sp
34         ((-5) (make-simple-markup "m"))
35         ((-3) (make-simple-markup "c "))
36         ((-2) (make-smaller-markup (make-bold-markup "2")))
37         (else (make-simple-markup "bla"))
38       ))))
39   )))
40
41 \context Voice \relative c' {
42   \stemUp
43   \set autoBeaming = ##f
44
45   { <d f g b>8
46
47     \applyOutput #'Voice #mc-squared
48     <d f g b>
49   }
50 }
51
52 % ****************************************************************
53 % end ly snippet
54 % ****************************************************************