Skip to content

Instantly share code, notes, and snippets.

@siemensikkema
Created June 12, 2015 19:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siemensikkema/eeb99ad0ac9fa7ebf685 to your computer and use it in GitHub Desktop.
Save siemensikkema/eeb99ad0ac9fa7ebf685 to your computer and use it in GitHub Desktop.
import XCPlayground
import CoreMIDI
XCPSetExecutionShouldContinueIndefinitely(true)
func notifyProc(a: UnsafePointer<MIDINotification>, b: UnsafeMutablePointer<Void>) -> Void {
let notification = a[0]
notification.messageID
notification.messageSize
}
var client = MIDIClientRef()
let status = withUnsafeMutablePointer(&client) {
return MIDIClientCreate("SwiftMIDI", notifyProc, nil, $0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment