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