close
The Wayback Machine - https://web.archive.org/web/20200524114453/https://gist.github.com/analogcode
Skip to content

Instantly share code, notes, and snippets.

🎤
Speaking: SXSW 2020, March 19th

Matthew Fecher analogcode

🎤
Speaking: SXSW 2020, March 19th
Block or report user

Report or block analogcode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@analogcode
analogcode / gist:fa097afb59ee57ccd29e59dfb2526977
Last active Apr 17, 2020
Handling AudioBus MIDI Input & State Saving
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
You can’t perform that action at this time.