Hi Joseph
Well, I am using CallHostBeatAndTempo() in one of my projects, and I override Render() and make the call from there -- this is a member function, so you should have access to all of your private variables in your AU with no problem. There is also the added advantage that it is called every slice, rather than every frame or sample, so the computational load is trivial, but you still have accuracy within a few ms normally to potential changes in tempo made by the host. I am not sure if this would solve your problems, but maybe :-)
Best ~cb
Hello,
I'm writing an 'aufx' AU subclassed from AUEffectBase. Thus, I am also subclassing AUKernelBase and implementing my own Process() method.
I'm able to get information from the host such as sample rate (by using GetSampleRate(), defined in the AUKernelBase class), but I am unable to get the host's tempo by using CallHostBeatAndTempo(), defined in the AUBase class.
I am calling both of these methods from within my AUKernelBase subclass, inside the Process() method. The actual code being used for CallHostBeatAndTemp() is as follows:
Float64 beat, tempo; OSResult result = mAudioUnit->CallHostBeatAndTempo(&beat, &tempo);
Where mAudioUnit is defined in AUKernelBase as the AUEffectBase object which contains the kernel. Unfortunately, this operation always returns a value of -1, which (according to AUBase.h) indicates that no callback exists in the host application for retrieving this specific information (tempo, etc). As such, the values stored in the variables "beat" and "tempo" ending up being 0.0.
I have tried this AU inside two hosts: AU Lab, and Logic Pro 8. Both situations yield the same result.
Any help on this matter would be greatly appreciated!
--JT http://zhaymusic.com/ http://virheroicus.com/
|