Tempo syncing and scheduled parameter changes
Tempo syncing and scheduled parameter changes
- Subject: Tempo syncing and scheduled parameter changes
- From: John Allsup <email@hidden>
- Date: Tue, 22 Apr 2008 15:17:47 +0100
Hi,
I'm just getting back into AU programming and decided to see how to
tempo sync events in an effect unit.
My question: What is the preferred way to calculate where the next
beat starts?
I'll explain what I understand so far.
* You get the host beat and tempo at the start of the slice via
AUBase::CallHostBeatAndTempo.
** I presume that the beat value returned is that of the first frame
in the slice.
** I also presume I need to override something to get this called at
the start of a slice. But what method?
* Calculating the frame in the slice where the next beat occurs is easy:
frame = ((ceil(beat) - beat) * 60/ tempo) * sampleRate
and if frame > framesInSlice then the next beat does not occur in the
slice.
** Is this the correct way to go about this?
* Process() just gets called with pointer and a number of frames, and
if it is called a second time (or more) in the slice, the pointer will
not be at the first frame in the slice. So how does it know where in
the slice it is? (i.e. how many frames to offset the frame value
calculated earlier by?)
Thanks,
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden