My summer of lily continues with this patch. Currently, the pure height function in stem ...
12 years, 8 months ago
(2011-08-11 11:16:07 UTC)
#1
My summer of lily continues with this patch. Currently, the pure height
function in stem tremolo leads to incorrect results, as without an offset, it
places every stem tremolo at the center of the staff for all pure calculations.
This patch provides a conservative estimate for the tremolo's offset and height
in pure functions (with an exact estimate when beam's are not involved).
If you want to see the pure height approximations in action, use:
\override StemTremolo #'stencil =
#(lambda (grob)
(let ((y-ext (ly:stem-tremolo::pure-height grob 0 0))
(p-y-off (ly:stem-tremolo::pure-calc-y-offset grob 0 0))
(y-off (ly:stem-tremolo::calc-y-offset grob)))
(ly:stencil-add (ly:stem-tremolo::print grob)
(stencil-with-color (ly:stencil-translate-axis (make-line-stencil 0.2 0 (car
y-ext) 0 (cdr y-ext)) (- p-y-off y-off) Y) red))))
Note that overriding the stencil like this wipes out the effect of the pure
functions (as the pure height function is chained to the print function), but it
will show how the estimates are made (try it in
input/regression/stem-tremolo.ly).
Passes regtests.
Cheers,
MS
lgtm http://codereview.appspot.com/4867043/diff/1/lily/beam.cc File lily/beam.cc (right): http://codereview.appspot.com/4867043/diff/1/lily/beam.cc#newcode1797 lily/beam.cc:1797: Beam::middle_stem_estimation (Grob *me, Direction dir) As far as ...
12 years, 8 months ago
(2011-08-27 19:28:51 UTC)
#2
Mike I get a failed patch apply here on the current tre (28 Aug) --snip-- ...
12 years, 8 months ago
(2011-08-28 10:51:15 UTC)
#3
Mike I get a failed patch apply here on the current tre (28 Aug)
--snip--
patching file lily/beam.cc
Hunk #1 succeeded at 1865 (offset 72 lines).
patching file lily/include/beam.hh
Hunk #1 succeeded at 69 with fuzz 2.
patching file lily/include/stem-tremolo.hh
patching file lily/include/stem.hh
Hunk #1 FAILED at 50.
1 out of 1 hunk FAILED -- saving rejects to file lily/include/stem.hh.rej
patching file lily/stem-tremolo.cc
Hunk #4 FAILED at 274.
1 out of 6 hunks FAILED -- saving rejects to file lily/stem-tremolo.cc.rej
patching file lily/stem.cc
Hunk #1 succeeded at 373 with fuzz 1 (offset 74 lines).
Hunk #2 FAILED at 319.
1 out of 2 hunks FAILED -- saving rejects to file lily/stem.cc.rej
patching file scm/define-grobs.scm
Hunk #1 succeeded at 1949 (offset 10 lines).
Hunk #2 succeeded at 2643 with fuzz 2 (offset 19 lines).
--snip--
Also we have a number of tracker issues for temolos and I am wondering if this
covers one or more of these:
http://code.google.com/p/lilypond/issues/detail?id=1444http://code.google.com/p/lilypond/issues/detail?id=376http://code.google.com/p/lilypond/issues/detail?id=704http://code.google.com/p/lilypond/issues/detail?id=1087http://code.google.com/p/lilypond/issues/detail?id=734
or is this for something completely different?
James
On Aug 28, 2011, at 12:51 PM, pkx166h@gmail.com wrote: > Mike I get a failed ...
12 years, 8 months ago
(2011-08-29 14:40:15 UTC)
#4
On Aug 28, 2011, at 12:51 PM, pkx166h@gmail.com wrote:
> Mike I get a failed patch apply here on the current tre (28 Aug)
>
> --snip--
>
You were applying an old patch that conflicted with current master. I rebased
and pushed as 7623fef74bf21fc726a8c60b535e7794f9776700.
> Also we have a number of tracker issues for temolos and I am wondering
> if this covers one or more of these:
>
> http://code.google.com/p/lilypond/issues/detail?id=1444
>
These are chord tremolos (not stem tremolos), so it is a different issue.
> http://code.google.com/p/lilypond/issues/detail?id=376
I don't think this is a bug...it seems like a statement of personal preference,
and should be corroborated by the literature.
>
> http://code.google.com/p/lilypond/issues/detail?id=704
>
idem - chord tremolos.
> http://code.google.com/p/lilypond/issues/detail?id=1087
idem - chord tremolos.
>
> http://code.google.com/p/lilypond/issues/detail?id=734
>
My patch doesn't fix this. However, it facilitates the fixing of this. If
someone wants to take a crack at it, go to Stem_tremolo::y_offset and use:
final_y_offset = minmax (direction_of_stem, final_y_offset - direction_of_stem *
me->extent(me, Y_AXIS)[direction_of_stem],
height_of_staff_symbol[direction_of_stem]);
A similar thing would need to be done for the pure heights.
The above is pseudo-code, but hopefully you get the idea.
Cheers,
MS
Issue 4867043: Uses Y-offset for stem tremolos instead of translated stencil.
(Closed)
Created 12 years, 8 months ago by MikeSol
Modified 8 years, 1 month ago
Reviewers: joeneeman, pkx166h, mikesol_ufl.edu
Base URL:
Comments: 1