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