Re: transition between full-length and shortened stems - please discuss

2011-02-25 Thread Janek Warchoł
2011/2/24 Janek Warchoł :
> See differences in output between original patch (variant 1):
> http://www.sendspace.com/file/d8jk3o
> and new patch: http://www.sendspace.com/file/tgmlfc
> Proof-sheet source code in attachment.

Ooops, i forgot the attachment...
Here it comes.
While waiting for reviews, I'll start preparing the next part of the
"flags affair".

cheers,
Janek


proof sheet.ly
Description: Binary data
___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-24 Thread Janek Warchoł
Hi,

2011/2/22 Janek Warchoł 
>
> I'll cook appropriate function tomorrow.
> Thanks,
> Janek

I'm very sorry for the delay, i had some trouble with git.
I've uploaded new patch for review, it supports custom stem lengths
and staves with custom line count.

See differences in output between original patch (variant 1):
http://www.sendspace.com/file/d8jk3o
and new patch: http://www.sendspace.com/file/tgmlfc
Proof-sheet source code in attachment.

I had to guess what the correct typography in this cases should look
like, so i welcome any comments.

http://codereview.appspot.com/4210051/

cheers,
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-21 Thread Janek Warchoł
2011/2/21 Han-Wen Nienhuys :
> 2011/2/21 Janek Warchoł :
>> 2011/2/21 Han-Wen Nienhuys :
>>> Can you make your code be less hardcoded?  I propose something like:
>>>
>>>  factor = (1+abs(hp[dir])) / (2*staff_radius + 1)
>>>  shorten *= min(factor, 1.0)
>>
>> What staff_radius is? I tried to find an explanation, but to no avail...
>
> Look for Staff_symbol_reference::staff_radius.

Ah. i looked in staff-symbol-referencer.hh, while the answer was in
staff-symbol-referencer.cc :
  return (line_count (me) - 1) / 2.0;
silly me.
I'll cook appropriate function tomorrow.
Thanks,
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-21 Thread Han-Wen Nienhuys
2011/2/21 Janek Warchoł :
> 2011/2/21 Han-Wen Nienhuys :
>> Can you make your code be less hardcoded?  I propose something like:
>>
>>  factor = (1+abs(hp[dir])) / (2*staff_radius + 1)
>>  shorten *= min(factor, 1.0)
>
> What staff_radius is? I tried to find an explanation, but to no avail...

Look for Staff_symbol_reference::staff_radius.

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-21 Thread Janek Warchoł
2011/2/21 Han-Wen Nienhuys :
> Can you make your code be less hardcoded?  I propose something like:
>
>  factor = (1+abs(hp[dir])) / (2*staff_radius + 1)
>  shorten *= min(factor, 1.0)

What staff_radius is? I tried to find an explanation, but to no avail...

> this way, it will work with other types of staves too. If you want to
> be extra fancy, you could do
>
>  factor = pow(factor, shorten_concavity)
>
> for some number != 1 to tune shape of the transition.

I think it's not necassary.
Btw, i think that using a power here wouldn't give good results. If we
really wanted to control the shape of the transition, we would need
some other function (perhaps a little sophisticated one).


2011/2/21 Bernard Hurley :
> It took me a lng time see any difference between the two alternatives.
> Having done so, I think I prefer alternative 1. Either would be in 
> improvement over current behaviour.

:)
I also prefer 1.

thanks,
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-21 Thread Bernard Hurley
On Sun, Feb 20, 2011 at 11:08:05PM -0300, Han-Wen Nienhuys wrote:
> 2011/2/20 Han-Wen Nienhuys :
> 
> > This change is default over current lily, so let's put it in. I can't
> 
> this change is an improvement over current lily
> 

It took me a lng time see any difference between the two alternatives.

Having done so, I think I prefer alternative 1. Either would be in improvement 
over current behaviour.

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-20 Thread Han-Wen Nienhuys
2011/2/20 Han-Wen Nienhuys :

> This change is default over current lily, so let's put it in. I can't

this change is an improvement over current lily

[time to go to bed, I guess]

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-20 Thread Han-Wen Nienhuys
2011/2/13 Janek Warchoł :
> This is the first part of a series of changes to the stems and flags.
> The suggested change is small, but in my opinion important.
> Look at the attached "transition testing.pdf" - it illustrates the problem:
> the 'b' stem is definately too short (it should not end at the same level as
> the stem of the 'a' note), similarly the d stem is too short, and overall
> impression is "uneven" (the ends of the stems do not flow with the melody).
> Actually, the problem was already noticed and mentioned in our Essay:
>
> http://lilypond.org/doc/v2.13/Documentation/essay/automated-engraving#getting-things-right
> reads
>   "LilyPond (...) appears a bit too aggressive in shortening some of the
> stems"
> This is very easily fixed. We only have to discuss what output we want.
> I've prepared two possible solutions.
> Please download this archive: http://www.sendspace.com/file/ckg6md (300KB)
> and compare pdfs inside.
> The archive contains a very simple proof-sheet and two real-life examples,
> both from our essay. I've also included Baerenreiter engravings (also from
> our essay) for reference.
> Which option do you prefer?

This change is default over current lily, so let's put it in. I can't
discern any difference between your two options, and the beam-quanting
is likely to round away any differences.  Either way is fine for me,
but see below.

> First one has the advantage of being very simple, while the second may be
> more smooth to the eye (but the difference isn't really that big).
> I attach appropriate patches (they are really straightforward so i didn't
> upload them for review).

Can you make your code be less hardcoded?  I propose something like:

 factor = (1+abs(hp[dir])) / (2*staff_radius + 1)
 shorten *= min(factor, 1.0)

this way, it will work with other types of staves too. If you want to
be extra fancy, you could do

  factor = pow(factor, shorten_concavity)

for some number != 1 to tune shape of the transition.

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-20 Thread Janek Warchoł
2011/2/20 Graham Percival 
>
> On 2/13/11, Janek Warchoł  wrote:
> >
> > This is the first part of a series of changes to the stems and flags.
> > The suggested change is small, but in my opinion important.
>
> Thanks you for creating such an excellent report on the matter.  You
> took the time to create two alternative solutions, with pdfs to
> illustrate their behaviour, full lilypond source code so that others
> could easily test your patches (and presumably fiddle with the
> constants to experiment if they wished, etc.  I'm very sorry that I
> missed this the first time around -- this was an absolutely
> outstanding preparation for a well-reasoned discussion.

Thank you for such kind words! They are encouraging :)

> As for the specifics... I'm afraid to say that I have no opinion on
> the matter.  It might sound very strange to hear this, but I really
> have no "eye" for typography or engraving.

Thats indeed surprising!

> At first I thought that
> you had mistakenly used the same pdf in both directories -- in fact,
> even when I lined up the BWM 861 pdfs exactly and alt-tab-switched
> between the two, it still took me about 20 seconds to notice the
> differences!

The differencies between the two solutions are indeed hard to spot (in
fact, when working on this i alt-tab-switched and used 200% (or
greater) zoom all the time, and that's on my 24" screen).
However i hope that the difference between current Lily output and any
of the suggested solutions is fairly visible, especially in case of {
\clef G \stemUp d'' } and { \clef G b' }.
I'm totally fine if majorirty says that either solution is good for
them - what is important to me is changing current behaviour to a
better one.

> I see my role in the developer community as a "manager" -- somebody
> who helps the actual workers do their jobs.  I must admit that I have
> failed spectacularly with Janek in the past week, and I shall write
> more about that later tonight... but I've got it in the system now,
> and I will make a fuss in 24 hours if nobody starts discussing this.
>
> Janek - you have my full confidence on this matter, and FWIW, I would
> be happy pushing whichever patch you personally think is better.
> (hopefully this will prompt other people to complain, and therefore
> discuss the options)

ok, let's wait.

cheers,
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-20 Thread Graham Percival
On 2/13/11, Janek Warchoł  wrote:
>
> This is the first part of a series of changes to the stems and flags.
> The suggested change is small, but in my opinion important.

Thanks you for creating such an excellent report on the matter.  You
took the time to create two alternative solutions, with pdfs to
illustrate their behaviour, full lilypond source code so that others
could easily test your patches (and presumably fiddle with the
constants to experiment if they wished, etc.  I'm very sorry that I
missed this the first time around -- this was an absolutely
outstanding preparation for a well-reasoned discussion.

I would encourage everybody to look at Janek's first email in detail,
if you haven't already -- this really was well-done.  The only
possible critique might be the lack of a Reitveld issue, but given the
simplicity of the two alternate patches (and the sheer fact that there
*are* two alternate patches), I don't think that a Reitveld issue
would really help.

If you missed it, here's his original email:
http://lists.gnu.org/archive/html/lilypond-devel/2011-02/msg00391.html


As for the specifics... I'm afraid to say that I have no opinion on
the matter.  It might sound very strange to hear this, but I really
have no "eye" for typography or engraving.  At first I thought that
you had mistakenly used the same pdf in both directories -- in fact,
even when I lined up the BWM 861 pdfs exactly and alt-tab-switched
between the two, it still took me about 20 seconds to notice the
differences!

I see my role in the developer community as a "manager" -- somebody
who helps the actual workers do their jobs.  I must admit that I have
failed spectacularly with Janek in the past week, and I shall write
more about that later tonight... but I've got it in the system now,
and I will make a fuss in 24 hours if nobody starts discussing this.

Janek - you have my full confidence on this matter, and FWIW, I would
be happy pushing whichever patch you personally think is better.
(hopefully this will prompt other people to complain, and therefore
discuss the options)

Cheers,
- Graham

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: transition between full-length and shortened stems - please discuss

2011-02-13 Thread Werner LEMBERG
> First one has the advantage of being very simple, while the second
> may be more smooth to the eye (but the difference isn't really that
> big).

I prefer the first solution but I don't cast my mind in stone :-)


Werner

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


transition between full-length and shortened stems - please discuss

2011-02-13 Thread Janek Warchoł
Hi,

This is the first part of a series of changes to the stems and flags.
The suggested change is small, but in my opinion important.
Look at the attached "transition testing.pdf" - it illustrates the problem:
the 'b' stem is definately too short (it should not end at the same level as
the stem of the 'a' note), similarly the d stem is too short, and overall
impression is "uneven" (the ends of the stems do not flow with the melody).
Actually, the problem was already noticed and mentioned in our Essay:

http://lilypond.org/doc/v2.13/Documentation/essay/automated-engraving#getting-things-right
reads
  "LilyPond (...) appears a bit too aggressive in shortening some of the
stems"
This is very easily fixed. We only have to discuss what output we want.
I've prepared two possible solutions.
Please download this archive: http://www.sendspace.com/file/ckg6md (300KB)
and compare pdfs inside.
The archive contains a very simple proof-sheet and two real-life examples,
both from our essay. I've also included Baerenreiter engravings (also from
our essay) for reference.
Which option do you prefer?
First one has the advantage of being very simple, while the second may be
more smooth to the eye (but the difference isn't really that big).
I attach appropriate patches (they are really straightforward so i didn't
upload them for review).

cheers,
Janek


transition testing.pdf
Description: Adobe PDF document
From e86f0d30381c1bbe7c04e4b996c1d55497d4cfd9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janek=20Warcho=C5=82?= 
Date: Sun, 13 Feb 2011 22:32:40 +0100
Subject: [PATCH] improving the transition between full-length and shortened stems.

Now the change in length between regular stems (3.5 ss) and shortened stems (2.5 ss) is executed more gradually.
---
 lily/stem.cc |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lily/stem.cc b/lily/stem.cc
index 11cf6de..8785112 100644
--- a/lily/stem.cc
+++ b/lily/stem.cc
@@ -346,11 +346,11 @@ Stem::calc_length (SCM smob)
   SCM sshorten = ly_assoc_get (ly_symbol2scm ("stem-shorten"), details, SCM_EOL);
   SCM scm_shorten = scm_is_pair (sshorten)
 	? robust_list_ref (max (duration_log (me) - 2, 0), sshorten) : SCM_EOL;
-  Real shorten = 2* robust_scm2double (scm_shorten, 0);
-
-  /* On boundary: shorten only half */
-  if (abs (head_positions (me)[dir]) <= 1)
-	shorten *= 0.5;
+  Real shorten = 2 * robust_scm2double (scm_shorten, 0);
+  /* make a smooth transition between shortened stems and normal ones: */
+  Real shortening_steps[] = {0.166, 0.333, 0.5, 0.666, 0.833};
+  if (abs (head_positions (me)[dir]) < 5)
+shorten *= shortening_steps[(int) abs (head_positions (me)[dir])];
 
   length -= shorten;
 }
-- 
1.7.0.4

From 041226739c651945573431bcdba23176a8decea5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janek=20Warcho=C5=82?= 
Date: Sun, 13 Feb 2011 22:39:36 +0100
Subject: [PATCH] Second variation of improving transition between full-length and shortened stems.

This transition between full length (3.5 ss) and shortened (2.5) stems in more elongated, and the changes in stem lengths are not linear.
---
 lily/stem.cc |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lily/stem.cc b/lily/stem.cc
index 11cf6de..af76a2a 100644
--- a/lily/stem.cc
+++ b/lily/stem.cc
@@ -346,11 +346,11 @@ Stem::calc_length (SCM smob)
   SCM sshorten = ly_assoc_get (ly_symbol2scm ("stem-shorten"), details, SCM_EOL);
   SCM scm_shorten = scm_is_pair (sshorten)
 	? robust_list_ref (max (duration_log (me) - 2, 0), sshorten) : SCM_EOL;
-  Real shorten = 2* robust_scm2double (scm_shorten, 0);
-
-  /* On boundary: shorten only half */
-  if (abs (head_positions (me)[dir]) <= 1)
-	shorten *= 0.5;
+  Real shorten = 2 * robust_scm2double (scm_shorten, 0);
+  /* make a smooth transition between shortened stems and normal ones: */
+  Real shortening_steps[] = {0.2, 0.4, 0.6, 0.8, 0.88, 0.96};
+  if (abs (head_positions (me)[dir]) < 5)
+shorten *= shortening_steps[(int) abs (head_positions (me)[dir])];
 
   length -= shorten;
 }
-- 
1.7.0.4

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel