+.ly

0.1 Introduction

This document shows all kinds of tips and tricks, from simple to advanced. You may also find dirty tricks, or the very very latest features that have not been documented or fully implemented yet.

In the web version of this document, you can click on the file name or figure for each example to see the corresponding input file.

This document is for LilyPond version 2.10.33.

[image of music]

add-staccato.ly

Using make-music, you can add various stuff to notes. In this example staccato dots are added to the notes.

[image of music]

add-text-script.ly

You can add various stuff to notes using make-music. In this example, an extra fingering is attached to a note.

[image of music]

ambitus-mixed.ly

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

[image of music]

ancient-accidentals.ly

Accidentals are available in different ancient styles, which all are collected here.

[image of music]

ancient-font.ly

Here are shown many (all?) of the symbols that are included in LilyPond's support of ancient notation.

[image of music]

ancient-time.ly

Time signatures may also be engraved in an old style.

[image of music]

bar-always.ly

By setting barAlways and defaultBarType, barlines may be inserted automatically everywhere.

[image of music]

bar-lines-lyric-only.ly

You can move Bar_engraver and Span_bar_engraver to a different engraving context, if you want, for example, bar lines on lyrics.

[image of music]

bar-number-every-five-reset.ly

If you would like the bar numbers to appear at regular intervals, but not starting from measure zero, you can use a context function, set-bar-number-visibility, to set automatically barNumberVisibility, so that the bar numbers appear at regular intervals, starting from the measure in which set-bar-number-visibility is set using \applyContext.

[image of music]

bar-number-show-all.ly

By default, bar numbers are printed only in the first measure. This setting can be overridden, so that bar numbers on start of every measure.

[image of music]

beam-alternate.ly

The eighth notes may be seemingly attached to different beams, and the corresponding notes connected by ties (see also tie-cross-voice.ly). Such a situation may occur, for example, in the cello suites.

[image of music]

beam-auto-4-8.ly

You can override the automatic beaming settings.

[image of music]

beam-auto-override.ly

The auto-beamer, which can be overridden, will only engrave beams that end before encountering of

The autoBeaming can also be turned off.

[image of music]

beam-control.ly

Beam positions may be controlled manually, by overriding the positions setting of the Beam grob.

[image of music]

beam-count.ly

You can alter the number of stems in a beam. In this example, two sets of four 32nds are joined, as if they were 8th notes.

[image of music]

boxed-stencil.ly

The print-function can be overridden to draw a box around an arbitrary grob.

[image of music]

caps.ly

The font can be changed to small caps.

[image of music]

circle.ly

Circles can be drawn around various objects.

[image of music]

compound-time.ly

Compound time signatures can be printed. Automatic beaming works in compound time.

[image of music]

coriolan-margin.ly

In an orchestral score (Beethoven's Coriolan overture), there are different instrument groups, and some of the instruments may be transposed. Instruments are indicated either with a long or short name.

[image of music]

dynamic-extra.ly

PiĆ¹ forte dynamics is produced using \markup.

[image of music]

embedded-postscript.ly

The markup command \postscript inserts postscript directly into the output.

[image of music]

engraver-contexts.ly

In polyphonic notation, many voices can share a staff: In this situation, the accidentals and staff are shared, but the stems, slurs, beams, etc. are private to each voice. Hence, engravers should be grouped. The engravers for note head, stems, slurs, etc. go into a group called “Voice context”, while the engravers for key, accidental, bar, etc. go into a group called “Staff context”. In the case of polyphony, a single Staff context contains more than one Voice context. Similarly, more Staff contexts can be put into a single Score context.

[image of music]

engraver-one-by-one.ly

The notation problem, creating a certain symbol, is handled by plugins. Each plugin is called Engraver. In this example, engravers are switched on one by one, in the following order:

Engravers are grouped. For example, note heads, slurs, beams etc. form a Voice context. Engravers for key, accidental, bar, etc. form a Staff context.

[image of music]

extra-staff.ly

You can add (possibly temporarily) an extra staff after the beginning of a piece.

[image of music]

fret-diagram.ly

Frets are supported as markup commands.

[image of music]

gregorian-scripts.ly

Here is demonstrated a preliminary support of Gregorian Scripts:

ictus, circulus, semicirculus, accentus, episem.

[image of music]

header-ifelse.ly

High level functionality (eg. conditional defines), can be accomplished with GUILE.

This example puts the current version in the title via Scheme.

[image of music]

hymn.ly

You can combine two parts on the same staff using the part combiner. For vocal scores (hymns), there is no need to add solo/a2 texts, so they should be switched off.

[image of music]

instrument-name-align.ly

instrument names may be aligned manually by putting the names in padded boxes with \markup.

[image of music]

instrument-name-grandstaff.ly

You can have a name for the whole GrandStaff in addition to individual Staffs.

[image of music]

ligature-vaticana.ly

Vaticana ligature uses four staff lines, special clef, and calligraphic notes. Augmentum dots are collected behind ligatures.

[image of music]

lilypond-testpage.ly

All header fields with special meanings.

[image of music]

mensural-ligatures.ly

In mensural ligatures, notes with ancient durations are printed in a tight manner.

[image of music]

mensural-note-heads.ly

Mensural notes may also have note heads.

[image of music]

move-specific-text.ly

Objects, like text, can be moved around by using some Scheme code.

[image of music]

music-box.ly

This example shows prelude in C major of WTK1, but coded using Scheme functions to avoid typing work.

[image of music]

music-creation.ly

You can engrave music using just Scheme expressions. Although those expressions reflect the inner mechanism of LilyPond, they are rather clumsy to use, so avoid them, if possible.

[image of music]

no-bar-lines.ly

Engravers can be removed one by one. Here, the time signature and bar lines have been removed.

[image of music]

no-key-at-end-of-line.ly

According to normal typesetting conventions, LilyPond typesets key changes at the end of the line, when the change appears at a line break. This example shows how to change this default to only print the new key signature at the beginning of the next line.

[image of music]

partial-blank.ly

When entering partially typeset music (i.e. for students to be completed by hand), you may need the spacing that correspond to the timing of notes: all measures have same length, etc. It can be implemented by adding an invisible staff with a lot of fast notes.

[image of music]

preset-extent.ly

The object may be extended to larger sized by overriding their properties. The lyrics in this example have an extent of (-10,10), which is why they are spaced so widely.

[image of music]

rests.ly

Rests may be used in various styles.

[image of music]

reverse-music.ly

Symmetric, or palindromical music can be produced, first, by printing some music, and second, by printing the same music applying a Scheme function to reverse the syntax.

[image of music]

slur-manual.ly

In extreme cases, you can resort to setting the control-points of a slur manually, althout it involves a lot of trial and error. Be sure to force line breaks at both sides, since different horizontal spacing will require rearrangement of the slur.

[image of music]

slur-minimum-length.ly

By setting the minimum length of a slur, notes are more separated.

[image of music]

smart-transpose.ly

There is a way to enforce enharmonic modifications for notes in order to have the minimum number of accidentals. In that case, “Double accidentals should be removed, as well as E-sharp (-> F), bC (-> B), bF (-> E), B-sharp (-> C).”, as proposed by a request for a new feature. In this manner, the most natural enharmonic notes are chosen in this example.

[image of music]

spacing-optical.ly

Stem directions and head positions are taken into account for spacing

[image of music]

staff-bracket.ly

Staffs can be nested in various combinations. Here, StaffGroup and ChoirStaff produce similar straight brackets, whereas GrandStaff produces curly brackets. In InnerStaffGroup and InnerChoirStaff, the brackets are shifted leftwards.

[image of music]

staff-container.ly

In this preliminary test of a modern score, the staff lines are washed out temporarily. This is done by making a tuned StaffContainer, which \skips some notes without printing lines either and creates a \new Staff then in order to create the lines again. (Be careful if you use this; it has been done by splitting the grouping Axis_group_engraver and creating functionality into separate contexts, but the clefs and time signatures may not do what you would expect.)

[image of music]

staff-lines.ly

The number of lines in a staff may changed by overriding line-count in the properties of StaffSymbol.

[image of music]

staff-size.ly

In order to change staff sizes, both staff-space and fontSize must be scaled.

[image of music]

stem-extend.ly

Extending stems to the center line may be prevented using no-stem-extend.

[image of music]

tablature-hammer.ly

A hammer in tablature can be faked with slurs.

[image of music]

temporary-stave.ly

An additional stave can be typeset in the middle of a score line. A new context type is created for the temporary staff to avoid printing time and key signatures and clef at the beginning of the extra stave.

[image of music]

text-spanner.ly

Text spanners can be used in the similar manner than markings for pedals or octavation.

[image of music]

time-signature-staff.ly

Time signatures may be put on a separate staff. This is used contemporary pieces with many time signature changes.

[image of music]

version-output.ly

By putting the output of lilypond-version into a lyric, it is possible to print the version number of LilyPond in a score, or in a document generated with lilypond-book. Another possibility is to append the version number to the doc-string, in this manner: 2.10.33

[image of music]

vertical-extent.ly

Vertical extents may increased by setting \override VerticalAxisGroup #'minimum-Y-extent, extra-Y-extent, and Y-extent. In this example, Y-extent is increased.

[image of music]

volta-chord-names.ly

Volta brackets can be placed over chord names. Just set the voltaOnThisStaff property to true for the ChordNames context and to false for the topmost ordinary Staff context.

[image of music]

This page is for LilyPond-2.10.33 (stable-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.