For what it's worth, I figured out an algorithm for
improving the stem lengths, to accommodate making
adjustments dynamically, according to the guidelines set
forth by Ted Ross. I don't know if anyone cares to do this
right now, but I might as well post it in case someone
eventually wants to.
This assumes that the default Stem #'length for
\clef treble \stemUp c''
will be corrected from #6 to #5, and that the default Stem
#'length for
\clef treble \stemDown b'
will be corrected from #6 to #7.
See the attachment.
- Mark
Stem length algorithm for LilyPond
(following Ted Ross chapter 3 as closely as possible)
* If an upstem stemmed non-flagged non-beamed note is found on
1) the middle staff line, or
2) the space just above the middle staff line, or
3) the space just below the middle staff line,
then:
* look to the left in the current voice on the current staff
(system) until the first of the following is found:
1) a rest
2) any note that:
a) lacks a stem
b) is flagged or beamed
c) is downstem
d) is more than a third away from the note found just
before
e) is below the 2nd staff-line
f) is above the 4th staff-line
g) (what about tremolo beams?)
* if any of the above is found, mark the note found just before
it as the beginning of the "run".
* if the beginning of the voice is reached, mark the first note
of the voice as the beginning of the run.
* if the beginning of the system is reached, mark the first note
of the system as the beginning of the run.
* proceed similarly to find the end of the run on the right
side.
* if the interval between the highest and lowest notes of the
run is a second, and neither note is on the middle line, then
move on (no adjustment is needed in this case).
* each of the five staff degrees (from the 2nd line up to the
4th line) is assigned a minimum and a maximum stem length
(pitches given as in treble clef, units are staff-degrees):
g' min 7, max 7
a' min 6, max 7
b' min 5, max 6
c'' min 5, max 6
d'' min 5, max 5
* for each run, set the stem length of the lowest pitch to its
minimum value and set the stem length of the highest pitch to
its maximum value, and distribute the remaining stem lengths
evenly, even if some of the inner pitches are not used in the
music expression.
For a run of downstem notes, the procedure is similar, but all
the relevant staff degrees are shifted down one. For clarity,
here is the procedure for downstem notes:
* If an downstem stemmed non-flagged non-beamed note is found on
1) the middle staff line, or
2) the space just below the middle staff line, or
3) the line below that
then:
* look to the left in the current voice on the current staff
(system) until the first of the following is found:
1) a rest
2) any note that:
a) lacks a stem
b) is flagged or beamed
c) is downstem
d) is more than a third away from the note found just
before
e) is on or below the 1st (lowest) staff-line
f) is on or above the 4th staff-line
g) (what about tremolo beams?)
* if any of the above is found, mark the note found just before
it as the beginning of the "run".
* if the beginning of the voice is reached, mark the first note
of the voice as the beginning of the run.
* if the beginning of the system is reached, mark the first note
of the system as the beginning of the run.
* proceed similarly to find the end of the run on the right
side.
* if the interval between the highest and lowest notes of the
run is a second, and neither note is on the middle line, then
move on (no adjustment is needed in this case).
* each of the five relevant staff degrees (from the first space
up to the third space) is assigned a minimum and a maximum
stem length (pitches given as in treble clef, units are
staff-degrees):
f' min 5, max 5
g' min 5, max 6
a' min 5, max 6
b' min 6, max 7
c'' min 7, max 7
* for each run, set the stem length of the lowest pitch to its
minimum value and set the stem length of the highest pitch to
its maximum value, and distribute the remaining stem lengths
evenly, even if some of the inner pitches are not used in the
music expression.
_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel