Re: Slanted Beams thickness

2022-03-25 Thread Carl Sorensen
On Thu, Mar 24, 2022 at 6:46 PM Valentin Petzel  wrote:

> Hello,
>
> Lilypond handles slanted Beams in a geometrically weird way, that is, the
> thickness is not measured as the shortest distance between the opposing
> sides
> of the boundary, but as vertical distance. This results in Beams getting
> optically thinner and closer the higher the slope is. But we can very
> easily
> factor this out by adjusting the thickness to the slope. In fact if we
> want to
> achieve a real thickness theta the adjusted thickness would need to be
> theta·sqrt(1 + slope²). See attached an experimental example.
>

I was looking through the lilypond-devel archives trying to find
discussions that  I thought were held on this subject previously, but I
couldn't find them.

I did, however, find this post that indicates that the beam thickness and
the blot diameter interact when determining the angle of the beam as
defined by its centerline:

https://lists.gnu.org/archive/html/lilypond-devel/2019-06/msg00023.html

I found the attached .png to be quite interesting.

Thanks,

Carl


Re: Slanted Beams thickness

2022-03-25 Thread Carl Sorensen
On Fri, Mar 25, 2022 at 7:47 AM Valentin Petzel  wrote:

> Are you sure about this? It is incredibly hard to cut diagonal lines with
> a
> chisel. As I mentioned half an hour ago this would have hardly any effect
> in
> the common cases anyway.
>

No, I'm not sure about this.  It was my understanding, but my understanding
could be wrong.


>
> And my intent is not to propose a new default, but to initiate some
> discussion. This should not affect common notation practise (unless you
> want to
> reproduce a style with very little distance between the Beam, in which
> case
> reasonable slopes do cause bad results), but might be relevant for some
> more
> modern stuff.
>
>
I think having options is good.  And it may be that there is a difference
between a single beam and multiple beams.  If there is a single beam that's
exceptionally steep, only one end will be on the staff, and we can fudge
the location of the beam (make it a straddle beam).  We don't have to worry
about what happens with adjacent beams.

If we have multiple beams, we have to make the inter-beam spacing work,
which may be a substantial challenge.

I think (especially in the case of multiple beams) there's much more to
properly changing the optical weight of a steep beam than just changing the
beam's thickness.

Thanks,

Carl


Re: Slanted Beams thickness

2022-03-25 Thread Mats Bengtsson
   On 2022-03-25 01:44, Valentin Petzel wrote:

   Subject:
   Slanted Beams thickness
   From:
   Valentin Petzel [1]
   Date:
   2022-03-25 01:44

   To:
   [2]lilypond-devel@gnu.org

Hello,

Lilypond handles slanted Beams in a geometrically weird way, that is, the
thickness is not measured as the shortest distance between the opposing sides
of the boundary, but as vertical distance. This results in Beams getting
optically thinner and closer the higher the slope is. But we can very easily
factor this out by adjusting the thickness to the slope. In fact if we want to
achieve a real thickness theta the adjusted thickness would need to be
theta·sqrt(1 + slope²). See attached an experimental example.

Cheers,
Valentin

   A couple of points, on top of what has already been brought up.

   As has already been said, you will hardly notice any difference unless
   the slope is very high, which is a situation that you anyway try to
   avoid as much as possible, which also makes it hard to find examples in
   typeset scores. After all, that's one of the main reasons to use kneed
   beams.

   My gut feeling is that a mathematically exact solution is not likely to
   provide the most pleasing effect to the eye. There are already a number
   of optical corrections applied in LilyPond to handle other such
   discrepancies between the mathematically most obvious solution and the
   visually most pleasing solution. Something in between the current and
   the newly proposed approach is likely to look best.

   Even though a general guiding approach for Lilypond's layout decisions
   is to imitate old hand engraved scores, we shouldn't necessarily copy
   layout decisions that were caused by technical limitations in the hand
   engraving process, if we have a general agreement that something else
   looks better.

  /Mats

References

   1. mailto:valen...@petzel.at
   2. mailto:lilypond-devel@gnu.org


Re: Slanted Beams thickness

2022-03-25 Thread Valentin Petzel
Are you sure about this? It is incredibly hard to cut diagonal lines with a 
chisel. As I mentioned half an hour ago this would have hardly any effect in 
the common cases anyway.

And my intent is not to propose a new default, but to initiate some 
discussion. This should not affect common notation practise (unless you want to 
reproduce a style with very little distance between the Beam, in which case 
reasonable slopes do cause bad results), but might be relevant for some more 
modern stuff.

Cheers,
Valentin

Am Freitag, 25. März 2022, 13:52:14 CET schrieb Carl Sorensen:
> On Thu, Mar 24, 2022 at 6:46 PM Valentin Petzel  wrote:
> > Hello,
> > 
> > Lilypond handles slanted Beams in a geometrically weird way, that is, the
> > thickness is not measured as the shortest distance between the opposing
> > sides
> > of the boundary, but as vertical distance. This results in Beams getting
> > optically thinner and closer the higher the slope is. But we can very
> > easily
> > factor this out by adjusting the thickness to the slope. In fact if we
> > want to
> > achieve a real thickness theta the adjusted thickness would need to be
> > theta·sqrt(1 + slope²). See attached an experimental example.
> 
> I think LilyPond handles beams not in a geometrically weird way, but in a
> geometrically correct way.
> 
> If I understand correctly, I think that the slanted beams are defined not
> by the perpendicular thickness, but by the vertical "thickness", and that
> this is intentional.
> 
> When the end of a beam sits on a staff, it should take up a fixed
> percentage of the staff space, which we call the beam thickness.  In
> actuality, it is not the perpendicular thickness of the beam (the dimension
> perpendicular to the beam center line) but the vertical thickness (the
> dimension perpendicular to the staff lines.  Of course, this does lead to a
> reduced perpendicular thickness, which might be considered the optical
> thickness.
> 
> This models hand engraving, where chisels of a fixed width were used, and
> the chisels were always held with the ends perpendicular to the staff
> lines, so that the ends of the beams were vertical.
> 
> If we want to have a setting to change that, I'm fine.  But I don't think
> we should change the default, without strong evidence from good
> hand-engraved scores that this is the proper way to do it.
> 
> The same is true of beam spacing.  Beam spacing needs to match the vertical
> staff spacing, not the perpendicular spacing.  Lilypond uses beam quanting
> to make sure that the beams interact properly with the staff lines.
> 
> I note that Dorico offers "optical beaming" for slanted beams, but can't
> find any discussion of it.
> 
> Thanks,
> 
> Carl



signature.asc
Description: This is a digitally signed message part.


Re: Slanted Beams thickness

2022-03-25 Thread Valentin Petzel
Hi Simon,
none of these slopes are extreme enough to really make a difference.

Am Freitag, 25. März 2022, 14:21:12 CET schrieb Simon Albrecht:
> Hi everyone,
> 
> On 25/03/2022 01:44, Valentin Petzel wrote:
> > Hello,
> > 
> > Lilypond handles slanted Beams in a geometrically weird way, that is, the
> > thickness is not measured as the shortest distance between the opposing
> > sides of the boundary, but as vertical distance. This results in Beams
> > getting optically thinner and closer the higher the slope is. But we can
> > very easily factor this out by adjusting the thickness to the slope. In
> > fact if we want to achieve a real thickness theta the adjusted thickness
> > would need to be theta·sqrt(1 + slope²). See attached an experimental
> > example.
> > 
> > Cheers,
> > Valentin
> 
> I think this is a great idea. IMO, the way to think about it should be:
> slanted beams shouldn’t appear any less weighty than horizontal ones.
> It’s not easy to find very obvious examples, but I attach four versions
> of a bar from Grieg in which both beams seem equally thick.
> 
> I agree with others that the distances between multiple beams don’t seem
> good in your mockup. It’s certainly important to preserve the qualities
> of the beam quanting that Lily does, but I don’t know how the
> intricacies of that would play out.
> 
> Best, Simon



signature.asc
Description: This is a digitally signed message part.


Re: Slanted Beams thickness

2022-03-25 Thread Luca Fascione
Carl,
If you look at the video I posted, could you explain how you see using that
instrument non along its tooling direction? (Like, "diagonally" wrt cutting
edge at the tip) seemd to me it would be very hard to get a straight line
doing so...

L

On Fri, 25 Mar 2022, 13:52 Carl Sorensen,  wrote:

> On Thu, Mar 24, 2022 at 6:46 PM Valentin Petzel 
> wrote:
>
> > Hello,
> >
> > Lilypond handles slanted Beams in a geometrically weird way, that is, the
> > thickness is not measured as the shortest distance between the opposing
> > sides
> > of the boundary, but as vertical distance. This results in Beams getting
> > optically thinner and closer the higher the slope is. But we can very
> > easily
> > factor this out by adjusting the thickness to the slope. In fact if we
> > want to
> > achieve a real thickness theta the adjusted thickness would need to be
> > theta·sqrt(1 + slope²). See attached an experimental example.
> >
>
> I think LilyPond handles beams not in a geometrically weird way, but in a
> geometrically correct way.
>
> If I understand correctly, I think that the slanted beams are defined not
> by the perpendicular thickness, but by the vertical "thickness", and that
> this is intentional.
>
> When the end of a beam sits on a staff, it should take up a fixed
> percentage of the staff space, which we call the beam thickness.  In
> actuality, it is not the perpendicular thickness of the beam (the dimension
> perpendicular to the beam center line) but the vertical thickness (the
> dimension perpendicular to the staff lines.  Of course, this does lead to a
> reduced perpendicular thickness, which might be considered the optical
> thickness.
>
> This models hand engraving, where chisels of a fixed width were used, and
> the chisels were always held with the ends perpendicular to the staff
> lines, so that the ends of the beams were vertical.
>
> If we want to have a setting to change that, I'm fine.  But I don't think
> we should change the default, without strong evidence from good
> hand-engraved scores that this is the proper way to do it.
>
> The same is true of beam spacing.  Beam spacing needs to match the vertical
> staff spacing, not the perpendicular spacing.  Lilypond uses beam quanting
> to make sure that the beams interact properly with the staff lines.
>
> I note that Dorico offers "optical beaming" for slanted beams, but can't
> find any discussion of it.
>
> Thanks,
>
> Carl
>


Re: Slanted Beams thickness

2022-03-25 Thread Simon Albrecht

Hi everyone,

On 25/03/2022 01:44, Valentin Petzel wrote:

Hello,

Lilypond handles slanted Beams in a geometrically weird way, that is, the
thickness is not measured as the shortest distance between the opposing sides
of the boundary, but as vertical distance. This results in Beams getting
optically thinner and closer the higher the slope is. But we can very easily
factor this out by adjusting the thickness to the slope. In fact if we want to
achieve a real thickness theta the adjusted thickness would need to be
theta·sqrt(1 + slope²). See attached an experimental example.

Cheers,
Valentin



I think this is a great idea. IMO, the way to think about it should be: 
slanted beams shouldn’t appear any less weighty than horizontal ones. 
It’s not easy to find very obvious examples, but I attach four versions 
of a bar from Grieg in which both beams seem equally thick.


I agree with others that the distances between multiple beams don’t seem 
good in your mockup. It’s certainly important to preserve the qualities 
of the beam quanting that Lily does, but I don’t know how the 
intricacies of that would play out.


Best, Simon


Re: Slanted Beams thickness

2022-03-25 Thread Luca Fascione
... which is what Valentin also just said. Sorry Valentin for the double up!

L

On Fri, 25 Mar 2022, 13:43 Luca Fascione,  wrote:

> Yes but look at the took and how it's held in the hand: you won't ever get
> a clean line from it holding is slanted to the direction of motion, that
> thing is meant to be pushed straight ahead...
>
>
>
> On Fri, 25 Mar 2022, 13:19 Dan Eble,  wrote:
>
>> On Mar 25, 2022, at 04:35, Luca Fascione  wrote:
>> >
>> > This video shows Hans Kuehner at work
>> >
>> > https://www.youtube.com/watch?v=BvyoKdW-Big
>> >
>> > at 4m36 shows beams being engraved, he appears to keep the instrument
>> > orthogonal to the line direction,
>>
>> It's fascinating, but those beams are nearly horizontal and Valentin's
>> concern is about steep beams.
>> —
>> Dan
>>
>>


Re: Slanted Beams thickness

2022-03-25 Thread Carl Sorensen
On Thu, Mar 24, 2022 at 6:46 PM Valentin Petzel  wrote:

> Hello,
>
> Lilypond handles slanted Beams in a geometrically weird way, that is, the
> thickness is not measured as the shortest distance between the opposing
> sides
> of the boundary, but as vertical distance. This results in Beams getting
> optically thinner and closer the higher the slope is. But we can very
> easily
> factor this out by adjusting the thickness to the slope. In fact if we
> want to
> achieve a real thickness theta the adjusted thickness would need to be
> theta·sqrt(1 + slope²). See attached an experimental example.
>

I think LilyPond handles beams not in a geometrically weird way, but in a
geometrically correct way.

If I understand correctly, I think that the slanted beams are defined not
by the perpendicular thickness, but by the vertical "thickness", and that
this is intentional.

When the end of a beam sits on a staff, it should take up a fixed
percentage of the staff space, which we call the beam thickness.  In
actuality, it is not the perpendicular thickness of the beam (the dimension
perpendicular to the beam center line) but the vertical thickness (the
dimension perpendicular to the staff lines.  Of course, this does lead to a
reduced perpendicular thickness, which might be considered the optical
thickness.

This models hand engraving, where chisels of a fixed width were used, and
the chisels were always held with the ends perpendicular to the staff
lines, so that the ends of the beams were vertical.

If we want to have a setting to change that, I'm fine.  But I don't think
we should change the default, without strong evidence from good
hand-engraved scores that this is the proper way to do it.

The same is true of beam spacing.  Beam spacing needs to match the vertical
staff spacing, not the perpendicular spacing.  Lilypond uses beam quanting
to make sure that the beams interact properly with the staff lines.

I note that Dorico offers "optical beaming" for slanted beams, but can't
find any discussion of it.

Thanks,

Carl


Re: Slanted Beams thickness

2022-03-25 Thread Luca Fascione
Yes but look at the took and how it's held in the hand: you won't ever get
a clean line from it holding is slanted to the direction of motion, that
thing is meant to be pushed straight ahead...



On Fri, 25 Mar 2022, 13:19 Dan Eble,  wrote:

> On Mar 25, 2022, at 04:35, Luca Fascione  wrote:
> >
> > This video shows Hans Kuehner at work
> >
> > https://www.youtube.com/watch?v=BvyoKdW-Big
> >
> > at 4m36 shows beams being engraved, he appears to keep the instrument
> > orthogonal to the line direction,
>
> It's fascinating, but those beams are nearly horizontal and Valentin's
> concern is about steep beams.
> —
> Dan
>
>


Re: Slanted Beams thickness

2022-03-25 Thread Valentin Petzel
Hello all,

@Abraham: In fact this is not done at scheme level here, but at C++ level. 
There reason is that we do not want to change the value of the thickness, but 
for Lilypond to think about this thickness in a more natural way. Also this 
example already handles the beam distance. For some reason the slanted beam 
are just slightly thicker than they should be, I’ll still need to look into 
why this is the case.

@Werner: In fact it is a bit too thick on slanted Beams. I just did not yet 
find out the exact reason for why this is, as mathematically they should be the 
same. I do not think it is a problem with calculation of the root, so I 
suppose is in some way related to the way lilypond draws these Beams.

@Jeam: I’ve stumpled upon a post in the Dorico dev blog which also mentions 
this Beam thing, which got me to look into this. One has to remember that in 
the old days Beams would have been cut into the pewter using special chisels. 
But these things cannot really cut diagonally, so you need to keep the chisel 
in line with the Beam, resulting in a constant Beam width regardless of slope. 
So this is something you will find in all old hand engraved scores. Furthermore 
if you look at the examples you must see that the way this is handles just 
look bad with high slopes. I don’t think you’ll find engraving literature 
stating that Beam thickness should apply to the actual thickness of the Beam 
and not the size of the vertical intersection as this does seem to be the more 
reasonable thing, but I think the other points make a strong case for why this 
is a legitimate claim.

Anyway, I do not think this is really intentional behaviour. The current 
approach as a big advantage for aligning Beams to Staff lines (which arguably 
is not that much of an issue for Beams with very high slope), but I guess the 
main reason for this is that it has little effect on the most common slopes 
you’d assume to find. Even with an 50% slope (which would be quite a high slope 
you’d find very seldomly)  we’d need only about 11% more thickness. With a 25% 
slope (which is much more realistic) we’d be at around 3%. So while you’d 
notice a slight difference between these it would be hardly noticeable.

Cheers,
Valentin

signature.asc
Description: This is a digitally signed message part.


Re: Slanted Beams thickness

2022-03-25 Thread Dan Eble
On Mar 25, 2022, at 04:35, Luca Fascione  wrote:
> 
> This video shows Hans Kuehner at work
> 
> https://www.youtube.com/watch?v=BvyoKdW-Big
> 
> at 4m36 shows beams being engraved, he appears to keep the instrument
> orthogonal to the line direction,

It's fascinating, but those beams are nearly horizontal and Valentin's concern 
is about steep beams.
— 
Dan




Re: Slanted Beams thickness

2022-03-25 Thread Luca Fascione
Sorry, forgot to say: instead of correcting with 1/cos(\theta) I wonder if
correcting with 1/cos(\theta/2) would be an idea?

sl2 = sl / (1+sqrt(1+sl*sl)) // tan(\theta/2)
th *= sqrt(1+sl2*sl2)

HTH
L

On Fri, Mar 25, 2022 at 9:35 AM Luca Fascione  wrote:

> This video shows Hans Kuehner at work
>
> https://www.youtube.com/watch?v=BvyoKdW-Big
>
> at 4m36 shows beams being engraved, he appears to keep the instrument
> orthogonal to the line direction,
> which makes Valentin's formula appropriate to capture this process.
>
> (I love it when it goes "What happens when you make mistakes?" -> "I
> _don't_ make mistakes!" (7m59 or so) )
>
> As Werner said, I'd have expected something more of a halfwayhouse,
> because in my mind I was expecting more or a nib
> pen feel to this, but even looking at photography based processes
> there seems to be no evidence that any of that technique
> would influence this.
>
> I feel that for more organic looking fonts (such as lilyjazz) this might
> want to change, but I guess that's a somewhat different
> topic.
>
> L
>
> On Fri, Mar 25, 2022 at 8:10 AM Jean Abou Samra 
> wrote:
>
>> Le 25/03/2022 à 01:44, Valentin Petzel a écrit :
>> > Hello,
>> >
>> > Lilypond handles slanted Beams in a geometrically weird way, that is,
>> the
>> > thickness is not measured as the shortest distance between the opposing
>> sides
>> > of the boundary, but as vertical distance. This results in Beams getting
>> > optically thinner and closer the higher the slope is. But we can very
>> easily
>> > factor this out by adjusting the thickness to the slope. In fact if we
>> want to
>> > achieve a real thickness theta the adjusted thickness would need to be
>> > theta·sqrt(1 + slope²). See attached an experimental example.
>>
>>
>>
>> Did you look into engraving literature to back this up?
>> Given the amount of effort put by Han-Wen & Jan in beam
>> formatting, I have trouble imagining this being just
>> an oversight.
>>
>> Jean
>>
>>
>>


Re: Slanted Beams thickness

2022-03-25 Thread Luca Fascione
This video shows Hans Kuehner at work

https://www.youtube.com/watch?v=BvyoKdW-Big

at 4m36 shows beams being engraved, he appears to keep the instrument
orthogonal to the line direction,
which makes Valentin's formula appropriate to capture this process.

(I love it when it goes "What happens when you make mistakes?" -> "I
_don't_ make mistakes!" (7m59 or so) )

As Werner said, I'd have expected something more of a halfwayhouse, because
in my mind I was expecting more or a nib
pen feel to this, but even looking at photography based processes
there seems to be no evidence that any of that technique
would influence this.

I feel that for more organic looking fonts (such as lilyjazz) this might
want to change, but I guess that's a somewhat different
topic.

L

On Fri, Mar 25, 2022 at 8:10 AM Jean Abou Samra  wrote:

> Le 25/03/2022 à 01:44, Valentin Petzel a écrit :
> > Hello,
> >
> > Lilypond handles slanted Beams in a geometrically weird way, that is, the
> > thickness is not measured as the shortest distance between the opposing
> sides
> > of the boundary, but as vertical distance. This results in Beams getting
> > optically thinner and closer the higher the slope is. But we can very
> easily
> > factor this out by adjusting the thickness to the slope. In fact if we
> want to
> > achieve a real thickness theta the adjusted thickness would need to be
> > theta·sqrt(1 + slope²). See attached an experimental example.
>
>
>
> Did you look into engraving literature to back this up?
> Given the amount of effort put by Han-Wen & Jan in beam
> formatting, I have trouble imagining this being just
> an oversight.
>
> Jean
>
>
>


Re: Slanted Beams thickness

2022-03-25 Thread Jean Abou Samra

Le 25/03/2022 à 01:44, Valentin Petzel a écrit :

Hello,

Lilypond handles slanted Beams in a geometrically weird way, that is, the
thickness is not measured as the shortest distance between the opposing sides
of the boundary, but as vertical distance. This results in Beams getting
optically thinner and closer the higher the slope is. But we can very easily
factor this out by adjusting the thickness to the slope. In fact if we want to
achieve a real thickness theta the adjusted thickness would need to be
theta·sqrt(1 + slope²). See attached an experimental example.




Did you look into engraving literature to back this up?
Given the amount of effort put by Han-Wen & Jan in beam
formatting, I have trouble imagining this being just
an oversight.

Jean




Re: Slanted Beams thickness,Slanted Beams thickness

2022-03-24 Thread Werner LEMBERG


> Lilypond handles slanted Beams in a geometrically weird way, that
> is, the thickness is not measured as the shortest distance between
> the opposing sides of the boundary, but as vertical distance.  This
> results in Beams getting optically thinner and closer the higher the
> slope is.  But we can very easily factor this out by adjusting the
> thickness to the slope.  In fact if we want to achieve a real
> thickness theta the adjusted thickness would need to be
> theta·sqrt(1 + slope²).  See attached an experimental example.

Looks good!  However, I don't fully agree with the thickness values in
your experimental example.  For very steep angles the beam appears a
little bit too thick IMHO; I think there should be a correction
factor.


Werner


Re: Slanted Beams thickness

2022-03-24 Thread Abraham Lee
Hey, Valentin!

On Thu, Mar 24, 2022 at 6:46 PM Valentin Petzel  wrote:

> Hello,
>
> Lilypond handles slanted Beams in a geometrically weird way, that is, the
> thickness is not measured as the shortest distance between the opposing
> sides
> of the boundary, but as vertical distance. This results in Beams getting
> optically thinner and closer the higher the slope is. But we can very
> easily
> factor this out by adjusting the thickness to the slope. In fact if we
> want to
> achieve a real thickness theta the adjusted thickness would need to be
> theta·sqrt(1 + slope²). See attached an experimental example.
>
> Cheers,
> Valentin


I attempted to do this some years ago, but with my limited Scheme
abilities, I dropped it. In addition to the beam thickness correction, it
would probably be prudent to have the beam spacing corrected as well so the
white space between beams stays the same. Maybe? Just a thought.

Best,
Abraham