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

Attachment: transition testing.pdf
Description: Adobe PDF document

From e86f0d30381c1bbe7c04e4b996c1d55497d4cfd9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janek=20Warcho=C5=82?= <lemniskata.bernoulli...@gmail.com>
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?= <lemniskata.bernoulli...@gmail.com>
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

Reply via email to