summaryrefslogtreecommitdiff
path: root/Documentation/snippets/changing-properties-for-individual-grobs.ly
blob: b9aefd1fc923a3b95fb3ea9d0477f463d7028552 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%% DO NOT EDIT this file manually; it is automatically
%% generated from LSR http://lsr.di.unimi.it
%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
%% and then run scripts/auxiliar/makelsr.py
%%
%% This file is in the public domain.
\version "2.19.24"

\header {
  lsrtags = "really-cool, scheme-language, tweaks-and-overrides"

  texidoc = "
The @code{\\applyOutput} command allows the tuning of any layout
object, in any context. It requires a Scheme function with three
arguments.

"
  doctitle = "Changing properties for individual grobs"
} % begin verbatim

#(define (mc-squared grob grob-origin context)
  (let ((sp (ly:grob-property grob 'staff-position)))
    (if (grob::has-interface grob 'note-head-interface)
      (begin
        (ly:grob-set-property! grob 'stencil
          (grob-interpret-markup grob
            (make-lower-markup 0.5
              (case sp
                ((-5) "m")
                ((-3) "c ")
                ((-2) (make-smaller-markup (make-bold-markup "2")))
                (else "bla")))))))))

\relative c' {
  <d f g b>2
  \applyOutput Voice #mc-squared
  <d f g b>2
}