AUv3 in AUv2 host: how to get notified of parameter changes

I'm using the AUv2 API to host AUv3 audio unit extensions on iOS. How can the host be notified if the user changes a parameter?


Looks like kAudioUnitEvent_ParameterValueChange can't be used because there's no AUEventListener on iOS. And AFAICS AUParameterObserver can't be used because the host can't see any AUv3 stuff.

Replies

I hope this bumps the thread, because I'm wondering this too. I would expect them to come in through the render block with a sample-accurate timestamp, but so far that doesn't seem to be the case. I'll probably figure it out, but this could use some better docs IMHO!

Found it! Check out AUParameterObserverToken. It's used kind of like this:


AUParameterObserverToken token;

token = [myAudioUnit.parameterTree tokenByAddingParameterObserver:^(AUParameterAddress address, AUValue value)

{

fprintf(stderr, "Got knob turn \o/ %d = %f\n", (int)address, (float)value);

}

];



It's really easy to get lost in these headers, and to get sidetracked thinking maybe it has something to do more directly with implementorValueObserver or other blocks. At the end of the day, it does make some sense that it would be a property of the tree or parameter object itself. But, It would be helpful if some of the other parameter-related docs steered the user towards this and if the official AUv3 host example implemented it as well.