Jump to content

Combining beam and slur in one keystroke: Difference between revisions

From LilyPond wiki
No edit summary
m New category
 
Line 63: Line 63:


[[Category:Vocal music]]
[[Category:Vocal music]]
[[Category:Syntax and expressions]][[Category:Snippet]]
[[Category:Syntax and expressions]]
[[Category:Snippet]]

Latest revision as of 23:15, 21 November 2025

If a vocal part contains many short note values and melismata, and melismata are shown by both beams and slurs, there are many instances of d([ b)] for example. To save tedious keystrokes, it’s very convenient to redefine [ and ] so they provoke both the beam and the slur. Alternatively, the slurs may be omitted as in the second example, to avoid misinterpretations (performers might take the slur as an indication for dynamics and articulation, even if it’s only intended to provide information on melismata) or to get a clearer, less crowded look.

\version "2.24"

\paper { tagline = ##f }

"[" =
- #(make-music
    'SlurEvent
    'span-direction
    -1)
- #(make-music
    'BeamEvent
    'span-direction
    -1)
"]" =
- #(make-music
    'SlurEvent
    'span-direction
    1)
- #(make-music
    'BeamEvent
    'span-direction
    1)

\score {
  \relative {
    \autoBeamOff
    r8 c' a' g16[ f] g8 c, f16[ e f] d
    e4( d\prall) c\fermata \bar "|." }
  \addlyrics {
    This on -- ly serves as an ex -- am -- ple. }
}

"[" =
- \tweak stencil ##f
- #(make-music
    'SlurEvent
    'span-direction
    -1)
- #(make-music
    'BeamEvent
    'span-direction
    -1)
"]" =
- #(make-music
    'SlurEvent
    'span-direction
    1)
- #(make-music
    'BeamEvent
    'span-direction
    1)

\score {
  \relative {
    \autoBeamOff
    r8 c' a' g16[ f] g8 c, f16[ e f] d
    e4( d\prall) c\fermata \bar "|." }
  \addlyrics {
    This on -- ly serves as an ex -- am -- ple. }
}