Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3551)

Issue 4287061: Gets the beam collision engraver to handle autobeams (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by MikeSol
Modified:
13 years, 1 month ago
Reviewers:
mike, Neil Puttock
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Gets the beam collision engraver to handle autobeams intermediary

Patch Set 1 : Gets the beam collision engraver to handle autobeams #

Patch Set 2 : Removes auto beams' noteheads from covered grobs list #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -8 lines) Patch
M lily/auto-beam-engraver.cc View 1 9 chunks +12 lines, -1 line 0 comments Download
M lily/beam-collision-engraver.cc View 1 8 chunks +51 lines, -7 lines 0 comments Download
M scm/define-grob-interfaces.scm View 1 chunk +5 lines, -0 lines 0 comments Download
M scm/define-grobs.scm View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 4
MikeSol
This is my attempt to get the beam-collision-engraver to handle auto beams, except...it doesn't work! ...
13 years, 1 month ago (2011-03-19 22:50:41 UTC) #1
MikeSol
This is now fully functional. The only issue is that, for auto-beams, I don't have ...
13 years, 1 month ago (2011-03-20 12:00:34 UTC) #2
Neil Puttock
On 2011/03/20 12:00:34, MikeSol wrote: > This is now fully functional. > The only issue ...
13 years, 1 month ago (2011-03-22 23:22:20 UTC) #3
mike_apollinemike.com
13 years, 1 month ago (2011-03-23 10:30:15 UTC) #4
On Mar 22, 2011, at 7:22 PM, n.puttock@gmail.com wrote:

> On 2011/03/20 12:00:34, MikeSol wrote:
>> This is now fully functional.
>> The only issue is that, for auto-beams, I don't have a good method yet
> for
>> keeping note-heads that are part of the beam out of the covered grobs
> list.
>> This is doable, though - I just have to think of the cleanest way.
> 
> Before you attempt that, can you think of a cleaner way to implement the
> basic functionality which doesn't involve creating a dummy grob?
> 
> Cheers,
> Neil

OK, idea:

In the auto beam engraver, every time a beam is created, a variable called
timestep_ticker_ gets reset to 0 and increments by +1 for every timestep passed
until the beam is completed (or junked if the beam is junked).  This is stashed
as an internal property called "timesteps-spanned."

Then, in the beam collision engraver, there is a vector<vector<Grob *> *> called
covered_grobs_queue_ that stores vectors of all acknowledged grobs (clefs,
note-heads, accidentals, etc.) for a given timestep (with an empty vector being
assigned for a acknowledged-grobless timestep).  This vector is cleared at every
barline (w/ appropriate deletes for the pointers to vectors).  When an autobeam
is completed (which we'll know because it will be announced during the same
timestep as its end-grob), we look at the property timesteps-spanned and iterate
through covered_grobs_queue_ starting from covered_grobs_queue_.size () -
timesteps_spanned to the end, adding its contents to the grob array
covered-grobs.

Does this seem like a good idea?  It'd need some tweaking to deal w/ covered
interior grobs & to avoid code dups, but I think it's clean.

Cheers,
Mike
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b