IAA MIDI in Swift
| // in ViewDidLoad in ParentViewController.Swift | |
| // IAA MIDI | |
| var callbackStruct = AudioOutputUnitMIDICallbacks( | |
| userData: nil, | |
| MIDIEventProc: { | |
| (first, status, data1, data2, offset) in | |
| AudioKit.midi.sendMessage([MIDIByte(status), MIDIByte(data1), MIDIByte(data2)])}, | |
| MIDISysExProc: { | |
| (firstPointer, secondPinter, anotherInt32) in | |
| print("Not handling sysex")} | |
| ) | |
| let connectIAAMDI = AudioUnitSetProperty(AudioKit.engine.outputNode.audioUnit!, | |
| kAudioOutputUnitProperty_MIDICallbacks, | |
| kAudioUnitScope_Global, | |
| 0, | |
| &callbackStruct, | |
| UInt32(MemoryLayout<AudioOutputUnitMIDICallbacks>.size)) | |
| if connectIAAMDI != 0 { | |
| AKLog("Something bad happened") | |
| } | |
| // Setup AudioBus MIDI Input | |
| setupAudioBusInput() | |
| startObservingInterAppAudioConnections() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

