The LilyPond Snippet Repository ♪♫

What's this? Searching the LSR Browse by title Contributing Snippet database Browsing items 150−159 out of 940

Grid lines: emphasizing rhythms and notes synchronization

Regular vertical lines can be drawn between staves to show note synchronization; however, in case of monophonic music, you may want to make the second stave invisible, and make the lines shorter like in this snippet.

Grid lines: emphasizing rhythms and notes synchronization

Non-traditional key signatures

The commonly used \key command sets the keyAlterations property, in the Staff context.

To create non-standard key signatures, set this property directly. The format of this command is a list:

\set Staff.keyAlterations =
  #`(((octave . step) . alter) ((octave . step) . alter) ...)

where, for each element in the list, octave specifies the octave (0 being the octave from middle C to the B above), step specifies the note within the octave (0 means C and 6 means B), and alter is ,SHARP ,FLAT ,DOUBLE-SHARP etc.

Alternatively, using the more concise format for each item in the list (step . alter) specifies the same alteration holds in all octaves.

For microtonal scales where a sharp is not 100 cents, alter refers to the alteration as a proportion of a 200-cent whole tone.

Non-traditional key signatures

How to put ties between syllables in lyrics

This can be achieved by separating those syllables by tildes.

How to put ties between syllables in lyrics

Integrating LilyPond expressions inside Scheme functions

It is possible to use fragments of LilyPond syntax inside Scheme, by putting them between #{ and #}. In this example, three functions are defined to apply different paddings on the TextScript markups, using native LilyPond commands such as <code>\override TextScript #'padding</code>.

Integrating LilyPond expressions inside Scheme functions

Demonstrating the power and flexibility of the \markup function

Here are some examples of how various markup texts can be obtained with LilyPond syntax. You won't probably be needing all of them in a standard score, but hey, you never know...

Demonstrating the power and flexibility of the \markup function

PostScript lines

You can add solid, dashed, and dotted lines using embedded Postscript.

PostScript lines

Applying note head styles depending on the step of the scale

The shapeNoteStyles property can be used to define various note head styles for each step of the scale (as set 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, and xcircle are allowed) or based on old American engraving tradition (some latin note names are also allowed).

That said, to imitate old American song books, there are several predefined note head styles available through shortcut commands such as \aikenHeads or \sacredHarpHeads.

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

Applying note head styles depending on the step of the scale

Ordering scripts stack

Scripts can be stacked. The order is determined by a priority field, but when objects have the same priority, the input order determines the order. Objects specified first are closest to the note. You may also want to override the #'script-priority to give your Script or TextScript overall priority (if you do so, remember to use \once if you don't want the whole score to be affected).

Ordering scripts stack

Displaying the exact extent of a system

If you want to see exactly what amount of space takes your system, you can display it by overriding the <code>stencil</code> property in the <code>System</code> context: as you can see here, the system size is determined by including every postscript element such as slurs or key symbol.

Displaying the exact extent of a system

Blanking staff lines using the \whiteout command

The \whiteout command underlays a markup with a white box. Since staff lines are in a lower layer than most other grobs, this white box will not overlap any other grob.

Blanking staff lines using the \whiteout command

⇦ Previous 11 12 13 14 15 16 17 18 19 20 Next ⇨