]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4507/5: Update snippet changing-properties-for-individual-grobs.ly
authorDavid Kastrup <dak@gnu.org>
Thu, 16 Jul 2015 15:09:43 +0000 (17:09 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 21 Jul 2015 05:07:36 +0000 (07:07 +0200)
Documentation/snippets/new/changing-properties-for-individual-grobs.ly [new file with mode: 0644]

diff --git a/Documentation/snippets/new/changing-properties-for-individual-grobs.ly b/Documentation/snippets/new/changing-properties-for-individual-grobs.ly
new file mode 100644 (file)
index 0000000..51dfb84
--- /dev/null
@@ -0,0 +1,30 @@
+\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"
+}
+#(define (mc-squared grob grob-origin context)
+   (let ((sp (ly:grob-property grob 'staff-position)))
+     (ly:grob-set-property!
+      grob 'stencil
+      (grob-interpret-markup grob
+                            #{ \markup \lower #0.5
+                               #(case sp
+                                  ((-5) "m")
+                                  ((-3) "c ")
+                                  ((-2) #{ \markup \teeny \bold 2 #})
+                                  (else "bla")) #}))))
+
+\relative c' {
+  <d f g b>2
+  \applyOutput Voice.NoteHead #mc-squared
+  <d f g b>2
+}