[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Controlling hairpin length
From: |
Thomas Morley |
Subject: |
Re: Controlling hairpin length |
Date: |
Sat, 23 Jan 2016 13:27:26 +0100 |
2016-01-21 16:54 GMT+01:00 David Sumbler <address@hidden>:
>
> Unfortunately I am still getting some over-long hairpins. I think that
> perhaps this has nothing to do with myHairpinMinimumLength, because I
> was getting these long hairpins before you ever sent it to me - this is
> one of the reasons I was going to set about tweaking hairpin lengths in
> the piece.
>
> The 2 bars I quoted before are:
>
> % bar 14
> g8\< a b cs( ~ cs\mf\> b) d,\mp cs |
> g8\< g a g fs4\mf\> r\invP |
> d8\< e fs e as,(\mf\> b) r4\invP |
> e2\< d4\mf\> fs8(-\ten\mp fs)-\ten |
> % bar 15
> b8 cs\< d e fs-\ten\> fs\! e d \time 3/2 |
> b,8\mp as\< b cs as-\ten\> b\! r4 \time 3/2 |
> r2 cs8-\ten\mf\> b\! r4 \time 3/2 |
> g8 e\< fs e fs-\ten\> d\! r4 \time 3/2 |
>
> This is in \parallelMusic for a string quartet.
If I compile it with the following code, without(!!) any override I
get the attached image.
\parallelMusic #'(E F G H) {
% bar 14
g8\< a b cs( ~ cs\mf\> b) d,\mp cs |
g8\< g a g fs4\mf\> r\invP |
d8\< e fs e as,(\mf\> b) r4\invP |
e2\< d4\mf\> fs8(-\ten\mp fs)-\ten |
% bar 15
b8 cs\< d e fs-\ten\> fs\! e d \time 3/2 |
b,8\mp as\< b cs as-\ten\> b\! r4 \time 3/2 |
r2 cs8-\ten\mf\> b\! r4 \time 3/2 |
g8 e\< fs e fs-\ten\> d\! r4 \time 3/2 |
}
\new StaffGroup <<
\new Staff \E
\new Staff \F
\new Staff \G
\new Staff \H
>>
\new Staff \E
\new Staff \F
\new Staff \G
\new Staff \H
Ofcourse there are some too short Hairpins, but I can't see any too long.
Nevertheless I changed `my-hairpin-minimum-length' to
#(define (my-hairpin-minimum-length grob)
"Sets @code{minimum-length} for @code{Hairpin}, if their left bound is not the
@code{NoteColumn}.
The visible length is actually the one, specified by an additional override for
@code{minimum-length} or the default.
If left bound is @code{NoteColumn}, default or specified @code{minimum-length}
will take over."
(let* ((bound-left (ly:spanner-bound grob LEFT))
(bound-right (ly:spanner-bound grob RIGHT))
(sys (look-up-for-parent 'System Y grob))
(left-x-ext (ly:grob-extent bound-left sys X))
(not-note-column?
(lambda (g)
(not (and (ly:grob? g)
(grob::has-interface g 'note-column-interface))))))
(if (and (not-note-column? bound-left)
(interval-sane? left-x-ext)
(> (abs (cdr left-x-ext))
(ly:grob-property-data grob 'minimum-length)))
(ly:grob-set-property! grob 'minimum-length
(+
(ly:grob-property-data grob 'minimum-length)
(* (if (not-note-column? bound-right) 2 1) (cdr left-x-ext)))))))
Applying it as before I get the second attached png.
Looks quite ok to me.
Though please be aware, all I can do is to provide a more or less
workable work around issue 2207.
There are a lot of things which determine actual Hairpin length.
I doubt I can reasonable cover them.
I think you should do
\revert Hairpin.before-line-breaking
in cases where `myHairpinMinimumLength' doesn't return acceptable
results and tweak manually.
HTH,
Harm
hairpin-minimum-length-02.png
Description: PNG image
hairpin-minimum-length-02-tweaked.png
Description: PNG image
- Re: Controlling hairpin length, (continued)
- Re: Controlling hairpin length, David Sumbler, 2016/01/17
- Re: Controlling hairpin length, Thomas Morley, 2016/01/17
- Re: Controlling hairpin length, David Sumbler, 2016/01/18
- Re: Controlling hairpin length, Thomas Morley, 2016/01/18
- Re: Controlling hairpin length, Thomas Morley, 2016/01/18
- Re: Controlling hairpin length, David Sumbler, 2016/01/19
- Re: Controlling hairpin length, Thomas Morley, 2016/01/19
- Re: Controlling hairpin length, David Sumbler, 2016/01/21
- Re: Controlling hairpin length, Thomas Morley, 2016/01/22
- Re: Controlling hairpin length, David Sumbler, 2016/01/22
- Re: Controlling hairpin length,
Thomas Morley <=
- Re: Controlling hairpin length, Michael Gerdau, 2016/01/23
- Re: Controlling hairpin length, David Sumbler, 2016/01/24