]> git.donarmstrong.com Git - lilypond.git/commit
Improve positioning of tuplet numbers for kneed beams.
authorDavid Nalesnik <david.nalesnik@gmail.com>
Fri, 27 Dec 2013 00:44:52 +0000 (18:44 -0600)
committerDavid Nalesnik <david.nalesnik@gmail.com>
Fri, 14 Feb 2014 13:39:12 +0000 (07:39 -0600)
commitd1514c16429c0ee6337e1e396a0752fa234361b9
tree63365912549da78b491a53d4179f7bc0b668c8ea
parent00e7e96f8393ad1fe86f57cf90f4567142bd4e72
Improve positioning of tuplet numbers for kneed beams.

In the past LilyPond always placed tuplet numbers according to the
position of a bracket, though this bracket may or may not have actually
been drawn.  This system led at times to tuplet numbers which appeared
stranded when there was a kneed beam and no visible bracket.

This patch positions the tuplet number independently of brackets and
close to the beam when the the bracket is not drawn, the beam is kneed, and
there is an appropriate beam segment to place the number against.

The side of the beam on which the number is placed is chosen by principles
derived from Gould.  The number is centered horizontally on the beam.

Collision detection is also introduced.  The number will be offset
horizontally if it is too close to an adjoining note column.  All shifts
preserve the number's vertical distance from the beam.  If the number is
too large to fit in the available horizontal space (between note columns
to either side), we use the old bracket-based positioning system.  In the
event of a collision with an accidental, the tuplet number is moved
vertically, away from the beam.

The older behavior is always available through an override of the property
`knee-to-beam' which is introduced by this patch, and set by default to true.

This patch also adds a header file, `tuplet-number.hh', and provides
a number of regression tests illustrating various features.
input/regression/tuplet-number-french-kneed-beams.ly [new file with mode: 0644]
input/regression/tuplet-number-kneed-beam-even-stem-count.ly [new file with mode: 0644]
input/regression/tuplet-number-kneed-beam-horizontal-fit.ly [new file with mode: 0644]
input/regression/tuplet-number-kneed-beam-ledger-lines.ly [new file with mode: 0644]
input/regression/tuplet-number-shift-along-kneed-beam.ly [new file with mode: 0644]
input/regression/tuplet-numbers-kneed-beams-accidentals.ly [new file with mode: 0644]
input/regression/tuplet-numbers-kneed-beams.ly [new file with mode: 0644]
lily/include/tuplet-number.hh [new file with mode: 0644]
lily/tuplet-number.cc
scm/define-grob-properties.scm
scm/define-grobs.scm