lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controlling hairpin length - revisited!


From: David Sumbler
Subject: Re: Controlling hairpin length - revisited!
Date: Fri, 14 Oct 2016 09:44:16 +0100

On Thu, 2016-10-13 at 23:54 +0200, Simon Albrecht wrote:
> On 13.10.2016 14:41, David Sumbler wrote:
> > 
> > On Wed, 2016-10-12 at 14:10 -0400, Kieren MacMillan wrote:
> > > 
> > > Hi David,
> > > 
> > > > 
> > > > But I realise that often what I need in order to get
> > > > satisfactory
> > > > hairpins is more space between the note heads, and simply
> > > > moving
> > > > the
> > > > ends of the hairpin does not reposition the relevant notes.
> > > Have you tried adjusting the minimum-length?
> > > 
> > > %%%  SNIPPET BEGINS
> > > \version "2.18.2"
> > > \language "english"
> > > 
> > > after =
> > > #(define-music-function (parser location t e m)
> > >       (ly:duration? ly:music? ly:music?)
> > >       #{
> > >           \context Bottom <<
> > >               #m
> > >               { \skip $t <> -\tweak extra-spacing-width #empty-
> > > interval $e }
> > >           >>
> > >       #})
> > > 
> > > testing = \relative e'' {
> > >    \override Hairpin.minimum-length = #5
> > >    e8 cs ds d \after 4 \> \after 4 \mf cs2\< ~ cs4 d8(\p cs)
> > > }
> > > 
> > > \score { \testing }
> > > %%%  SNIPPET ENDS
> > > 
> > > Hope that helps!
> > > Kieren.
> > Thanks, that's brilliant.  With this and Hairpin.shorten-pair I
> > should
> > be able to solve most or all of the problems I often find with
> > hairpins.
> > 
> > I have read all the material in the list archive relating to this
> > function.
> Which function? \after?

Yes

> after =
> %% create a music function with three arguments and assign it to the 
> variable `after`
> #(define-music-function (parser location t e m)
>     ;; give the types of the three arguments as predicate procedures
>     (ly:duration? ly:music? ly:music?)
>     ;; have the expression in #{#} evaluated by the LilyPond parser
>     #{
>       %% Bottom is a kind of alias usually referring to Voice.
>       %% In this case, it’s there to prevent creating new Voices,
>       %% so the simultaneous music <<>> remains in one Voice.
>       \context Bottom <<
>         %% first expression in the simultaneous music: the last
> argument 
> passed to the function
>         #m
> 
>         %% second expression:
>         %% \skip $t creates a skip of the duration given as first 
> argument of the function
>         %% <> is an empty chord with no duration
>         %% the tweak prevents the spacing to be distorted by the 
> inserted item $e
>         %% empty-interval is defined in scm/lily-library.scm as 
> #'(+inf.0 . -inf.0),
>         %% i.e. actually an infinitely small interval. Maybe #'(0 .
> 0) 
> would work just as well,
>         %% but it might also cause errors or unwanted behaviour.
>         { \skip $t <> -\tweak extra-spacing-width #empty-interval $e
> }
>       >>
>     #})
> 
> HTH, Simon

Thank you - that is very helpful, and most of it is clear to me now.

If I could bother you a bit further...

We have
#(define-music-function (parser location t e m)

In my file, I have at one point
\after 4 \> cs2\< ~ cs4

Clearly the value of t is 4 (a crotchet or quarter-note length);
e is \> (a hairpin);
m is cs2; or probably cs2\< (since the crescendo hairpin has to be
placed before the other dynamics).  I'm not quite sure what is
considered a single item of music.  What is the value of m here?

Looking at the function code, it seems that the music items are
processed in reverse order (which is what one would expect), i.e. item
m is processed, then the additional item e, which is placed later.  So
far, so good.

What I actually have at one point in the file is
\after 4 \mf \after 4 \> cs2\< ~ cs4

At the first call of the function, t has the value 4, but I'm a bit
unclear about how the rest is parsed.  What are the values of e and m
in this case?

I imagine that the music items are processed in reverse order here too,
i.e. cs2, then the diminuendo hairpin, then the mf mark.  By
experimenting I find that it doesn't make any practical difference
whether I put the mf first and the hairpin second or vice versa.  But
it would be nice to know just what is going on here.

David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]