The LilyPond Snippet Repository ♪♫

What's this? Searching the LSR Browse by date Contributing Snippet database Browsing items 0−9 out of 705

A function to repeatedly print a given pattern with different notes

This snippet describes a function \changePitch, to repeatedly print a given rhythm with different notes. Its syntax is
\changePitch \pattern \newnotes
This will replace notes in \pattern by notes in \newnotes. If the note-count in \newnotes is greater, the pattern is copied repeatedly. Rests or skips are allowed, and the function also works for chords. More detailed documentation (in pdf format), and also the most recent "changePitch.ly" can be found here.

A function to repeatedly print a given pattern with different notes

Abbreviating bass note changes

A common practice in lead sheets is to abbreviate chord changes when only the bass note is changed. s, Cmaj7, Cmaj7/B would be written as Cmaj7, /B, for example. There is no simple way to do this in LilyPond, but it is possible to use a whiteout hack like snippet #309 to accomplish the desired effect.

Abbreviating bass note changes

Abbreviations for articulations

Some articulations may be entered using an abbreviation.

Abbreviations for articulations

Absolute positioning of markup elements (laying out tables)

Positioning markup elements relative to one another is complicated by the fact that the compiler will automatically place each element after the previous one, and you have to take this into account when positioning each element. The \combine command helps, but it can only take two arguments.

By defining a new markup command which takes a list markup elements, it becomes much easier to lay out complex markup into specific arrangements, such as tables.

Absolute positioning of markup elements (laying out tables)

Accordion-discant symbols

Accordion discant-specific symbols are added using \markup.

The vertical placement of the symbols can be tweaked by changing the \raise arguments.

Accordion-discant symbols

Adding a figured bass above or below the notes

When writing a figured bass, you can place the figures above or below the bass notes, by defining the BassFigureAlignmentPositioning #'direction property (exclusively in a Staff context). Choices are #UP (or #1), #CENTER (or #0) and #DOWN (or #-1). This property can be changed as many times as you wish. Use \once \override if you don't want the override to apply to the whole score.

Adding a figured bass above or below the notes

Adding a laissezVibrer tie to only one note of a chord

Sometimes it is required to apply a laissezVibrer tie to a specific note in a chord, for instance in a piano fingering where one finger of a chord should temporarily act as a pivot while the other fingers are moving to the the next chord. Here is a way to achieve it.

Adding a laissezVibrer tie to only one note of a chord

Adding accidentals to a trillspanner

By overriding bound-details, you can insert an accidental after the trill sign in a trillspanner. However, this can look ugly since the accidental isn't aligned. With a few tweaks to the script size and position, you can achieve quite pleasing results.

Adding accidentals to a trillspanner

Adding ambitus per voice

Ambitus can be added per voice. In this case, the ambitus must be moved manually to prevent collisions.

Adding ambitus per voice

Adding an extra staff

An extra staff can be added (possibly temporarily) after the start of a piece.

Adding an extra staff

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