Preventing notes from being beamed when using \breathe: Difference between revisions
Appearance
Import snippet from LSR |
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series |
||
| Line 1: | Line 1: | ||
Notes that are separated with a <code>\breathe</code> sign are usually not beamed in engraved music. However, LilyPond currently ignores it by default. Here is a way to define a new command that includes a <code>\noBeam</code> instruction. You can even name it “breathe”, if you want to replace the existing function; however, as the example shows, there are some limitations too, that require explicit manual beaming in some situations. | Notes that are separated with a <code>\breathe</code> sign are usually not beamed in engraved music. However, LilyPond currently ignores it by default. Here is a way to define a new command that includes a <code>\noBeam</code> instruction. You can even name it “breathe”, if you want to replace the existing function; however, as the example shows, there are some limitations too, that require explicit manual beaming in some situations. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
%% http://lsr.di.unimi.it/LSR/Item?id=403 | %% http://lsr.di.unimi.it/LSR/Item?id=403 | ||
Revision as of 18:52, 16 November 2025
Notes that are separated with a \breathe sign are usually not beamed in engraved music. However, LilyPond currently ignores it by default. Here is a way to define a new command that includes a \noBeam instruction. You can even name it “breathe”, if you want to replace the existing function; however, as the example shows, there are some limitations too, that require explicit manual beaming in some situations.
\version "2.24"
%% http://lsr.di.unimi.it/LSR/Item?id=403
% Alternative definition of \breathe that also does \noBeam
% You can as well name this function "breathe", to replace the existing one.
breathenobeam =
#(define-music-function () ()
(make-music 'EventChord
'origin (*location*)
'elements (list (make-music 'BreathingEvent)
(make-music 'BeamForbidEvent))))
\relative c'{
c8^"Using default \breathe"
d e \breathe f g f e \breathe d
c8^"Using the new one"
d e \breathenobeam f g f e \breathenobeam d
c8^"limitation: \breathe and \breathenobeam are just as bad"
[ d e] \breathenobeam f g[ f e] \breathe d
}