The LilyPond Snippet Repository ♪♫

What's this? Searching the LSR Browse by date Contributing Snippet database Browsing items 60−69 out of 921

Aligning and centering instrument names

The horizontal alignment of instrument names is tweaked by changing the Staff.InstrumentName.self-alignment-X property. The \layout variables indent and short-indent define the space in which the instrument names are aligned before the first and the following systems, respectively.

Aligning and centering instrument names

Aligning and centering instrument names (advanced)

Here is an advanced macro to produce automatically centered instrument names: use \instrument for a single line instrument name, and \instruments for a multi line instrument name.

Aligning and centering instrument names (advanced)

Aligning bar numbers

Bar numbers by default are right-aligned to their parent object. This is usually the left edge of a line or, if numbers are printed within a line, the left hand side of a bar line. The numbers may also be positioned directly over the bar line or left-aligned to the bar line.

Aligning bar numbers

Aligning columns from different markups

One can use \markup \fill-line { \column { "line1" "line2" ... } \column { "line1" "line2" ... } } to create text markup in multiple columns (for example, writing out the text of various stanzas after the score). However, the column widths are calculated from the contents, so columns from different markups are not aligned with each other.

However, one can write a \columns macro, which makes each column exactly 1/n of the line-width, thus aligning even columns of different markups. The syntax stays the same, only that one has to use \columns instead of \fill-line:
\markup \columns {
  \column{"default column 1" "line 2"}
  \column{"column 2, wider than the rest" "line 2"}
  \column{"c 3" "line 2"}
}

Aligning columns from different markups

Aligning marks with various notation objects

If specified, text marks may be aligned with notation objects other than bar lines. These objects include ambitus, breathing-sign, clef, custos, staff-bar, left-edge, key-cancellation, key-signature, and time-signature.

In such cases, text marks will be horizontally centered above the object. However this can be changed, as demonstrated on the second line of this example (in a score with multiple staves, this setting should be done for all the staves).

Aligning marks with various notation objects

Aligning objects created with the \mark command [obsolete in 2.23]

By default the \mark command centers objects over a bar line. This behavior can be modified to align at right or left.

This snippet is less necessary starting from LilyPond version 2.23.14, where the \textMark and \textEndMark commands have been introduced as an alternative to \mark used with markup. To obtain a left-aligned text mark, use \textMark, and \textEndMark for a right-aligned mark. In most cases, this interface is enough. If you would like to fine-tune the alignment nevertheless, you can still use the override in this snippet, replacing RehearsalMark with TextMark.

Aligning objects created with the \mark command [obsolete in 2.23]

Aligning syllables with melisma

By default, lyrics syllables that start a melisma are left aligned on their note. The alignment can be altered using the lyricMelismaAlignment property.

Aligning syllables with melisma

Allowing fingerings to be printed inside the staff

By default, vertically oriented fingerings are positioned outside the staff; that behavior, however, may be disabled. Attention needs to be paid to situations where fingerings and stems are in the same direction: by default, fingerings will avoid only beamed stems. That setting can be changed to avoid no stems or all stems; the following example demonstrates these two options, as well as how to go back to the default behavior.

Allowing fingerings to be printed inside the staff

Alphabetical sorted index

Sometimes you may want to get an sorted index of the pieces contained in a book. Often the \table-of-content command does this job quite well.

However, the problem with it is, that it sorts always by page numbers. For books containing many songs it is common to have an index sorted by letters or topics.

Both is possible with this snippet. Its code takes the code of ./ly/toc-init.ly and defines three new commands \indexItem, \indexSection and \index. The first two are used to define index items, the last one will create the output.

\indexItem and \indexSection both take two arguments (string, markup). The first is used to calculate the order of the items in the output, the second one contains the markup that is actually printed.

\markuplist \index

\indexItem #"Berta" \markup "Berta"
\indexItem #"Clown" \markup "Clown"
\indexItem #"Adam" \markup "Adam"

By setting the first argument of \indexItem and \indexSection to a different value than the second it is possible to create heavily customized sorted indices. A topic based index can be achieved by:

\markuplist \index

\indexSection #"spring" \markup \smallCaps "Songs of Spring"
\indexItem #"spring - I Like the Flowers" \markup "I Like the Flowers"
\indexItem #"spring - Der Winter ist vergangen" \markup "Der Winter ist vergangen"

\indexSection #"rock" \markup \smallCaps "Rock Songs"
\indexItem #"rock - Stairway to Heaven" \markup "Stairway to heaven"
\indexItem #"rock - Nothing Else Matters" \markup "Nothing Else Matters"

Limitations:

It is not yet possible to create multiple indices, for example an alphabetical sorted and a topic based one.

To achieve that a few additions to the snippet are nessecary which I had not yet time to implement by now.

Alphabetical sorted index

Altering the length of beamed stems

Stem lengths on beamed notes can be varied by overriding the beamed-lengths property of the details of the Stem. If a single value is used as an argument, the length applies to all stems. When multiple arguments are used, the first applies to eighth notes, the second to sixteenth notes and so on. The final argument also applies to all notes shorter than the note length of the final argument. Non-integer arguments may also be used.

Altering the length of beamed stems

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