Jump to content

Engraving ties manually: Difference between revisions

From LilyPond wiki
m Doesn't need to be full
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A single tie may be engraved manually by changing the <code>staff-position</code> property (an offset) of the <code>Tie</code> grob; if there are multiple ties at the same musical moment, they can be adjusted manually by changing the <code>tie-configuration</code> property (a list of offset/direction pairs) of the <code>TieColumn</code> object.
A single tie may be engraved manually by changing the <code>staff-position</code> property (an offset) of the <code>Tie</code> grob; if there are multiple ties at the same musical moment, they can be adjusted manually by changing the <code>tie-configuration</code> property (a list of offset/direction pairs) of the <code>TieColumn</code> object.


The offset indicates the distance from the center of the staff in half staff spaces, the direction can be either 1 (up) or -1 (down).
The offset indicates the distance from the center of the staff in half-staff spaces, the direction can be either 1 (up) or -1 (down).


Note that LilyPond makes a distinction between exact and inexact values for the offset. If using an exact value (i.e., either an integer or a fraction like <code>(/ 4 5)</code>), the value serves as a rough vertical position that gets further tuned by LilyPond to make the tie avoid staff lines. If using an inexact value like a floating point number, it is taken as the precise vertical position without further adjustments.
Note that LilyPond makes a distinction between exact and inexact values for the offset. If using an exact value (i.e., either an integer or a fraction like <code>(/ 4 5)</code>), the value serves as a rough vertical position that gets further tuned by LilyPond to make the tie avoid staff lines. If using an inexact value like a floating point number, it is taken as the precise vertical position without further adjustments.


<lilypond version="2.24.0">
<lilypond version="2.24">
\relative c' {
\relative c' {
   <>^"default"
   <>^"default"
Line 44: Line 44:
   <c e g>1~ <c e g>
   <c e g>1~ <c e g>
}
}
\paper { tagline = ##f }
</lilypond>
</lilypond>


[[Category:Rhythms]]
[[Category:Rhythms]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Latest revision as of 10:51, 30 November 2025

A single tie may be engraved manually by changing the staff-position property (an offset) of the Tie grob; if there are multiple ties at the same musical moment, they can be adjusted manually by changing the tie-configuration property (a list of offset/direction pairs) of the TieColumn object.

The offset indicates the distance from the center of the staff in half-staff spaces, the direction can be either 1 (up) or -1 (down).

Note that LilyPond makes a distinction between exact and inexact values for the offset. If using an exact value (i.e., either an integer or a fraction like (/ 4 5)), the value serves as a rough vertical position that gets further tuned by LilyPond to make the tie avoid staff lines. If using an inexact value like a floating point number, it is taken as the precise vertical position without further adjustments.

\version "2.24"

\relative c' {
  <>^"default"
  g'1 ^~ g

  <>^"0"
  \once \override Tie.staff-position = 0
  g1 ^~ g

  <>^"0.0"
  \once \override Tie.staff-position = 0.0
  g1 ^~ g

  <>^"reset"
  \revert Tie.staff-position
  g1 ^~ g
}

\relative c' {
  \override TextScript.outside-staff-priority = ##f
  \override TextScript.padding = 0

  <>^"default"
  <c e g>1~ <c e g>

  <>^"0, -2, -4"
  \override TieColumn.tie-configuration =
    #'((0 . 1) (-2 . 1) (-4 . 1))
  <c e g>1~ <c e g>

  <>^"0.0, -2.0, -4.0"
  \override TieColumn.tie-configuration =
    #'((0.0 . 1) (-2.0 . 1) (-4.0 . 1))
  <c e g>1~ <c e g>

  <>^"reset"
  \override TieColumn.tie-configuration = ##f
  <c e g>1~ <c e g>
}