Re: Extend all hairpins over time signature changes

2021-03-02 Thread Kieren MacMillan
>> THIS IS GOLD!
> I think it is spelt "Gould".
> David Kastrup


=)


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Re: Extend all hairpins over time signature changes

2021-03-02 Thread N Trocado
> A custom engraver could automate that:

Thank you so much Aaron! This is very helpful and instructive.
Nuno


Re: Extend all hairpins over time signature changes

2021-03-02 Thread David Kastrup
Kieren MacMillan  writes:

> Aaron,
>
>> So it just the case that you want hairpins to extend over time
> signatures?  A custom engraver could automate that:
>
> THIS IS GOLD!

I think it is spelt "Gould".

-- 
David Kastrup



Re: Extend all hairpins over time signature changes

2021-03-01 Thread Kieren MacMillan
Aaron,

> So it just the case that you want hairpins to extend over time signatures?  A 
> custom engraver could automate that:

THIS IS GOLD!

Thanks,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Re: Extend all hairpins over time signature changes

2021-03-01 Thread Aaron Hill

On 2021-03-01 2:39 pm, N Trocado wrote:

Thank you for your answer.
I do use /once when appropriate, and defining a variable indeed helps
with the typing.
But I was hoping for a way of establishing that all hairpins that
cross time signature changes extend beyond the barline, and if
lilypond took care of this automatically it would be one less thing
for me to worry about 🙂.


So it just the case that you want hairpins to extend over time 
signatures?  A custom engraver could automate that:



\version "2.22.0"

extendHairpinsAcrossTimeSignature =
#(lambda (context)
  (let ((hairpins '()))
   (define (extend-hairpin grob)
(ly:grob-set-property! grob 'to-barline #f))
   (define (add-hairpin grob)
(set! hairpins (cons grob hairpins)))
   (define (remove-hairpin grob)
(set! hairpins (remove (lambda (x) (eq? x grob)) hairpins)))
   (make-engraver
(listeners
 ((time-signature-event engraver event)
  (for-each extend-hairpin hairpins)
  (set! hairpins '(
(acknowledgers
 ((hairpin-interface engraver grob source)
  (add-hairpin grob)))
(end-acknowledgers
 ((hairpin-interface engraver grob source)
  (remove-hairpin grob))

\new Staff \with {
  \consists \extendHairpinsAcrossTimeSignature
}
\fixed c' {
  | \time 3/4 g2 a8 \< b | cis'2 \! r4
  | d'4 \> cis' b | \time 2/4 ais2 \!
  | g4 fis8 \< g | \time 3/4 a8 \! b a2 \>
  | g4 \! f e | \time 2/4 d2 \bar "|."
}



-- Aaron Hill

Re: Extend all hairpins over time signature changes

2021-03-01 Thread N Trocado
Thank you for your answer.
I do use /once when appropriate, and defining a variable indeed helps with the 
typing.
But I was hoping for a way of establishing that all hairpins that cross time 
signature changes extend beyond the barline, and if lilypond took care of this 
automatically it would be one less thing for me to worry about 🙂.
Nuno Trocado

From: Aaron Hill 
Sent: Monday, March 1, 2021 10:25 PM
To: N Trocado 
Cc: lilypond-user@gnu.org 
Subject: Re: Extend all hairpins over time signature changes

On 2021-03-01 9:52 am, N Trocado wrote:
> I like to have hairpins cut through barlines, extending to the note
> that ends them on the first beat of the next bar, whenever there's a
> time signature change. Stopping short of the barline in this case, as
> is the default, leaves a bit too much space between the end of the
> hairpin and the dynamic symbol.
> I know that I can \override Hairpin.to-barline = ##f. But would it be
> possible to configure the default behavior to work as described,
> instead of spraying overrides everywhere?

Are you doing \once \override or just \override?  A singular \override
will affect all Hairpins from that point in the music forward (or until
another \override or a \revert).  Assuming you want this behavior for
all Hairpins across all staves, just do the \override at a suitably
global level.


% Top-level or within \score
\layout { \context { \Staff \override Hairpin.to-barline = ##f } }


If you need to scope this to a particular Staff, either use the \with
block or just \override as the first thing in the music:


\new Staff \with { \override Hairpin.to-barline = ##f } { ... }
% or %
{ \override Hairpin.to-barline = ##f ... }


Finally, if you need a mixture of Hairpins that either extend to the
note or stop at the barline, then you might want to define a helper
variable:


extend = -\tweak to-barline ##f \etc

\fixed c' { \time 3/4 g2 a8 \extend \< b | \time 2/4 cis'2 \! }



-- Aaron Hill


Re: Extend all hairpins over time signature changes

2021-03-01 Thread Aaron Hill

On 2021-03-01 9:52 am, N Trocado wrote:

I like to have hairpins cut through barlines, extending to the note
that ends them on the first beat of the next bar, whenever there's a
time signature change. Stopping short of the barline in this case, as
is the default, leaves a bit too much space between the end of the
hairpin and the dynamic symbol.
I know that I can \override Hairpin.to-barline = ##f. But would it be
possible to configure the default behavior to work as described,
instead of spraying overrides everywhere?


Are you doing \once \override or just \override?  A singular \override 
will affect all Hairpins from that point in the music forward (or until 
another \override or a \revert).  Assuming you want this behavior for 
all Hairpins across all staves, just do the \override at a suitably 
global level.



% Top-level or within \score
\layout { \context { \Staff \override Hairpin.to-barline = ##f } }


If you need to scope this to a particular Staff, either use the \with 
block or just \override as the first thing in the music:



\new Staff \with { \override Hairpin.to-barline = ##f } { ... }
% or %
{ \override Hairpin.to-barline = ##f ... }


Finally, if you need a mixture of Hairpins that either extend to the 
note or stop at the barline, then you might want to define a helper 
variable:



extend = -\tweak to-barline ##f \etc

\fixed c' { \time 3/4 g2 a8 \extend \< b | \time 2/4 cis'2 \! }



-- Aaron Hill



Extend all hairpins over time signature changes

2021-03-01 Thread N Trocado
I like to have hairpins cut through barlines, extending to the note that ends 
them on the first beat of the next bar, whenever there's a time signature 
change. Stopping short of the barline in this case, as is the default, leaves a 
bit too much space between the end of the hairpin and the dynamic symbol.
I know that I can \override Hairpin.to-barline = ##f. But would it be possible 
to configure the default behavior to work as described, instead of spraying 
overrides everywhere?