Skip to content

Instantly share code, notes, and snippets.

@Ivorforce
Created November 16, 2018 14:01
Show Gist options
  • Save Ivorforce/1d4ac1a6b531e3a19517f4116d54e9da to your computer and use it in GitHub Desktop.
Save Ivorforce/1d4ac1a6b531e3a19517f4116d54e9da to your computer and use it in GitHub Desktop.
// source = MIKMIDIDeviceManager.shared.virtualSources[idx]
try MIKMIDIDeviceManager.shared.connectInput(source) { (source, commands) in
var numbers = MIDI.numbers
for case let command as MIKMIDIControlChangeCommand in commands {
numbers[safe: Int(command.controllerNumber)] = Float(command.controllerValue) / 127
}
MIDI.numbers = numbers
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment