The LilyPond Snippet Repository ♪♫

What's this? Searching the LSR Browse by date Contributing Snippet database Browsing items 20−29 out of 939

Adding an ottava marking to a single voice

If you have more than one voice on the staff, setting octavation in one voice transposes the position of notes in all voices for the duration of the ottava bracket. If the octavation is only intended to apply to one voice, the Ottava_spanner_engraver should be moved to Voice context.

Adding an ottava marking to a single voice

Adding articulation marks using Scheme (advanced)

Using make-music, you can add various stuff to notes. In this example tenuto lines are added to the notes, and tied notes are disregarded.

Adding articulation marks using Scheme (advanced)

Adding articulation marks using Scheme (simple)

Using make-music, you can add various stuff to notes. In this example staccato dots are added to the notes. For this simple case, it is not necessary to use scm constructs.

Adding articulation marks using Scheme (simple)

Adding articulations from a template

Repeating the same articulations a great number of time can be a bit time-consuming to enter.

The function copyArticulations here, automates the job by copying the articulations from a pattern into your music.

As the music is rarely always the same, a few extra functions can give you some flexibility.

The code of the image below is the following:


  \copyArticulations 
      { c( c) c-. c-. }          %% the pattern
      {                          %% the music
        c16 d e f g a b c b8 a g f
        \notCA e1
        \nSkipArti #2
        r8 d16 e f g a b c8 g e g
        \notCA c,1
      }  

Here, \notCA allows you to keep the music untouched and \nSkipArti #2 skips 2 notes (so 2 articulations) in the pattern.

Download the code of this function here : copyArticulations.ly.

Adding articulations from a template

Adding augmentation dots

To obtain dotted note lengths, simply add a dot (`.') to the number. Double-dotted notes are produced in a similar way.

Adding augmentation dots

Adding automatic octaves to a melody

<p>This macro allows you to get octaves from a sequence of single notes (this is particularly useful in piano music). <p>The function takes two arguments: the first one is a number (#1 adds notes an octave above, #-1 an octave below, etc), the second one is the music to deal with. <p>Beware: the function can handle chords, but tends to reverse the intervals.

Adding automatic octaves to a melody

Adding bar lines to ChordNames context

To add bar line indications in the ChordNames context, add the Bar_engraver.

Adding bar lines to ChordNames context

Adding beams, slurs, ties etc. when using tuplet and non-tuplet rhythms

LilyPond syntax can involve many unusual placements for parentheses, brackets etc., which might sometimes have to be interleaved.

For example, when entering a manual beam, the left square bracket has to be placed after the starting note and its duration, not before. Similarly, the right square bracket should directly follow the note which is to be at the end of the requested beaming, even if this note happens to be inside a tuplet section.

This snippet demonstrates how to combine manual beaming, manual slurs, ties and phrasing slurs with tuplet sections (enclosed within curly braces).

Adding beams, slurs, ties etc. when using tuplet and non-tuplet rhythms

Adding double and triple tonguing indications for woodwind

Double and triple tonguing indications can be added to notes by tweaking the appearance of staccato articulations.

Adding double and triple tonguing indications for woodwind

Adding drum parts

Using the powerful pre-configured tools such as the \drummode function and the DrumStaff context, inputting drum parts is quite easy: drums are placed at their own staff positions (with a special clef symbol) and have note heads according to the drum. Attaching an extra symbol to the drum or restricting the number of lines is possible.

Adding drum parts

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