The LilyPond Snippet Repository ♪♫

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

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

Automatic slash for slashedGrace and acciaccatura

By default, LilyPond adds a slash to slashedGrace and acciaccatura only in the case of a single grace note, but not when dealing with a group of beamed grace notes. This function automatically adds slashes in those other cases.

Automatic slash for slashedGrace and acciaccatura

Automatic spacing behavior

By default, LilyPond takes stem directions and head positions into account to correctly handle optical spacing. This feature is what makes LilyPond-engraved scores so beautiful to see, to read, and to play :-)

Automatic spacing behavior

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