I am in the process of changing my AU code from Carbon to Cocoa, and for various reasons that caused some AU automation code to have to be changed.
I am however unable to get automation working properly. Specifically, when a parameter is changed, the host (i.e. Logic) does not seem to receive the information.
I am trying to use the information in technical note TN2104, but to no avail.
AudioUnitEvent myEvent;
myEvent.mArgument.mParameter.mAudioUnit = mComponentInstance;
myEvent.mArgument.mParameter.mParameterID = iParameterIndex;
myEvent.mArgument.mParameter.mScope = kAudioUnitScope_Global;
myEvent.mArgument.mParameter.mElement = 0;
myEvent.mEventType = kAudioUnitEvent_BeginParameterChangeGesture;
AUEventListenerNotify(NULL, NULL, &myEvent);
myEvent.mEventType = kAudioUnitEvent_ParameterValueChange;
AUEventListenerNotify(NULL, NULL, &myEvent);
myEvent.mEventType = kAudioUnitEvent_EndParameterChangeGesture;
AUEventListenerNotify(NULL, NULL, &myEvent);
but that did not work neither.
This is pretty much the same code as my carbon code, except I am calling this from the audio unit, rather than from the view.
This should not be a problem though, since this is what the tech note says:
"Parameter change notifications can be sent by an Audio Unit or host using AUEventListenerNotify"
Needles to say, my carbon code worked fine.
I did want to try using the cocoa view component instance, but was unable to figure out how to get the component instance parameter. (AU Cocoa views are, admittedly, insanely confusing to me).
Can anyone see what is the problem with this code? As far as I can read from the tech note, this is all which is needed to send the events.
Thanks,
Michael Olsen
PhonoXone