[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: * Fix arpeggio overshoot for chords which reach centre line.
From: |
n . puttock |
Subject: |
Re: * Fix arpeggio overshoot for chords which reach centre line. |
Date: |
Wed, 01 Oct 2008 14:28:53 -0700 |
On 2008/10/01 00:56:41, hanwenn wrote:
http://codereview.appspot.com/6453/diff/1/3
File lily/arpeggio.cc (right):
http://codereview.appspot.com/6453/diff/1/3#newcode108
Line 108: y += rint (squiggle.extent (Y_AXIS).length ()))
while the original is obviously wrong for the .ly you show, the fix
looks fishy
to me as you would be accumulating roundoff errors. The loop should be
while (mol.extent(Y_AXIS) < heads[RIGHT])
{ add_at_edge }
perhaps to prevent the problem, there could be something like
while (mol.extent(Y_AXIS) + 1.0 < heads[RIGHT])
{ add_at_edge }
(where 1.0 is intelligently chosen.)
That's similar to how I approached it originally, without changing the
loop,
for (Real y = heads[LEFT]; y + EPS < heads[RIGHT];
where EPS = 1e-3.
I decided to use rint () instead since I can't see a situation where it
wouldn't work (obviously apart from the case where somebody changes
Arpeggio #'font-size); isn't the extent of the squiggle glyph
deliberately set to be one staff-space, so it fits between two staff
lines exactly?
The while loop looks more elegant though, of course.
This is possibly a stupid question, but why are the directions for the
drul_array heads[] horizontal?
http://codereview.appspot.com/6453
- Re: * Fix arpeggio overshoot for chords which reach centre line.,
n . puttock <=