Skip to content

basic exemple somewhere ? #9

Answered by dnadoba
benoitmercusot asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Benoit,

You can find a working example in the Playground that is in the root folder of this repository. I have just update that playground.
When you open MIDIKit in Xcode, you can just click on the Playground and you should be able to run it.
It will print all currently connected devices and will start listening for the incoming MIDI messages. Make sure your MIDI Device is connected to your Mac before you execute the Playground.

Here is the code of the Playground:

import Foundation
import MIDIKit
import PlaygroundSupport

// Keep playground running
PlaygroundPage.current.needsIndefiniteExecution = true

let client = MIDIClient(name: "MidiTestClient")
try client.start()

// log all curr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@benoitmercusot
Comment options

Answer selected by dnadoba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants