AAA-intro.ly

Introduction

This document shows examples from the LilyPond Snippet Repository.

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.

[image of music]

applying-noteheads-styles-depending-on-the-step-of-the-scale.ly

The shapeNoteStyles property gives you the ability to define various note heads styles for each step of the scale (as defined by the key signature or the "tonic" property).

This property requires a set of symbols, which can be purely arbitrary (geometrical expressions such as triangle, cross, xcircle etc. are allowed) or based on old American engraving tradition (you can use some latin note names as well).

That said, if you're trying to imitate old American song books, you may also want to try LilyPond's predefined note heads styles, through shortcut commands such as \aikenHeads or \sacredHarpHeads.

This exemple shows different ways to obtain shape note heads, and demonstrates the ability to transpose a melody without losing the correspondance between harmonic functions and note heads styles.

[image of music]

drawing-boxes-around-grobs.ly

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

[image of music]

drawing-circles-around-various-objects.ly

The \circle command allows you to draw circles around various objects (for example fingering indications). However, some objects require specific tweaks: rehearsal marks depend on the Score.markFormatter context, bar numbers on the Score.BarNumber context, and so on.

You can tweak the printing of your circles by setting some properties such as #'thickness, #'circle-padding or #'font-size.

[image of music]

making-an-object-invisibile-with-the-transparent-property.ly

Setting the transparent property will cause an object to be printed in `invisible ink': the object is not printed, but all its other behavior is retained. The object still takes up space, it takes part in collisions, and slurs, and ties and beams can be attached to it.

The snippet demonstrates how to connect different voices using ties. Normally, ties only connect two notes in the same voice. By introducing a tie in a different voice, and blanking the first up-stem in that voice, the tie appears to cross voices.

[image of music]

outputting-the-version-number.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:

[image of music]

using-the--tweak-command-to-tweak-individual-grobs.ly

With the weak command, you can tune every grob directly. Here are some examples of available tweaks.

[image of music]

This page is for LilyPond-2.11.28 (development-branch).

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

Your suggestions for the documentation are welcome.