moving tuplet number nearer to beam

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

moving tuplet number nearer to beam

Werner LEMBERG

Folks,


if I use `\magnifyStaff', the tuplet number is too far away from the
beam.  How can I move it nearer to the beam?  Looking into
`tuplet-number.cc' I see a `padding' property with a default value of
0.5 (and which is apparently completely undocumented).  However, doing
something like

  \override TupletNumber.padding = #4

has zero effect...


    Werner

<<
  \new Staff \with {
    \magnifyStaff #(magstep -5)
  } { \tuplet 3/2 { f'8[ g' a'] } }

  \new Staff {
    \tuplet 3/2 { f'8[ g' a'] } }
>>

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

tuplet-number.png (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: moving tuplet number nearer to beam

SoundsFromSound
On 4/1/2019 4:16 PM, Werner LEMBERG wrote:
Folks,


if I use `\magnifyStaff', the tuplet number is too far away from the
beam.  How can I move it nearer to the beam?  Looking into
`tuplet-number.cc' I see a `padding' property with a default value of
0.5 (and which is apparently completely undocumented).  However, doing
something like

  \override TupletNumber.padding = #4

has zero effect...


    Werner

Hi Werner,

There's a few ways to pad out the tuplet number depending on how you want to approach the padding. Does this help?

<<
  \new Staff \with {
    \magnifyStaff #(magstep -5)
  } {
    % \tweak padding #1
    \override TupletNumber.Y-offset = #2.3
    \tuplet 3/2 { f'8[ g' a'] }
  }

  \new Staff {
    \tuplet 3/2 { f'8[ g' a'] }
  }
>>


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

Re: moving tuplet number nearer to beam

Werner LEMBERG

>> if I use `\magnifyStaff', the tuplet number is too far away from
>> the beam.  How can I move it nearer to the beam?  Looking into
>> `tuplet-number.cc' I see a `padding' property with a default value
>> of 0.5 (and which is apparently completely undocumented).
>
> There's a few ways to pad out the tuplet number depending on how you
> want to approach the padding.  Does this help?
>
> <<
>   \new Staff \with {
>     \magnifyStaff #(magstep -5)
>   } {
>     % \tweak padding #1
>     \override TupletNumber.Y-offset = #2.3

This works, thanks.  However, this is an ad-hoc value for a certain
situation.  I would rather like to really adjust the padding...

What other ways do you suggest?  `\tweak padding' doesn't work for me.


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

Re: moving tuplet number nearer to beam

Aaron Hill
In reply to this post by Werner LEMBERG
On 2019-04-01 1:16 pm, Werner LEMBERG wrote:

> Folks,
>
>
> if I use `\magnifyStaff', the tuplet number is too far away from the
> beam.  How can I move it nearer to the beam?  Looking into
> `tuplet-number.cc' I see a `padding' property with a default value of
> 0.5 (and which is apparently completely undocumented).  However, doing
> something like
>
>   \override TupletNumber.padding = #4
>
> has zero effect...

padding (for TupletNumber) only comes into effect for Y-offset when
considering kneed beams:

%%%%
\version "2.19.82"
{
   \tuplet 5/2 { b8[ b'' b b'' b] }
   \once \override TupletNumber.padding = #1
   \tuplet 5/2 { b8[ b'' b b'' b] }
}
%%%%

Otherwise, the computation is simply the average of the end positions of
the bracket (whether they are visible or not):

%%%%
\version "2.19.82"
{
   \time 3/4
   \tuplet 3/2 { d'4 f' e' }
   \tuplet 3/2 { d'8 f' e' }
   \override TupletBracket.positions = #'(5 . 4)
   \tuplet 3/2 { d'4 f' e' }
   \tuplet 3/2 { d'8 f' e' }
}
%%%%

As such, the solution is to tweak the TupletBracket:

%%%%
\version "2.19.82"
<<
   \new Staff \with {
     \magnifyStaff #(magstep -5)
     \override TupletBracket.padding = #(* 1.1 (magstep -5))
   } { \tuplet 3/2 { f'8[ g' a'] } }
   \new Staff {
     \tuplet 3/2 { f'8[ g' a'] } }
>>
%%%%

Note that 1.1 is the default value for padding, so I have simply reduced
its value proportional to the desired magnification.


-- Aaron Hill

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

Re: moving tuplet number nearer to beam

Werner LEMBERG

> padding (for TupletNumber) only comes into effect for Y-offset when
> considering kneed beams:
>
> %%%%
> \version "2.19.82"
> {
>   \tuplet 5/2 { b8[ b'' b b'' b] }
>   \once \override TupletNumber.padding = #1
>   \tuplet 5/2 { b8[ b'' b b'' b] }
> }
> %%%%
>
> Otherwise, the computation is simply the average of the end
> positions of the bracket (whether they are visible or not):
>
> %%%%
> \version "2.19.82"
> {
>   \time 3/4
>   \tuplet 3/2 { d'4 f' e' }
>   \tuplet 3/2 { d'8 f' e' }
>   \override TupletBracket.positions = #'(5 . 4)
>   \tuplet 3/2 { d'4 f' e' }
>   \tuplet 3/2 { d'8 f' e' }
> }
> %%%%
>
> As such, the solution is to tweak the TupletBracket:
>
> %%%%
> \version "2.19.82"
> <<
>   \new Staff \with {
>     \magnifyStaff #(magstep -5)
>     \override TupletBracket.padding = #(* 1.1 (magstep -5))
>   } { \tuplet 3/2 { f'8[ g' a'] } }
>   \new Staff {
>     \tuplet 3/2 { f'8[ g' a'] } }
>>>
> %%%%
>
> Note that 1.1 is the default value for padding, so I have simply
> reduced its value proportional to the desired magnification.
Thanks a lot for your analysis!  Some observations.

(1) I consider the `padding' property of the `TupletNumber' grob a
    misnomer.  It should be rather something like
    `kneed-beam-padding'.  Additionally, it should be added to the
    `Tuplet_number' interface (and to `define-grob-properties.scm') so
    that it gets documented properly.

(2) The units used for the two padding values are different, see
    attached example.  Is there a reason for it?

I could provide a fix for (1), but I'm rather clueless for (2).


    Werner

\paper {
  line-width = 10\cm
  indent = 0\cm
}

\version "2.19.82"

\markup "TupletNumber.padding vs. TupletBracket.padding"

{
  \omit Staff.TimeSignature
  \time 3/2
  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"0, 0" b b b b] }
  \once \override TupletNumber.padding = #1
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"1, 0" b b b b] }
  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #1
  \tuplet 5/4 { b8[^"0, 1" b b b b] } |

  \break

  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"0, 0" b'' b b'' b] }
  \once \override TupletNumber.padding = #1
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"1, 0" b'' b b'' b] }
  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #1
  \tuplet 5/4 { b8[^"0, 1" b'' b b'' b] } |

  \break

  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"0, 0" b b b b] }
  \once \override TupletNumber.padding = #2
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"2, 0" b b b b] }
  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #2
  \tuplet 5/4 { b8[^"0, 2" b b b b] } |

  \break

  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"0, 0" b'' b b'' b] }
  \once \override TupletNumber.padding = #2
  \once \override TupletBracket.padding = #0
  \tuplet 5/4 { b8[^"2, 0" b'' b b'' b] }
  \once \override TupletNumber.padding = #0
  \once \override TupletBracket.padding = #2
  \tuplet 5/4 { b8[^"0, 2" b'' b b'' b] } |
}

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

tuplet-padding.png (26K) Download Attachment