]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/changing-properties-for-individual-grobs.ly
Merge branch 'master' into nested-bookparts
[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.62"
4
5 \header {
6   lsrtags = "tweaks-and-overrides"
7
8   texidoc = "
9 The @code{\\applyOutput} command allows the tuning of any layout
10 object, in any context. It requires a Scheme function with three
11 arguments.
12
13 "
14   doctitle = "Changing properties for individual grobs"
15 } % begin verbatim
16
17 \layout {
18   ragged-right = ##t
19 }
20
21 #(define (mc-squared grob grob-origin context)
22   (let*
23    (
24      (ifs (ly:grob-interfaces grob))
25      (sp (ly:grob-property grob 'staff-position))
26    )
27    (if (memq 'note-head-interface ifs)
28     (begin
29      (ly:grob-set-property! grob 'stencil ly:text-interface::print)
30      (ly:grob-set-property! grob 'font-family 'roman)
31      (ly:grob-set-property! grob '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 \relative c' {
42   <d f g b>2
43   \applyOutput #'Voice #mc-squared
44   <d f g b>2
45 }