(Continuing from earlier email to D Michael McIntyre) I have code for the command I described, FitToBeatsCommand, to fit the beats of an existing composition to a beat track. Ie, "CreateTempoMapFromSegmentCommand" in reverse. I will attach the diffs for the preliminary version I have.
Let me know if there is any trouble applying it.
****** New files & command
* New file FitToBeatsCommand.h
* New file FitToBeatsCommand.cpp
* New command "fit_beats", "Fit existing beats to beat segment".
****** Status
It works. There is more that could be done, including:
* Store ramped tempos - as it is, when the command is undone, all tempos
become flat even if they had been ramped.
* Sanity checking
* Produce ramped tempos instead of flat tempos.
* Store tempos in a vector instead of in a map. I had borrowed the map
treatment from CreateTempoMapFromSegmentCommand but it's overkill for
what I use it for.
****** Code that might belong elsewhere
I have conservatively placed all code into FitToBeatsCommand.h and
FitToBeatsCommand.cpp, other than the minimal glue to make Rosegarden see
the command. However, some of it strikes me as belonging elsewhere.
In particular, beatTimeRatioToTempo completes the "triangle" of relations
between tempoT, timeT, and RealTime. The other two legs,
Composition::realTime2Time, Composition::time2RealTime, live in
Composition but don't actually use its members. I could:
* Leave everything where it is
* Move beatTimeRatioToTempo into Composition, so the triangle is together.
* Move all 3 to some new location
What do you think?
****** Segment's copy ctor
Segment's copy ctor always clones all the original events, which forces me
to make a segment that copies all events and then manually erase all of
them. There's no way to clone a segment empty.
I'd like to give Segment another copy ctor that takes also a boolean flag
to make it not copy events.
What do you think?
****** Code that might be shared - but probably not
There's some potential code-sharing between this and
CreateTempoMapFromSegmentCommand. They have some common members,
functionality, and evaluation startegy. But I'm not sure it's worth
doing.
****** Crediting myself appropriately
Right now, my source just says what the template says "Copyright 2000-2011
the Rosegarden development team. Other copyrights also apply to some
parts of this work. Please see the AUTHORS file and individual file
headers for details. "
So does that mean you add me to the page that AUTHORS points to, or I
credit myself in the individual file headers (but there's no place for
that in the template)? What's the policy on this?
Tom Breton (Tehom)
patch-tehom-20110509
Description: Binary data
------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
