Changing properties for individual grobs: Difference between revisions
Appearance
Import snippet from LSR |
m New category Tags: Mobile edit Mobile web edit |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
The <code>\applyOutput</code> command allows the tuning of any layout object, in any context. It requires a Scheme function with three arguments. | The <code>\applyOutput</code> command allows the tuning of any layout object, in any context. It requires a Scheme function with three arguments. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
#(define (mc-squared grob grob-origin context) | #(define (mc-squared grob grob-origin context) | ||
(let ((sp (ly:grob-property grob 'staff-position))) | (let ((sp (ly:grob-property grob 'staff-position))) | ||
| Line 26: | Line 26: | ||
[[Category:Really cool]] | [[Category:Really cool]] | ||
[[Category:Included in the official documentation]] | [[Category:Included in the official documentation]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:16, 21 November 2025
The \applyOutput command allows the tuning of any layout object, in any context. It requires a Scheme function with three arguments.
\version "2.24"
#(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
}