This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************************** | |
// MARK: - AudioBus Host Icon | |
// ********************************************************** | |
private func startObservingInterAppAudioConnections() { | |
audioUnitPropertyListener = AudioUnitPropertyListener { (audioUnit, property) in | |
self.hostAppIcon.image = AudioOutputUnitGetHostIcon(AudioKit.engine.outputNode.audioUnit!, 44) | |
} | |
AudioKit.engine.outputNode.audioUnit!.add(listener: audioUnitPropertyListener, toProperty: kAudioUnitProperty_IsInterAppConnected) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************************** | |
// MARK: - AudioBus MIDI Input | |
// ********************************************************** | |
extension ParentViewController { | |
func setupAudioBusInput() { | |
midiInput = ABMIDIReceiverPort(name: "FM Player MIDI In", title: "FM Player MIDI In") { (port, midiPacketListPointer) in | |
let events = AKMIDIEvent.midiEventsFrom(packetListPointer: midiPacketListPointer) |