Hi Artemiy, sorry for the delay. This should do it.
1. Get the tempo
Float64 bpm; OSStatus err = mAudioUnit->CallHostBeatAndTempo(NULL, &bpm);
2. Set the parameter if tempo has changed and notify the listeners
if (err == noErr && bpm != mBpm) { mBpm = bpm; Globals()->SetParameter(YourParameterId, YourValue);
AudioUnitParameter param;
param.mAudioUnit = GetComponentInstance(); param.mScope = kAudioUnitScope_Global; param.mParameterID = YourParameterId;
AUParameterListenerNotify(NULL, NULL, ¶m); }
|