The LilyPond Snippet Repository ♪♫

What's this? Searching the LSR Browse by date Contributing Snippet database Browsing items 90−99 out of 852

Arpeggios in polyphonic music

If you need to attach an arpeggio a chord that is notated as separate voices in polyphonic music, you can create single-node chords and set connectArpeggios = ##t.

N.B. This only works inside a GrandStaff or a PianoStaff.

Arpeggios in polyphonic music

Arranging separate lyrics on a single line

Sometimes you may want to put lyrics for different performers on a single line: where there is rapidly alternating text, for example. This snippet shows how this can be done with \override VerticalAxisGroup.nonstaff-nonstaff-spacing.minimum-distance = ##f.

Arranging separate lyrics on a single line

Arrow notation and transposition for quarter tones

If you use arrow notation for quarter tones, and distinguish a raised natural from a lowered sharp, you can define extra note-names to enter notes with these distinct alterations.

You list all the pitch-changes that your notation distinguishes, and then choose what symbols to use for each pitch pitch-change. Transposition uses your defined pitches: \transpose bes, c \music takes the difference between your pitch bes and your pitch c and shifts every pitch in \music by that amount. If the resulting pitches have an alteration with an entry in the glyph-name-alist, that symbol is printed. A missing entry generates a warning. You can put as many alterations in glyph-name-alist as you like.

Arrow notation and transposition for quarter tones

Arrows

The standard way to create an arrow is to combine a line with an arrow-head glyph.

However the line and the glyph will not follow the same scale when the global-staff-size changes.

Here's a markup function that helps to create ready to use arrows that avoid this problem.

Syntax is \arrow #'type #'fletching #'axis #'direction #'length #'boldness.

Example (at default global-staff-size):

\markup{ \scale #'(1.8 . 1.8) \arrow #"open" ##f #Y #UP #3 #0.14 }
will give the same output as:
\markup{ \combine \fontsize #5 \arrow-head #Y #UP ##f \override #'(thickness . 2.4) \draw-line #'(0 . -5.4) }

See bellow's the arrows list with optimal boldness (the one each arrow type was designed for).

Arrows

Associate drumnotes with custom NoteHead stencils

This snippet shows how to associate drum-notenames with custom stencils which will automagically be used as the standard notehead for the assigned drumnote.

In your ly-code you need to have these stencils defined. A simple example can be found in this snippet. Additionally there are two more examples used in this snippet for demonstration.

The second step is to customise the list (stencil-mapping) where the drumnotes are assigned to new stencils. List only those drumnotes you want to have displayed with your own notehead and be sure to put the full notename, not its abbreviation, e.g. 'bassdrum will work, 'bd won't.

Off course this will also work with custom drumstyle-Tables and, if used, with custom drum-notenames.

Associate drumnotes with custom NoteHead stencils

Associating lyrics with voices in \ChoirStaff

If you use ChoirStaff and set lyrics with explicit durations (instead of using \lyricsto), then you have to use \set associatedVoice to associate the lyrics with the correct voices.

Associating lyrics with voices in \ChoirStaff

Asymmetric slurs

Slurs can be made asymmetric to match an asymmetric pattern of notes better.

Asymmetric slurs

autochange music with a different pitch

The \autochange command usually allows to switch staves when reaching the middle C. However, here is a way to specify a different pitch as the "turning point".

autochange music with a different pitch

Automatic beam subdivisions

Beams can be subdivided automatically. By setting the property subdivideBeams, beams are subdivided at beat positions (as specified in baseMoment).

Automatic beam subdivisions

Automatic beams two per two in 4/4 or 2/2 time signature

In a simple time signature of 2/2 or 4/4, 8th notes are beamed by default as two sets of four.

Using a macro which overrides the autobeaming behavior, this snippet changes the beaming to quarter note beats.

Automatic beams two per two in 4/4 or 2/2 time signature

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