Shape the angle of a broken hairpin's first part

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Shape the angle of a broken hairpin's first part

Urs Liska-3
I have a broken hairpin whose first part is pretty short. As a
consequence its internal angle looks too wide for my taste (see attached
PNG). I would like to have the two lines wider apart with a narrower
angle to more adequately reflect the overall length of the hairpin,
similar to the second attached image from the corresponding music
without line break.

I would only know about the "height" property of a hairpin, but that's
not what I need, and it doesn't help me towards tweaking the first part
only ...

I'd be glad about any suggestions or solution.

Thanks
Urs


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

encore.png (3K) Download Attachment
encore.png (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Thomas Morley-2
2018-09-17 8:43 GMT+02:00 Urs Liska <[hidden email]>:

> I have a broken hairpin whose first part is pretty short. As a consequence
> its internal angle looks too wide for my taste (see attached PNG). I would
> like to have the two lines wider apart with a narrower angle to more
> adequately reflect the overall length of the hairpin, similar to the second
> attached image from the corresponding music without line break.
>
> I would only know about the "height" property of a hairpin, but that's not
> what I need, and it doesn't help me towards tweaking the first part only ...
>
> I'd be glad about any suggestions or solution.
>
> Thanks
> Urs

Hi Urs,

iiuc, you will need to tackle the stencil of the first part. Going
directly for 'height doesn't work for me. Iirc there are some
procedures setting the heights of broken hairpins, without the
possibility to customize it.

But you can set the desired 'height for the selected hairpin-part and
call the default stencil afterwards . Leading to:

{
    \override Hairpin.stencil =
    #(lambda (grob)
      (let* ((orig (ly:grob-original grob))
             (siblings (if (ly:grob? orig)
                           (ly:spanner-broken-into orig) '() )))
        (if (and (pair? siblings) (equal? grob (car siblings)))
            (ly:grob-set-property! grob 'height 5))
        ly:hairpin::print))
    c'1\<
    \break
    s4
    c'2.\!
}
The value 5 is ofcourse only for the show. Adjust as you wish.



HTH,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Urs Liska-3
Hi Harm,

thanks for this, which gives me a handle to the first part of the
hairpin at least.

But my problem is not solved with the 'height property.


Am 17.09.2018 um 11:49 schrieb Thomas Morley:

> 2018-09-17 8:43 GMT+02:00 Urs Liska <[hidden email]>:
>> I have a broken hairpin whose first part is pretty short. As a consequence
>> its internal angle looks too wide for my taste (see attached PNG). I would
>> like to have the two lines wider apart with a narrower angle to more
>> adequately reflect the overall length of the hairpin, similar to the second
>> attached image from the corresponding music without line break.
>>
>> I would only know about the "height" property of a hairpin, but that's not
>> what I need, and it doesn't help me towards tweaking the first part only ...
>>
>> I'd be glad about any suggestions or solution.
>>
>> Thanks
>> Urs
> Hi Urs,
>
> iiuc, you will need to tackle the stencil of the first part. Going
> directly for 'height doesn't work for me. Iirc there are some
> procedures setting the heights of broken hairpins, without the
> possibility to customize it.
>
> But you can set the desired 'height for the selected hairpin-part and
> call the default stencil afterwards . Leading to:
>
> {
>      \override Hairpin.stencil =
>      #(lambda (grob)
>        (let* ((orig (ly:grob-original grob))
>               (siblings (if (ly:grob? orig)
>                             (ly:spanner-broken-into orig) '() )))
>          (if (and (pair? siblings) (equal? grob (car siblings)))
>              (ly:grob-set-property! grob 'height 5))
>          ly:hairpin::print))
>      c'1\<
>      \break
>      s4
>      c'2.\!
> }
> The value 5 is ofcourse only for the show. Adjust as you wish.


See my updated example (only the line with the start of the hairpin is
changed):

{
     \override Hairpin.stencil =
     #(lambda (grob)
       (let* ((orig (ly:grob-original grob))
              (siblings (if (ly:grob? orig)
                            (ly:spanner-broken-into orig) '() )))
         (if (and (pair? siblings) (equal? grob (car siblings)))
             (ly:grob-set-property! grob 'height 5))
         ly:hairpin::print))
     c'2.... c'32\>
     \break
     s4
     c'2.\!
}

Here you can see nicely how the angles of the first hairpin are too
steep, it looks like the hairpin would be closed shortly after the
barline. Is there any way to modify either the angle of that sibling's
line or for example the "height" at the point where the hairpin is cut off?

Thanks
Urs

>
>
>
> HTH,
>    Harm


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Thomas Morley-2
2018-09-17 11:55 GMT+02:00 Urs Liska <[hidden email]>:
> thanks for this, which gives me a handle to the first part of the hairpin at
> least.
>
> But my problem is not solved with the 'height property.
[...]

> See my updated example
[...]

I'll have a look in the evening, now I have to run for my regular job ...

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Thomas Morley-2
2018-09-17 12:05 GMT+02:00 Thomas Morley <[hidden email]>:

> 2018-09-17 11:55 GMT+02:00 Urs Liska <[hidden email]>:
>> thanks for this, which gives me a handle to the first part of the hairpin at
>> least.
>>
>> But my problem is not solved with the 'height property.
> [...]
>
>> See my updated example
> [...]
>
> I'll have a look in the evening, now I have to run for my regular job ...
>
> Cheers,
>   Harm
Hi Urs,

as said before you'll need to go for the 'stencil.
Though, ly:hairpin::print, the default-stencil, is coded in C++. There
the defaults-heights for broken hairpins are set to 1/3 and 2/3 of
'height.
Thus we need a scheme-rewrite of the stencil-procedure to reset them.
Below I slightly extend a coding by David Nalesnik from
https://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00181.html

Btw, the rest of the linked thread is very interesting as well:
Once you have a scheme-rewrite it's possible to add a plethora of
other features...

Back on topic.
Attached you'll find David's coding. My addition is to add a
'broken-heights-property.
Now you can adjust the values and call the scheme-stencil afterwards,
instead of the default-stencil.

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

hairpin-scheme-enhanced-02.ly (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Urs Liska-3
Hi Harm,

thank you very much!


Am 17.09.2018 um 22:35 schrieb Thomas Morley:

> 2018-09-17 12:05 GMT+02:00 Thomas Morley <[hidden email]>:
>> 2018-09-17 11:55 GMT+02:00 Urs Liska <[hidden email]>:
>>> thanks for this, which gives me a handle to the first part of the hairpin at
>>> least.
>>>
>>> But my problem is not solved with the 'height property.
>> [...]
>>
>>> See my updated example
>> [...]
>>
>> I'll have a look in the evening, now I have to run for my regular job ...
>>
>> Cheers,
>>    Harm
> Hi Urs,
>
> as said before you'll need to go for the 'stencil.
> Though, ly:hairpin::print, the default-stencil, is coded in C++. There
> the defaults-heights for broken hairpins are set to 1/3 and 2/3 of
> 'height.
> Thus we need a scheme-rewrite of the stencil-procedure to reset them.
> Below I slightly extend a coding by David Nalesnik from
> https://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00181.html
>
> Btw, the rest of the linked thread is very interesting as well:
> Once you have a scheme-rewrite it's possible to add a plethora of
> other features...
>
> Back on topic.
> Attached you'll find David's coding. My addition is to add a
> 'broken-heights-property.
> Now you can adjust the values and call the scheme-stencil afterwards,
> instead of the default-stencil.

This will work for my case - although it's somewhat ridiculous to
include such a massive file just to fix one graphic issue.
I think this is something that should be user-settable. Maybe a property
like yours as a native Hairpin property and/or a setting of the maximum
angle hairpin lines may have. The latter would also be a viable setting
(as opposed to minimum-length) to prevent those crippled too-short
hairpins that are often hard to spot. I think I'll post a feature request.

Best
Urs

>
> Cheers,
>    Harm


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Urs Liska-3


Am 18.09.2018 um 11:09 schrieb Urs Liska:

> Hi Harm,
>
> thank you very much!
>
>
> Am 17.09.2018 um 22:35 schrieb Thomas Morley:
>> 2018-09-17 12:05 GMT+02:00 Thomas Morley <[hidden email]>:
>>> 2018-09-17 11:55 GMT+02:00 Urs Liska <[hidden email]>:
>>>> thanks for this, which gives me a handle to the first part of the
>>>> hairpin at
>>>> least.
>>>>
>>>> But my problem is not solved with the 'height property.
>>> [...]
>>>
>>>> See my updated example
>>> [...]
>>>
>>> I'll have a look in the evening, now I have to run for my regular
>>> job ...
>>>
>>> Cheers,
>>>    Harm
>> Hi Urs,
>>
>> as said before you'll need to go for the 'stencil.
>> Though, ly:hairpin::print, the default-stencil, is coded in C++. There
>> the defaults-heights for broken hairpins are set to 1/3 and 2/3 of
>> 'height.
>> Thus we need a scheme-rewrite of the stencil-procedure to reset them.
>> Below I slightly extend a coding by David Nalesnik from
>> https://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00181.html
>>
>> Btw, the rest of the linked thread is very interesting as well:
>> Once you have a scheme-rewrite it's possible to add a plethora of
>> other features...
>>
>> Back on topic.
>> Attached you'll find David's coding. My addition is to add a
>> 'broken-heights-property.
>> Now you can adjust the values and call the scheme-stencil afterwards,
>> instead of the default-stencil.
>
> This will work for my case - although it's somewhat ridiculous to
> include such a massive file just to fix one graphic issue.
> I think this is something that should be user-settable. Maybe a
> property like yours as a native Hairpin property and/or a setting of
> the maximum angle hairpin lines may have. The latter would also be a
> viable setting (as opposed to minimum-length) to prevent those
> crippled too-short hairpins that are often hard to spot. I think I'll
> post a feature request.
>
> Best
> Urs

Ah, I forgot to ask one thing: 'broken-heights is overridden with two
values, but I don't see the second one making any difference. What is
that about?

Urs

>
>>
>> Cheers,
>>    Harm
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Thomas Morley-2
2018-09-18 11:13 GMT+02:00 Urs Liska <[hidden email]>:

>
>
> Am 18.09.2018 um 11:09 schrieb Urs Liska:
>>
>> Hi Harm,
>>
>> thank you very much!
>>
>>
>> Am 17.09.2018 um 22:35 schrieb Thomas Morley:
>>>
>>> 2018-09-17 12:05 GMT+02:00 Thomas Morley <[hidden email]>:
>>>>
>>>> 2018-09-17 11:55 GMT+02:00 Urs Liska <[hidden email]>:
>>>>>
>>>>> thanks for this, which gives me a handle to the first part of the
>>>>> hairpin at
>>>>> least.
>>>>>
>>>>> But my problem is not solved with the 'height property.
>>>>
>>>> [...]
>>>>
>>>>> See my updated example
>>>>
>>>> [...]
>>>>
>>>> I'll have a look in the evening, now I have to run for my regular job
>>>> ...
>>>>
>>>> Cheers,
>>>>    Harm
>>>
>>> Hi Urs,
>>>
>>> as said before you'll need to go for the 'stencil.
>>> Though, ly:hairpin::print, the default-stencil, is coded in C++. There
>>> the defaults-heights for broken hairpins are set to 1/3 and 2/3 of
>>> 'height.
>>> Thus we need a scheme-rewrite of the stencil-procedure to reset them.
>>> Below I slightly extend a coding by David Nalesnik from
>>> https://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00181.html
>>>
>>> Btw, the rest of the linked thread is very interesting as well:
>>> Once you have a scheme-rewrite it's possible to add a plethora of
>>> other features...
>>>
>>> Back on topic.
>>> Attached you'll find David's coding. My addition is to add a
>>> 'broken-heights-property.
>>> Now you can adjust the values and call the scheme-stencil afterwards,
>>> instead of the default-stencil.
>>
>>
>> This will work for my case - although it's somewhat ridiculous to include
>> such a massive file just to fix one graphic issue.
>> I think this is something that should be user-settable. Maybe a property
>> like yours as a native Hairpin property and/or a setting of the maximum
>> angle hairpin lines may have. The latter would also be a viable setting (as
>> opposed to minimum-length) to prevent those crippled too-short hairpins that
>> are often hard to spot. I think I'll post a feature request.
>>
>> Best
>> Urs
>
>
> Ah, I forgot to ask one thing: 'broken-heights is overridden with two
> values, but I don't see the second one making any difference. What is that
> about?
>
> Urs

For decrescendo the first value determines the height for all but the
last broken hairpin-end.
For decrescendo the second value determines the height for all but the
first broken hairpin-start.

For crescendo the first value determines the height for all but first
broken hairpin-start.
For crescendo the second value determines the height for all but last
broken hairpin-end.

Internally these values are multiplied with the 'height-value.

See:
{
  \override Hairpin.broken-heights = #'(0.2 5)
  \override Hairpin.stencil = #hairpin::print-scheme
  c'1\>
  \break
  c'1 \break
  s2 c'\!
}

{
  \override Hairpin.broken-heights = #'(0.2 5)
  \override Hairpin.stencil = #hairpin::print-scheme
  c'1\<
  \break
  c'1 \break
  s2 c'\!
}

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Shape the angle of a broken hairpin's first part

Urs Liska-3


Am 18.09.2018 um 11:49 schrieb Thomas Morley:

> 2018-09-18 11:13 GMT+02:00 Urs Liska <[hidden email]>:
>>
>> Am 18.09.2018 um 11:09 schrieb Urs Liska:
>>> Hi Harm,
>>>
>>> thank you very much!
>>>
>>>
>>> Am 17.09.2018 um 22:35 schrieb Thomas Morley:
>>>> 2018-09-17 12:05 GMT+02:00 Thomas Morley <[hidden email]>:
>>>>> 2018-09-17 11:55 GMT+02:00 Urs Liska <[hidden email]>:
>>>>>> thanks for this, which gives me a handle to the first part of the
>>>>>> hairpin at
>>>>>> least.
>>>>>>
>>>>>> But my problem is not solved with the 'height property.
>>>>> [...]
>>>>>
>>>>>> See my updated example
>>>>> [...]
>>>>>
>>>>> I'll have a look in the evening, now I have to run for my regular job
>>>>> ...
>>>>>
>>>>> Cheers,
>>>>>     Harm
>>>> Hi Urs,
>>>>
>>>> as said before you'll need to go for the 'stencil.
>>>> Though, ly:hairpin::print, the default-stencil, is coded in C++. There
>>>> the defaults-heights for broken hairpins are set to 1/3 and 2/3 of
>>>> 'height.
>>>> Thus we need a scheme-rewrite of the stencil-procedure to reset them.
>>>> Below I slightly extend a coding by David Nalesnik from
>>>> https://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00181.html
>>>>
>>>> Btw, the rest of the linked thread is very interesting as well:
>>>> Once you have a scheme-rewrite it's possible to add a plethora of
>>>> other features...
>>>>
>>>> Back on topic.
>>>> Attached you'll find David's coding. My addition is to add a
>>>> 'broken-heights-property.
>>>> Now you can adjust the values and call the scheme-stencil afterwards,
>>>> instead of the default-stencil.
>>>
>>> This will work for my case - although it's somewhat ridiculous to include
>>> such a massive file just to fix one graphic issue.
>>> I think this is something that should be user-settable. Maybe a property
>>> like yours as a native Hairpin property and/or a setting of the maximum
>>> angle hairpin lines may have. The latter would also be a viable setting (as
>>> opposed to minimum-length) to prevent those crippled too-short hairpins that
>>> are often hard to spot. I think I'll post a feature request.
>>>
>>> Best
>>> Urs
>>
>> Ah, I forgot to ask one thing: 'broken-heights is overridden with two
>> values, but I don't see the second one making any difference. What is that
>> about?
>>
>> Urs
> For decrescendo the first value determines the height for all but the
> last broken hairpin-end.
> For decrescendo the second value determines the height for all but the
> first broken hairpin-start.
>
> For crescendo the first value determines the height for all but first
> broken hairpin-start.
> For crescendo the second value determines the height for all but last
> broken hairpin-end.
>
> Internally these values are multiplied with the 'height-value.
>
> See:
> {
>    \override Hairpin.broken-heights = #'(0.2 5)
>    \override Hairpin.stencil = #hairpin::print-scheme
>    c'1\>
>    \break
>    c'1 \break
>    s2 c'\!
> }
>
> {
>    \override Hairpin.broken-heights = #'(0.2 5)
>    \override Hairpin.stencil = #hairpin::print-scheme
>    c'1\<
>    \break
>    c'1 \break
>    s2 c'\!
> }
>
> Cheers,
>    Harm

Ah, OK. But that didn't take any effect in the earlier example since
that only applied the override to the first sibling. If I use a
crescendo instead then only the second value takes effect.

Thanks again
Urs

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user