Hello Rua,

I looked into your code and come over this line:

         QTTime durationqt     = QTMakeTimeWithTimeInterval(timeStep);

The QTTime is a struct of two integers, which proberly don't reflect your 
"timeStep" when calculating the fritction timeValue/timeScale. The function 
QTMakeTimeWithTimeInterval() just picks a timeBase, unfortunately a "wrong" one.

Check it with the debugger what exactly the values for timeValue and timeBase 
are. You may want to set them programmatically or even go the way back:

timeStep = durationqt.timeValue / durationqt.timeScale;

Another (more accurate) solution would be using the movie duration for the 
render time:

QTTime currentMovieDuration = [mMovie duration];
[renderer renderAtTime: currentMovieDuration.timeValue / 
currentMovieDuration.timeScale arguments:nil];

(You may have to take your intro duration into account for the rendring time as 
well, I didn't looked at this part of your code)

best,

Achim Breidenbach
Boinx Software


On 02.10.2010, at 01:02, Rua Haszard Morris wrote:

> Aha - Indeed this is very accurate! (Nice animation by the way)
> 
> I tried this on one of my tunes using playback in quartz composer, and it 
> stuck nicely to the kick.
> 
> However it drifted when I used my rendering app (qtzrendang.googlecode.com), 
> so it's likely a timing bug in that or some other interaction.
> 
> What do you use to render your compositions & attach the audio?
> 
> thanks for the help
> H
>  
> --
> http://cartoonbeats.com
> http://haszaristwocents.blogspot.com
> http://myspace.com/haszari
> http://last.fm/music/Haszari
> 
> 
> From: George Toledo <[email protected]>
> To: Rua Haszard Morris <[email protected]>
> Cc: [email protected]
> Sent: Sat, 2 October, 2010 10:40:41 AM
> Subject: Re: bpm-accurate LFO for quartz composer?
> 
> Err, sorry for the string of responses, it's just that I re-read your note 
> about every second beat. If you take the instance where I have a half note 
> beat, and offset phase by 180, then you will have it hit on the 2 and the 4 
> (eg., typical snare hit), instead of the 1 and 3. Using phase will control 
> your offsets, and "groove" (eg., slightly ahead or behind beat).
> 
> Also, I've capped the whole note at sequences of 4, but you could leave it 
> unranged, so that it becomes a measure count. If you change a chain to 
> generate 8th notes or 16th notes (or 3/4 time), you can adjust the associated 
> range patches accordingly, so that they actually keep track of that count. 
> Just throwing out some related thoughts that will hopefully help you in your 
> quest for tight synchronization.
> 
> -GT
> 
> On Fri, Oct 1, 2010 at 5:32 PM, George Toledo <[email protected]> wrote:
> BTW, please let me know if you do experience any drift in using this, as 
> there isn't any reason that I'm aware of that would cause it with this. I've 
> run it for a couple hours alongside a drum machine and had it keep lock.
> 
> -GT
> 
> 
> On Fri, Oct 1, 2010 at 5:26 PM, George Toledo <[email protected]> wrote:
> As a matter of fact, I made something not that long ago for just this 
> scenario.
> 
> I am attaching the "beat engine" that I used to synchronize this: 
> http://vimeo.com/15191953
> 
> I'm using "square waves" so that a hard tick is generated on the counter, but 
> you can change wave types to generate the other kinds of envelopes that 
> should be familiar from synthesis via the LFO.
> 
> 
> 
> 
> On Fri, Oct 1, 2010 at 4:50 PM, Rua Haszard Morris <[email protected]> wrote:
> Hi list,
> 
> I've been trying to animate in time with music by using LFOs running at bpm
> related rates. The bpms tend to be 128/130ish so are not nicely related to 
> frame
> rates (e.g. 120bpm would be!).
> 
> I can't seem to get accurate sync between my audio (which is at a known tempo)
> and the LFOs - the LFOs seem to drift. I think this is the accumulation of
> rounding error over the course of the animation.
> 
> I wrote a BPM-LFO plugin so as to avoid rounding issues, supplying tempo in 
> BPM
> instead of period, and this LFO seems to drift just as much.
> 
> Has anyone used LFOs for roughly bpm-accurate synched animation over the 
> course
> of about 5 minutes? If anyone's succeeded I'd love to know how to do it!
> 
> BTW my needs are reasonably modest - things like an image that flashes every
> second beat over the course of a whole song - e.g. 64 times a minute, or a
> billboard that slides into view every 16 bars (64 beats) - but the LFOs need 
> to
> ensure these elements stay in phase with the audio beat.
> 
> thanks
> Rua HM.
>  --
> http://cartoonbeats.com
> http://haszaristwocents.blogspot.com
> http://myspace.com/haszari
> http://last.fm/music/Haszari
> 
> 
> 
> 
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/gtoledo3%40gmail.com
> 
> This email sent to [email protected]
> 
> 
> 
> -- 
> George Toledo
> [email protected]
> www.georgetoledo.com
> 
> The information contained in this E-mail and any attachments may be 
> confidential.
> If you have received this E-mail in error, please notify us immediately by 
> telephone or return E-mail.
> You should not use or disclose the contents of this E-mail or any of the 
> attachments for any purpose or to any persons.
> 
> 
> 
> 
> -- 
> George Toledo
> [email protected]
> www.georgetoledo.com
> 
> The information contained in this E-mail and any attachments may be 
> confidential.
> If you have received this E-mail in error, please notify us immediately by 
> telephone or return E-mail.
> You should not use or disclose the contents of this E-mail or any of the 
> attachments for any purpose or to any persons.
> 
> 
> 
> 
> -- 
> George Toledo
> [email protected]
> www.georgetoledo.com
> 
> The information contained in this E-mail and any attachments may be 
> confidential.
> If you have received this E-mail in error, please notify us immediately by 
> telephone or return E-mail.
> You should not use or disclose the contents of this E-mail or any of the 
> attachments for any purpose or to any persons.
> 
> 
>   _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to