Re: \after … \beforeLast?
On Fri, May 3, 2024 at 3:04 AM Mats Bengtsson wrote: > > If you want the (de-)crescendo to stop at the barline, then you > shouldn't need such solutions, since \< and \> have the to-barline > property set by default, which means that even if the \! is placed after > the bar line, the hairpin will stop nicely just at the end of the bar: > > \version "2.24.0" > > { ><>\< \repeat unfold 8 {e''16 d''} <>\! | >c'1 | >% Strangely enough, to-barline isn't the default for textual > de(crescendi): >\override DynamicTextSpanner.to-barline = ##t ><>\cresc \repeat unfold 8 {e''16 d''} <>\! | >c'1 | > } > That works well with dynamics, but it doesn't work well with something like sustain pedalling. There is no to-barline property (that I'm aware of) so a construction like this: \version "2.24.3" \relative { c''4\sustainOn c c c <>\sustainOff | c4\sustainOn c c c <>\sustainOff | \break c4\sustainOn c c c <>\sustainOff | } ... means you will get a combined sustainOff/sustainOn at the first beat of the second and third measures and an error from the last <>sustainOff in the code. -- Knute Snortum
Re: \after … \beforeLast?
On 2024-05-02 21:19, Knute Snortum wrote: On Thu, May 2, 2024 at 10:31 AM Pierre-Luc Gauthier wrote: Le jeu. 2 mai 2024, à 13 h 08, Knute Snortum a écrit : > Perhaps I'm not getting the need for this command as you could using an empty chord at the end of the repeat to do the same thing: > > { > <>(\< > \after 2 \> > \repeat unfold 8 {e''16 d''} <>)\!| > } The above example would not work if I add another note : { \repeat unfold 8 {e''16 d''} <>\f | c'1 | } The "empty chord" syntax (which probably has a name? (and is not a chord in my understanding)) pushes the expression to the next event. Yes, you're right that the empty chord (this is what I've heard others call it) does not actually put the event at the end of the measure, but the beginning of the next measure. I use a different context for all my dynamics and I've gotten so used to typing... { s2...\< s16\! | } ...that I do it almost automatically. But I can see now that a "fromEnd" command would be useful. If you want the (de-)crescendo to stop at the barline, then you shouldn't need such solutions, since \< and \> have the to-barline property set by default, which means that even if the \! is placed after the bar line, the hairpin will stop nicely just at the end of the bar: \version "2.24.0" { <>\< \repeat unfold 8 {e''16 d''} <>\! | c'1 | % Strangely enough, to-barline isn't the default for textual de(crescendi): \override DynamicTextSpanner.to-barline = ##t <>\cresc \repeat unfold 8 {e''16 d''} <>\! | c'1 | } /Mats -- Knute Snortum
Re: \after … \beforeLast?
On Thu, May 2, 2024 at 1:10 PM Pierre-Luc Gauthier wrote: > > { > > s2...\< s16\! | > > } > > ...that I do it almost automatically. > > Try that in 12/8 :-) > { \time 12/8 s1*23/16\< s16\! | % ?? } Yeah, I see your point. ;) -- Knute Snortum
Re: \after … \beforeLast?
Le jeu. 2 mai 2024, à 15 h 20, Knute Snortum a écrit : > I use a different context for all my dynamics and I've gotten so used to > typing... I do too. For bowing, nuances, articulations, etc. Btw I use quite a lot of \quoting and \tagging for that. > { > s2...\< s16\! | > } > ...that I do it almost automatically. Try that in 12/8 :-) -- Pierre-Luc Gauthier
Re: \after … \beforeLast?
On Thu, May 2, 2024 at 10:31 AM Pierre-Luc Gauthier < p.luc.gauth...@gmail.com> wrote: > Le jeu. 2 mai 2024, à 13 h 08, Knute Snortum a écrit > : > > Perhaps I'm not getting the need for this command as you could using an > empty chord at the end of the repeat to do the same thing: > > > > { > > <>(\< > > \after 2 \> > > \repeat unfold 8 {e''16 d''} <>)\!| > > } > > The above example would not work if I add another note : > > { > \repeat unfold 8 {e''16 d''} <>\f | > c'1 | > } > > The "empty chord" syntax (which probably has a name? (and is not a > chord in my understanding)) pushes the expression to the next event. > Yes, you're right that the empty chord (this is what I've heard others call it) does not actually put the event at the end of the measure, but the beginning of the next measure. I use a different context for all my dynamics and I've gotten so used to typing... { s2...\< s16\! | } ...that I do it almost automatically. But I can see now that a "fromEnd" command would be useful. -- Knute Snortum
Re: \after … \beforeLast?
Maybe one addition: fromEnd = #(define-music-function (delta ev mus) (ly:duration? ly:music? ly:music?) (_i "Add music @var{ev} with a distance of @var{delta} before the end of @var{ev} is usually a post-event.") #{ \context Bottom << { \skip $(make-duration-of-length (- (ly:music-length mus) (ly:duration-length delta))) <> $ev } #mus >> #}) { <>( <>\< \after 2 \> \after 16*15 ) \fromEnd 16 \! \fromEnd 8 -> \repeat unfold 8 {e''16 d''} | } In ordner to make this work with slightly older LilyPond versions, one has to replace "-" by "ly:moment-sub": \skip $(make-duration-of-length (ly:moment-sub (ly:music-length mus) (ly:duration-length delta))) The operator overloading that allows for "naive" arithmetic with moments was only added sometime in the 2.25.x series. Lukas
Re: \after … \beforeLast?
Thanks Lukas, Le jeu. 2 mai 2024, à 13 h 29, Lukas-Fabian Moser a écrit : > fromEnd = > #(define-music-function (delta ev mus) (ly:duration? ly:music? ly:music?) >(_i "Add music @var{ev} with a distance of @var{delta} before the end of > > @var{ev} is usually a post-event.") >#{ > \context Bottom > << >{ > \skip $(make-duration-of-length (- (ly:music-length mus) > (ly:duration-length delta))) > <> $ev >} >#mus >>> #}) > > > { ><>( ><>\< >\after 2 \> >\after 16*15 ) >\fromEnd 16 \! >\fromEnd 8 -> >\repeat unfold 8 {e''16 d''} | > } > > > > \beforeLast (in the sense of "before the last note of the given music > argument") isn't likely to work though, since it's not guaranteed that > the music given is SequentialMusic: What is the last note of a << >> > expression? Of course. I said \beforeLast not as \before-the-last-note-please but rather \beforeEnd. \fromEnd is way clearer. I've added your snippet and will surely make good use of it ! Thank you very much. -- Pierre-Luc Gauthier
Re: \after … \beforeLast?
Le jeu. 2 mai 2024, à 13 h 08, Knute Snortum a écrit : > Perhaps I'm not getting the need for this command as you could using an empty > chord at the end of the repeat to do the same thing: > > { > <>(\< > \after 2 \> > \repeat unfold 8 {e''16 d''} <>)\!| > } The above example would not work if I add another note : { \repeat unfold 8 {e''16 d''} <>\f | c'1 | } The "empty chord" syntax (which probably has a name? (and is not a chord in my understanding)) pushes the expression to the next event. So maybe my example is klonky. -- Pierre-Luc Gauthier
Re: \after … \beforeLast?
Hi Pierre-Luc, Am 02.05.24 um 17:02 schrieb Pierre-Luc Gauthier: Rambling here : So, I *love* the simplicity and elegance of the \after command and I am using it pretty much everywhere. { <>( <>\< \after 2 \> \after 16*15 ) \after 16*15 \! \repeat unfold 8 {e''16 d''} | } and since then I often end up doing head math to figure out what I must add to \after for it to end up e.g. an 8th *before* the end of the expression. In the above example it is quite easy : a 16th before the end is... 16*#(- 16 1). So what about a \beforeLast command that would do sort of the \after job but starting from the end of the expression rather from the start ? e.g. : \beforeLast 16 \! … \pænultimus 16 ) \preantepenultimate 16 \! ^ Both above are strictly for laughing usage (provided it could have such effect). Should I : https://gitlab.com/lilypond/lilypond/-/issues/new and flag as Enhancement ? Something like this? %%% \version "2.25.9" fromEnd = #(define-music-function (delta ev mus) (ly:duration? ly:music? ly:music?) (_i "Add music @var{ev} with a distance of @var{delta} before the end of @var{ev} is usually a post-event.") #{ \context Bottom << { \skip $(make-duration-of-length (- (ly:music-length mus) (ly:duration-length delta))) <> $ev } #mus >> #}) { <>( <>\< \after 2 \> \after 16*15 ) \fromEnd 16 \! \fromEnd 8 -> \repeat unfold 8 {e''16 d''} | } \beforeLast (in the sense of "before the last note of the given music argument") isn't likely to work though, since it's not guaranteed that the music given is SequentialMusic: What is the last note of a << >> expression? Lukas
Re: \after … \beforeLast?
On 2 May 2024, at 19:08, Knute Snortum wrote:On Thu, May 2, 2024 at 8:04 AM Pierre-Luc Gauthierwrote:Rambling here : So, I *love* the simplicity and elegance of the \after command and I am using it pretty much everywhere. { <>( <>\< \after 2 \> \after 16*15 ) \after 16*15 \! \repeat unfold 8 {e''16 d''} | } and since then I often end up doing head math to figure out what I must add to \after for it to end up e.g. an 8th *before* the end of the _expression_. In the above example it is quite easy : a 16th before the end is... 16*#(- 16 1). So what about a \beforeLast command that would do sort of the \after job but starting from the end of the _expression_ rather from the start ? e.g. : \beforeLast 16 \!Perhaps I'm not getting the need for this command as you could using an empty chord at the end of the repeat to do the same thing:{ <>(\< \after 2 \> \repeat unfold 8 {e''16 d''} <>)\!|}To my understanding that would put the \! on the last unfolded d''. In my reading the intention of OP is to put the \! on the last unfolded e''Maybe there are other situations where \beforeLast would be useful? --Knute Snortum
Re: \after … \beforeLast?
On Thu, May 2, 2024 at 8:04 AM Pierre-Luc Gauthier wrote: > Rambling here : > > So, I *love* the simplicity and elegance of the \after command and I > am using it pretty much everywhere. > > { > <>( > <>\< > \after 2 \> > \after 16*15 ) > \after 16*15 \! > \repeat unfold 8 {e''16 d''} | > } > > and since then I often end up doing head math to figure out what I > must add to \after for it to end up e.g. an 8th *before* the end of > the expression. In the above example it is quite easy : > a 16th before the end is... 16*#(- 16 1). > > So what about a \beforeLast command that would do sort of the \after > job but starting from the end of the expression rather from the start > ? > e.g. : > \beforeLast 16 \! > Perhaps I'm not getting the need for this command as you could using an empty chord at the end of the repeat to do the same thing: { <>(\< \after 2 \> \repeat unfold 8 {e''16 d''} <>)\!| } Maybe there are other situations where \beforeLast would be useful? -- Knute Snortum