[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gets the beam collision engraver to handle autobeams (issue4287061)
From: |
address@hidden |
Subject: |
Re: Gets the beam collision engraver to handle autobeams (issue4287061) |
Date: |
Wed, 23 Mar 2011 06:30:08 -0400 |
On Mar 22, 2011, at 7:22 PM, address@hidden 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