Matthew Fecher analogcode
-
AudioKit Pro
- Atlanta, GA
- Sign in to view email
- http://AudioKitPro.com
View gist:fa097afb59ee57ccd29e59dfb2526977
| // ********************************************************** | |
| // 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) |
View gist:3b3dac2699a6e85c5d3fb86fe48e4ccb
| // ********************************************************** | |
| // 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) |
View gist:27b327d3ca71187ddc47715b19a50977
| // 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 |

