[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.7 Editorial annotations

[image of music]

This section discusses the various ways to change the appearance of notes and add analysis or educational emphasis.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.7.1 Inside the staff

This section discusses how to add emphasis to elements that are inside the staff.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Selecting notation font size

Note:
For font sizes of text, see Selecting font and font size.
For staff size, see Setting the staff size.
For cue notes, see Formatting cue notes.
For ossia staves, see Ossia staves.

To change the size of the notation without changing the staff size, specify a magnification factor with the \magnifyMusic command:

 
\new Staff <<
  \new Voice \relative {
    \voiceOne
    <e' e'>4 <f f'>8. <g g'>16 <f f'>8 <e e'>4 r8
  }
  \new Voice \relative {
    \voiceTwo
    \magnifyMusic 0.63 {
      \override Score.SpacingSpanner.spacing-increment = #(* 1.2 0.63)
      r32 c'' a c a c a c r c a c a c a c
      r c a c a c a c a c a c a c a c
    }
  }
>>

[image of music]

The \override in the example above is a bug workaround. See the “Known issues and warnings” at the end of this section.

If a normal sized note head is merged with a smaller one, the size of the smaller note may need to be reset (with ‘\once \normalsize’) so that the stems and accidentals align properly:

 
\new Staff <<
  \key fis \minor
  \mergeDifferentlyDottedOn
  \new Voice \relative {
    \voiceOne
    \magnifyMusic 0.63 {
      \override Score.SpacingSpanner.spacing-increment = #(* 1.2 0.63)
      \once \normalsize cis'32( cis' gis b a fis \once \normalsize d d'
      \once \normalsize cis, cis' gis b a gis \once \normalsize fis fis'
      \once \normalsize fis, fis' ais, cis b gis \once \normalsize eis eis'
      \once \normalsize a, a' bis, d cis b \once \normalsize gis gis')
    }
  }
  \new Voice \relative {
    \voiceTwo
    cis'8. d16 cis8. fis16 fis8. eis16 a8. gis16
  }
>>

[image of music]

The \magnifyMusic command is not intended for cue notes, grace notes, or ossia staves—there are more appropriate methods of entering each of those constructs. Instead, it is useful when the notation size changes in a single instrumental part on one staff, and where grace notes are not appropriate, such as in cadenza-like passages or in cases such as the above examples. Setting the \magnifyMusic value to 0.63 duplicates the dimensions of the CueVoice context.

Note: The \magnifyMusic command should not be used when also resizing the staff. See Setting the staff size.

Resizing individual layout objects

An individual layout object can be resized by using the \tweak or \override commands to adjust its font-size property:

 
\relative {
  % resize a note head
  <f' \tweak font-size -4 b e>-5
  % resize a fingering
  bes-\tweak font-size 0 -3
  % resize an accidental
  \once \override Accidental.font-size = -4 bes!-^
  % resize an articulation
  \once \override Script.font-size = 4 bes!-^
}

[image of music]

The default font-size value for each layout object is listed in the Internals Reference. The font-size property can only be set for layout objects that support the font-interface layout interface. If font-size is not specified in the object’s ‘Standard settings’ list, its value is 0. See (internals)All layout objects section ‘All layout objects’ in Internals Reference.

Understanding the fontSize property

The fontSize context property adjusts the relative size of all glyph-based notational elements in a context:

 
\relative {
  \time 3/4
  d''4---5 c8( b a g) |
  \set fontSize = -6
  e'4-- c!8-4( b a g) |
  \set fontSize = 0
  fis4---3 e8( d) fis4 |
  g2.
}

[image of music]

The fontSize value is a number indicating the size relative to the standard size for the current staff height. The default fontSize is 0; adding 6 to any fontSize value doubles the printed size of the glyphs, and subtracting 6 halves the size. Each step increases the size by approximately 12%.

The scheme function magnification->font-size is provided for convenience since the logarithmic units of the font-size property are not entirely intuitive. For example, to adjust the musical notation to 75% of the default size, use:

 
\set fontSize = #(magnification->font-size 0.75)

The scheme function magstep does the opposite: it converts a font-size value into a magnification factor.

The fontSize property will only affect notational elements that are drawn with glyphs, such as noteheads, accidentals, scripts, etc. It will not affect the size of the staff itself, nor will it scale stems, beams, or horizontal spacing. To scale stems, beams, and horizontal spacing along with the notation size (without changing the staff size), use the \magnifyMusic command discussed above. To scale everything, including the staff size, see Setting the staff size.

Whenever the fontSize context property is set, its value is added to the value of the font-size grob property for individual layout objects, before any glyphs are printed. This can cause confusion when setting individual font-size properties while fontSize is already set:

 
% the default font-size for NoteHead is 0
% the default font-size for Fingering is -5
c''4-3

\set fontSize = -3
% the effective font size for NoteHead is now -3
% the effective font size for Fingering is now -8
c''4-3

\override Fingering.font-size = 0
% the effective font size for Fingering is now -3
c''4-3

[image of music]

The following shorthand commands are also available:

CommandEquivalent toRelative size
\teeny\set fontSize = -371%
\tiny\set fontSize = -279%
\small\set fontSize = -189%
\normalsize\set fontSize = 0100%
\large\set fontSize = 1112%
\huge\set fontSize = 2126%
 
\relative c'' {
  \teeny
  c4.-> d8---3
  \tiny
  c4.-> d8---3
  \small
  c4.-> d8---3
  \normalsize
  c4.-> d8---3
  \large
  c4.-> d8---3
  \huge
  c4.-> d8---3
}

[image of music]

Font size changes are achieved by scaling the design size that is closest to the desired size. The standard font size (for font-size = 0) depends on the standard staff height. For a 20pt staff, an 11pt font is selected.

Predefined commands

\magnifyMusic, \teeny, \tiny, \small, \normalsize, \large, \huge.

See also

Notation Reference: Selecting font and font size, Setting the staff size, Formatting cue notes, Ossia staves.

Installed Files: ‘ly/music-functions-init.ly’, ‘ly/property-init.ly’.

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Internals Reference: (internals)font-interface section ‘font-interface’ in Internals Reference.

Known issues and warnings

There are currently two bugs that are preventing proper horizontal spacing when using \magnifyMusic. There is only one available workaround, and it is not guaranteed to work in every case. In the example below, replace the mag variable with your own value. You may also try removing one or both of the \newSpacingSection commands, and/or the \override and \revert commands:

 
\magnifyMusic mag {
  \newSpacingSection
  \override Score.SpacingSpanner.spacing-increment = #(* 1.2 mag)
  [music]
  \newSpacingSection
  \revert Score.SpacingSpanner.spacing-increment
}

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Fingering instructions

Fingering instructions can be entered using ‘note-digit’:

 
\relative { c''4-1 d-2 f-4 e-3 }

[image of music]

Markup texts or strings may be used for finger changes.

 
\relative {
  c''4-1 d-2 f\finger \markup \tied-lyric "4~3" c\finger "2 - 3"
}

[image of music]

A thumb fingering can be added (e.g., cello music) to indicate that a note should be played with the thumb.

 
\relative { <a'_\thumb a'-3>2 <b_\thumb b'-3> }

[image of music]

Fingerings for chords can also be added to individual notes by adding them after the pitches.

 
\relative {
  <c''-1 e-2 g-3 b-5>2 <d-1 f-2 a-3 c-5>
}

[image of music]

Fingering instructions may be manually placed above or below the staff, see Direction and placement.

Selected Snippets

Controlling the placement of chord fingerings

The placement of fingering numbers can be controlled precisely. For fingering orientation to apply, it must be used within a chord construct <>, even for single notes. Orientation for string numbers and right-hand fingerings may be set in a similar way.

 
\relative c' {
  \set fingeringOrientations = #'(left)
  <c-1 e-3 a-5>4
  \set fingeringOrientations = #'(down)
  <c-1 e-3 a-5>4
  \set fingeringOrientations = #'(down right up)
  <c-1 e-3 a-5>4
  \set fingeringOrientations = #'(up)
  <c-1 e-3 a-5>4
  \set fingeringOrientations = #'(left)
  <c-1>2
  \set fingeringOrientations = #'(down)
  <e-3>2
  \set stringNumberOrientations = #'(up left down)
  <f\3 a\2 c\1>1
  \set strokeFingerOrientations = #'(down right up)
  <c\rightHandFinger #1 e\rightHandFinger #2 c'\rightHandFinger #4 >
}

[image of music]

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.

 
\relative c' {
  <c-1 e-2 g-3 b-5>2
  \override Fingering.staff-padding = #'()
  <c-1 e-2 g-3 b-5>4 g'-0
  a8[-1 b]-2 g-0 r
  \override Fingering.add-stem-support = ##f
  a[-1 b]-2 g-0 r
  \override Fingering.add-stem-support = ##t
  a[-1 b]-2 g-0 r
  \override Fingering.add-stem-support = #only-if-beamed
  a[-1 b]-2 g-0 r
}

[image of music]

See also

Notation Reference: Direction and placement.

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Internals Reference: (internals)FingeringEvent section ‘FingeringEvent’ in Internals Reference, (internals)fingering-event section ‘fingering-event’ in Internals Reference, (internals)Fingering_engraver section ‘Fingering_engraver’ in Internals Reference, (internals)New_fingering_engraver section ‘New_fingering_engraver’ in Internals Reference, (internals)Fingering section ‘Fingering’ in Internals Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Hidden notes

Hidden (or invisible or transparent) notes can be useful in preparing theory or composition exercises.

 
\relative {
  c''4 d
  \hideNotes
  e4 f
  \unHideNotes
  g a
  \hideNotes
  b
  \unHideNotes
  c
}

[image of music]

Note heads, stems, and flags, and rests are invisible. Beams are invisible if they start on a hidden note. Objects that are attached to invisible notes are still visible.

 
\relative c'' {
  e8(\p f g a)--
  \hideNotes
  e8(\p f g a)--
}

[image of music]

Predefined commands

\hideNotes, \unHideNotes.

See also

Learning Manual: (learning)Visibility and color of objects section ‘Visibility and color of objects’ in Learning Manual.

Notation Reference: Invisible rests, Visibility of objects, Hiding staves.

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Internals Reference: (internals)Note_spacing_engraver section ‘Note_spacing_engraver’ in Internals Reference, (internals)NoteSpacing section ‘NoteSpacing’ in Internals Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Coloring objects

Individual objects may be assigned colors. Valid color names are listed in the List of colors.

 
\override NoteHead.color = #red
c''4 c''
\override NoteHead.color = #(x11-color 'LimeGreen)
d''
\override Stem.color = "deepskyblue"
e''

[image of music]

In addition to a limited set of simple colors available as predefined variables (see ‘Normal colors’ in List of colors), any color may be entered as a string. That string may be either a CSS-style predefined color name, or a hexadecimal color code prefixed by the # character (inside the double quotes):

 
\override NoteHead.color = "lightsalmon"
\override Flag.color = "#E30074"
\override Beam.color = "#5e45ad"
\override Rest.color = "#3058"
g'8 \huge r4 a'16 f'

[image of music]

If that color code includes an alpha channel for semi-transparency, by using an eight-character code "#RRGGBBAA" or its shorthand form "#RGBA", it will be used in SVG output but not in PostScript/PDF output. In the previous example, the rest can be seen through only if the code is compiled with the SVG backend, as explained in Alternative output formats.

In a different way, the full range of colors defined for X11 can be accessed by using the Scheme function x11-color. That function takes one argument, which can be a symbol, such as 'DarkSeaGreen4, or a string, such as "DarkSeaGreen4". The first form is quicker to write and slightly more efficient; however, the second form also makes it possible to specify X11 colors as multiple words: in this instance, "dark sea green 4".

If x11-color cannot make sense of the parameter, then the color returned defaults to black.

 
\new Staff \with {
  instrumentName = \markup {
    \with-color #(x11-color 'red) "Clarinet"
    }
  }
  \relative c'' {
  \override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
  gis8 a
  \override Beam.color = #(x11-color "medium turquoise")
  gis a
  \override Accidental.color = #(x11-color 'DarkRed)
  gis a
  \override NoteHead.color = #(x11-color "LimeGreen")
  gis a
  % this is deliberate nonsense; note that the stems remain black
  \override Stem.color = #(x11-color 'Boggle)
  b2 cis
}

[image of music]

Exact RGB colors can be specified using the Scheme function rgb-color. This function takes three arguments used respectively for the red, green and blue channels, and an optional alpha number for semi-transparency. (All values must be numbers from 0 to 1.) Again, transparency is only supported in SVG output; for example, in the following fragment the staff’s clef can be seen through when rendered in SVG.

 
\new Staff \with {
    instrumentName = \markup {
      \with-color #(x11-color 'red) "Clarinet"
      }
    \override Clef.color = #(rgb-color 0 0 0 0.5)
  }
\relative c'' {
  \override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
  \override Stem.color = #(rgb-color 0 0 0)
  gis8 a
  \override Stem.color = #(rgb-color 1 1 1)
  gis8 a
  \override Stem.color = #(rgb-color 0 0 0.5)
  gis4 a
}

[image of music]

See also

Notation Reference: List of colors, The \tweak command.

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Known issues and warnings

An X11 color is not necessarily exactly the same shade as a similarly named normal color.

Not all X11 colors are distinguishable in a web browser, i.e., a web browser might not display a difference between LimeGreen and ForestGreen. For web use CSS colors are recommended, as detailed in List of colors.

Notes in a chord cannot be separately colored with \override; use \tweak or the equivalent \single\override before the respective note instead, see The \tweak command.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Parentheses

Objects may be parenthesized by prefixing \parenthesize to the music event. When prefixed to a chord, it parenthesizes every note. Individual notes inside a chord may also be parenthesized.

 
\relative {
  c''2 \parenthesize d
  c2 \parenthesize <c e g>
  c2 <c \parenthesize e g>
}

[image of music]

Non-note objects may be parenthesized as well. For articulations, a hyphen is needed before the \parenthesize command.

 
\relative {
  c''2-\parenthesize -. d
  c2 \parenthesize r
}

[image of music]

See also

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Internals Reference: (internals)Parenthesis_engraver section ‘Parenthesis_engraver’ in Internals Reference, (internals)ParenthesesItem section ‘ParenthesesItem’ in Internals Reference, (internals)parentheses-interface section ‘parentheses-interface’ in Internals Reference.

Known issues and warnings

Parenthesizing a chord prints parentheses around each individual note, instead of a single large parenthesis around the entire chord.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Stems

Whenever a note is found, a Stem object is created automatically. For whole notes and rests, they are also created but made invisible.

Stems may be manually placed to point up or down; see Direction and placement.

Predefined commands

\stemUp, \stemDown, \stemNeutral.

Selected Snippets

Default direction of stems on the center line of the staff

The default direction of stems on the center line of the staff is set by the Stem property neutral-direction.

 
\relative c'' {
  a4 b c b
  \override Stem.neutral-direction = #up
  a4 b c b
  \override Stem.neutral-direction = #down
  a4 b c b
}

[image of music]

Automatically changing the stem direction of the middle note based on the melody

LilyPond can alter the stem direction of the middle note on a staff so that it follows the melody, by adding the Melody_engraver to the Voice context and overriding the neutral-direction of Stem.

 
\relative c'' {
  \time 3/4
  a8 b g f b g |
  c  b d c b c |
}

\layout {
  \context {
    \Voice
    \consists "Melody_engraver"
    \autoBeamOff
    \override Stem.neutral-direction = #'()
  }
}

[image of music]

See also

Notation Reference: Direction and placement.

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Internals Reference: (internals)Stem_engraver section ‘Stem_engraver’ in Internals Reference, (internals)Stem section ‘Stem’ in Internals Reference, (internals)stem-interface section ‘stem-interface’ in Internals Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.7.2 Outside the staff

This section discusses how to add emphasis to elements in the staff from outside of the staff.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Note names

Note names can be printed as text, by using the NoteNames context. When used simultaneously with a regular staff, that makes it possible to synchronize each note with its name, printed above or below the Staff.

 
\language "italiano"
melody = \relative do'' {
  fad2 si,8 dod re mi fad4. re8 fad2
}

<<
  \new NoteNames { \melody }
  \new Staff { \key si \minor \melody }
  \new NoteNames {
    \set printNotesLanguage = "deutsch"
    \set printAccidentalNames = ##f
    \melody
  }
>>

[image of music]

By default, note names are printed in the same language used for music entry; however, the printNotesLanguage property allows to select any other language available (see Note names in other languages). Whether accidentals should be printed or not is determined through the printAccidentalNames property.

By setting both that property to a symbol and printOctaveNames to ##t, note names can be obtained that closely resemble LilyPond entry syntax. If a more generalistic result is desired, ‘scientific’ octave names may also be obtained.

 
melody = \relative c'' {
  fis2 b,8 cis d e fis4. d8 fis2
}

<<
  \new NoteNames {
    \set printOctaveNames = ##t
    \set printAccidentalNames = #'lily
    \melody
  }
  \new Staff { \key b \minor \melody }
  \new NoteNames {
    \set printOctaveNames = #'scientific
    \melody
  }
>>

[image of music]

The noteNameSeparator property defines how chords will be printed. Other formatting functions may be defined as noteNameFunction; such a function must expect a pitch and a context argument, even if one of these can then be ignored.

 
somechords = \relative c' {
  <b d fis>2 <b cis e g> <b d fis> q
}

<<
  \new NoteNames {
    \set noteNameSeparator = "+"
    \somechords
  }
  \new Staff { \key b \minor \somechords }
  \new NoteNames {
    \set noteNameFunction =
      #(lambda (pitch ctx)
         (alteration->text-accidental-markup
          (ly:pitch-alteration pitch)))
    \somechords
  }
>>

[image of music]

See also

Notation Reference: Note names in other languages.

Internals Reference: (internals)NoteName section ‘NoteName’ in Internals Reference, (internals)NoteNames section ‘NoteNames’ in Internals Reference, (internals)Note_name_engraver section ‘Note_name_engraver’ in Internals Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Balloon help

Elements of notation can be marked and named with the help of a square balloon. The primary purpose of this feature is to explain notation.

 
\new Voice \with { \consists "Balloon_engraver" }
\relative c'' {
  \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
  a8
  \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
  r
  <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
}

[image of music]

There are two music functions, balloonGrobText and balloonText; the former is used like \once \override to attach text to any grob, and the latter is used like \tweak, typically within chords, to attach text to an individual note.

Balloon text does not influence note spacing, but this can be altered:

 
\new Voice \with { \consists "Balloon_engraver" }
\relative c'' {
  \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
  a8
  \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
  r
  \balloonLengthOn
  <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
}

[image of music]

Predefined commands

\balloonLengthOn, \balloonLengthOff.

See also

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Internals Reference: (internals)Balloon_engraver section ‘Balloon_engraver’ in Internals Reference, (internals)BalloonTextItem section ‘BalloonTextItem’ in Internals Reference, (internals)balloon-interface section ‘balloon-interface’ in Internals Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Grid lines

Vertical lines can be drawn between staves synchronized with the notes.

The Grid_point_engraver must be used to create the end points of the lines, while the Grid_line_span_engraver must be used to actually draw the lines. By default this centers grid lines horizontally below and to the left side of each note head. Grid lines extend from the middle lines of each staff. The gridInterval must specify the duration between the grid lines.

 
\layout {
  \context {
    \Staff
    \consists "Grid_point_engraver"
    gridInterval = #(ly:make-moment 1/4)
  }
  \context {
    \Score
    \consists "Grid_line_span_engraver"
  }
}

\score {
  \new ChoirStaff <<
    \new Staff \relative {
      \stemUp
      c''4. d8 e8 f g4
    }
    \new Staff \relative {
      \clef bass
      \stemDown
      c4 g' f e
    }
  >>
}

[image of music]

Selected Snippets

Grid lines: changing their appearance

The appearance of grid lines can be changed by overriding some of their properties.

 
\score {
  \new ChoirStaff <<
    \new Staff {
      \relative c'' {
        \stemUp
        c'4. d8 e8 f g4
      }
    }
    \new Staff {
      \relative c {
        % this moves them up one staff space from the default position
        \override Score.GridLine.extra-offset = #'(0.0 . 1.0)
        \stemDown
        \clef bass
        \once \override Score.GridLine.thickness = #5.0
        c4
        \once \override Score.GridLine.thickness = #1.0
        g'4
        \once \override Score.GridLine.thickness = #3.0
        f4
        \once \override Score.GridLine.thickness = #5.0
        e4
      }
    }
  >>
  \layout {
    \context {
      \Staff
      % set up grids
      \consists "Grid_point_engraver"
      % set the grid interval to one quarter note
      gridInterval = #(ly:make-moment 1/4)
    }
    \context {
      \Score
      \consists "Grid_line_span_engraver"
      % this moves them to the right half a staff space
      \override NoteColumn.X-offset = #-0.5
    }
  }
}

[image of music]

See also

Snippets: (snippets)Editorial annotations section ‘Editorial annotations’ in Snippets.

Internals Reference: (internals)Grid_line_span_engraver section ‘Grid_line_span_engraver’ in Internals Reference, (internals)Grid_point_engraver section ‘Grid_point_engraver’ in Internals Reference, (internals)GridLine section ‘GridLine’ in Internals Reference, (internals)GridPoint section ‘GridPoint’ in Internals Reference, (internals)grid-line-interface section ‘grid-line-interface’ in Internals Reference, (internals)grid-point-interface section ‘grid-point-interface’ in Internals Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Analysis brackets

Brackets are used in musical analysis to indicate structure in musical pieces. Simple horizontal brackets are supported.

 
\layout {
  \context {
    \Voice
    \consists "Horizontal_bracket_engraver"
  }
}
\relative {
  c''2\startGroup
  d\stopGroup
}

[image of music]

Analysis brackets may be nested.

 
\layout {
  \context {
    \Voice
    \consists "Horizontal_bracket_engraver"
  }
}
\relative {
  c''4\startGroup\startGroup
  d4\stopGroup
  e4\startGroup
  d4\stopGroup\stopGroup
}

[image of music]

Selected Snippets

Analysis brackets above the staff

Simple horizontal analysis brackets are added below the staff by default. The following example shows a way to place them above the staff instead.

 
\layout {
  \context {
    \Voice
    \consists "Horizontal_bracket_engraver"
  }
}

\relative c'' {
  \once \override HorizontalBracket.direction = #UP
  c2\startGroup
  d2\stopGroup
}

[image of music]

Analysis brackets with labels

Text may be added to analysis brackets through the text property of the HorizontalBracketText grob. Adding different texts to brackets beginning at the same time requires the \tweak command. Bracket text will be parenthesized after a line break.

 
\layout {
  \context {
    \Voice
    \consists "Horizontal_bracket_engraver"
    \override HorizontalBracket.direction = #UP
  }
}

{
  \once\override HorizontalBracketText.text = "a"
  c''\startGroup d''\stopGroup
  \once\override HorizontalBracketText.text = "a'"
  e''\startGroup d''\stopGroup
  c''
  -\tweak HorizontalBracketText.text \markup \bold \huge "b" \startGroup
  -\tweak HorizontalBracketText.text "a" \startGroup
  d''\stopGroup
  e''-\tweak HorizontalBracketText.text "a'" \startGroup
  d''\stopGroup\stopGroup
  c''-\tweak HorizontalBracketText.text foo \startGroup d'' e'' f''
  \break
  g'' a'' b'' c'''\stopGroup
}

[image of music]

See also

Internals Reference: (internals)Horizontal_bracket_engraver section ‘Horizontal_bracket_engraver’ in Internals Reference, (internals)HorizontalBracket section ‘HorizontalBracket’ in Internals Reference, (internals)horizontal-bracket-interface section ‘horizontal-bracket-interface’ in Internals Reference, (internals)HorizontalBracketText section ‘HorizontalBracketText’ in Internals Reference, (internals)horizontal-bracket-text-interface section ‘horizontal-bracket-text-interface’ in Internals Reference, (internals)Staff section ‘Staff’ in Internals Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by gub on July 13, 2020 using texi2html 1.82.

其他语言:català, deutsch, español, français, italiano, 日本語。
关于 自动语言选择