The LilyPond Snippet Repository ♪♫

What's this? Searching the LSR Browse Contributing Snippet database

Results 1−10 of 149 for stencil

Centering a stencil on another stencil [0.46205]

Centering a stencil on another stencil

If you want to re-position a stencil so that it is centered relative to another stencil, on the X axis, the Y axis, or …

…stil-a stil-b #:optional axis) "Return a copy of stencil @var{stil-b} that has been moved so it … …stencil #(ly:stencil-add square (center-stencil-on-stencil square blue-square X)) \stencil #(ly:stencil-add square (center-stencil-on-stencil square blue-square Y)) \stencil #(ly:stencil-add square (center-stencil-on-stencil square blue-square)) }

Centering a stencil on another stencil

Using a different rest stencil globally (e.g., printing rests as circles) [0.42634]

Using a different rest stencil globally (e.g., printing rests as circles)

…a Scheme function for the Rest's #'stencil property, which creates circles instead of the usual … …enable this style globally, simply override the #'stencil property of the Rest object in a layout block: \layout { \context { \Voice \override Rest #'stencil = #ly:rest-interface::dot-rests } }

…unimi.it/LSR/Item?id=548 % Our own stencil for rests: quarter rests are shown as a … …relative c' { % e4. r8 e4 r4 % \override Rest.stencil = #ly:rest-interface::dot-rests % e4. r8 e4 r4 % \revert Rest.stencil % e4. r8 e4 r4 % }

Using a different rest stencil globally (e.g., printing rests as circles)

Rewriting the Stem stencil using markup paths [0.28571]

Rewriting the Stem stencil using markup paths

…visible effect, it just redoes the existing stem stencil. % You can use this as a base. #(… …0 (interval-start Y-ext)))) #f)) \relative c' { \override Stem.stencil = #path-stem | c1 | c8 d8 e8 f8 g8 f8 e8 d8 c2 c2 \override Stem.stencil = #lightning-stem | c1 | c8 d8 e8 f8 g8 f8 …

Rewriting the Stem stencil using markup paths

Replacing some accidentals with a user-defined stencil [0.28571]

Replacing some accidentals with a user-defined stencil

…all accidentals of any sort with an arbitrary stencil (in this case, a markup). Alterations are defined …

…15 \sharp \sharp } \layout { \context { \Score \override Accidental.stencil = #(lambda (grob) (if (= 3/4 (ly:pitch-alteration (ly:event-property (…

Replacing some accidentals with a user-defined stencil

Time signature with a note in the denominator instead of a number - changing TimeSignature stencil [0.28571]

…denominator instead of a number - changing TimeSignature stencil

…to it. This creates a new Time Signature Stencil, so it should work for all time signatures …

…grob-interpret-markup grob m))) \new Staff { \override Staff.TimeSignature.stencil = #format-time-sig-note \time 3/8 \relative c'' { c8 c …

Time signature with a note in the denominator instead of a number - changing TimeSignature stencil

Using make-connected-path-stencil to draw custom shapes [0.26339]

…takes the following six arguments, and returns a stencil. 1. A list of lists defining the coordinates … …use ly:stencil-translate to shift the position of the stencil. This is sometimes needed since the origin point … …manually specify the width and height of the stencil, since it gets calculated automatically.

…point? (0 0) #t) % filled path? { \override NoteHead.stencil = \bowtie e'4 f' g' a' } triangle = \markup \stencil #(make-connected-path-stencil '((1 2) ;; path coordinates (2 0) (… …point? (0 0) #t) % filled path? moon = \markup \stencil #(ly:stencil-translate (make-connected-path-stencil '((-6 -2 -6 7 0 …

Using make-connected-path-stencil to draw custom shapes

Ripped, torn staff-lines [0.24777]

…random. Both work by temporarily modifying the BarLine stencil. STYLE 1 PREFERENCES: tearWidth ... default is 1 horizontal … …is '(0 . 0) X-extent of the zigzag BarLine stencil, NOT including its width. Can be used as "padding" around the stencil, if needed. USAGE: see the \score { } block at …

…5 . 2.5))) #{ \once \override Staff.BarLine.stencil = #ly:text-interface::print \once \override Staff.BarLine.text = \markup \override … …zigzagTearAngle) 2)) 2)))) #{ \once \override Staff.BarLine.stencil = #ly:text-interface::print \once \override Staff.BarLine.text = \markup \with-dimensions …

Ripped, torn staff-lines

Using path expressions to override stencils [0.24554]

The stencil expression path can be used to override stencils … …this snippet shows how to create a filled stencil using path, and adds a scheme function to …

…5 1) (cons -3 5)) % a filled custom stencil customClefStencilTwo = #(ly:make-stencil ;; path line thickness is set … …Staff.Clef.stencil = \customClefStencilOne customClefTwo = \override Staff.Clef.stencil = \scaleCustomClefStencilTwo normalClefs = \revert Staff.Clef.stencil music = \relative c' { \customClefOne \clef "alto" c1 g1 \…

Using path expressions to override stencils

Adding or modifying Script articulations [0.21429]

Scripts may be defined as stencil expressions, by defining their stencil property.

…--Harm #(define new-script-alist (append default-script-alist (list `(longEspressivo . ( (stencil . ,long-espr-stil) (toward-stem-shift-in-column . 0.0) (padding . 1) (avoid-slur . around) (direction . ,UP))) ))) #(assoc-set! new-script-alist 'upbow (acons 'stencil upbow-stil (assoc-ref new-script-alist 'upbow))) \layout { \context { \Score scriptDefinitions = …

Adding or modifying Script articulations

Coloring individual staff lines [0.21205]

…can be colored independently by overriding the default stencil for StaffSymbol. The StaffSymbol callback color-staff-lines takes a …

…use a local copy of colors list, since ;; stencil creation mutates list (colors rest)) (for-each (lambda (dir) (… …grey (x11-color 'LightGreen)) c1 \stopStaff \revert Staff.StaffSymbol.stencil \startStaff % color an individual line in a custom … …line-positions = #'(-4 0 4) \override Staff.StaffSymbol.stencil = #(color-staff-lines #f red) c1 }

Coloring individual staff lines

1 2 3 4 5 6 7 8 9 10 Next ⇨