And so every plug in that performs any musical time manipulation is going to need to maintain this queue, respond to regular tick events, and include the code described below. Seems like a lot of extra work that would be required again and again by many plug ins... hmmmm... maybe this functionality could be placed in a central location so the code can be written and debugged once and everybody's plug ins would be a lot smaller... hmm... Todor > -----Original Message----- > From: gmpi-bounce@xxxxxxxxxxxxx [mailto:gmpi-bounce@xxxxxxxxxxxxx] On > Behalf Of Angus F. Hewlett > Sent: Wednesday, April 30, 2003 10:33 AM > To: gmpi@xxxxxxxxxxxxx > Subject: [gmpi] Re: Topic 6: Time representation > > On Wed, 30 Apr 2003 RonKuper@xxxxxxxxxxxx wrote: > > > >>> > > Sure... so you calculate where you think they should be based on your > > current knowledge of the future, and if in the mean time you get tempo > > events, you recalculate your assumptions. > > <<< > > > > This recalculation is very painful to do, and doesn't always work. We > ran > > into this exact problem developing Project5. > > Sorry, can you elaborate? Provided the plug has an accurate knowledge of > tempo (in the form of tempo events), it is always able to calculate the > musical time elapsed from the initial note event to the time when the > secondary event is due. A simple algorithm:- > > for (all elements in queue) > { > calculate (musical time elapsed from now to next tempo change or end of > current buffer, whichever is sooner) > if (musical_time_elapsed > element's remaining delta) > { > calculate absolute time of element, and render it. > } > else > { > subtract musical time elapsed in this calculation from element's > remaining delta > } > } > > Obviously this is not the most efficient possible implementation, but it > really should work. > > > ---------------------------------------------------------------------- > Generalized Music Plugin Interface (GMPI) public discussion list > Participation in this list is contingent upon your abiding by the > following rules: Please stay on topic. You are responsible for your own > words. Please respect your fellow subscribers. Please do not > redistribute anyone else's words without their permission. > > Archive: //www.freelists.org/archives/gmpi > Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe > ---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission. Archive: //www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe