I am using the AUv3 template that gets created by XCode to implement a MIDI AUv3 plugin of type "aumi". For the plugin to be able to send MIDI to a host it needs to be able to access the MIDIOutputEventBlock provided by the host. I have done some research and found that this is done by caching the MIDIOutputEventBlock in the allocateRenderResourcesAndReturnError method:
and then using _midiOut in the internalRenderBlock method.
The first thing is that in the template that gets created isn't an allocateRenderResourcesAndReturnError method, there is only an allocateRenderResources method. When I apply that code in this method I get a compile error that basically says that this property is not found in the object of type xxxDSPKernelAdapter. I've seen in other examples (like Gene de Lisa's "Audio Units (AUv3) MIDI extension", a wonderful tutorial, by the way!) that the initial template from a couple years ago was very different from what I have and that MIDIOutputEventBlock is actually defined in the AUAudioUnit.h header file, but in this case self is also a different class.
I am very new at working with Objective-C, C++ and Swift in the same project, so I know my understanding of how this all works is minimal and very shallow. Any insight anybody could provide on this would be greatly appreciated.
Code Block _midiOut = self.MIDIOutputEventBlock;
and then using _midiOut in the internalRenderBlock method.
The first thing is that in the template that gets created isn't an allocateRenderResourcesAndReturnError method, there is only an allocateRenderResources method. When I apply that code in this method I get a compile error that basically says that this property is not found in the object of type xxxDSPKernelAdapter. I've seen in other examples (like Gene de Lisa's "Audio Units (AUv3) MIDI extension", a wonderful tutorial, by the way!) that the initial template from a couple years ago was very different from what I have and that MIDIOutputEventBlock is actually defined in the AUAudioUnit.h header file, but in this case self is also a different class.
I am very new at working with Objective-C, C++ and Swift in the same project, so I know my understanding of how this all works is minimal and very shallow. Any insight anybody could provide on this would be greatly appreciated.