If you use the device string "DUMMY", it will still give you a timed thread with callbacks, but will not actually write to any midi device. You might use this if you want, for example, to display notes visually but not play them so a student can follow along with the computer.
Exits the thread. The object is not usable again after calling this.
Injects a midi event to the stream. It will be triggered as soon as possible and will NOT trigger you callback.
If you want to use only injected events as a play stream, you might use arsd.midi.longWait here and just inject things as they come.
Pauses the midi playback. Will send a silence notes controller message to all channels, but otherwise leaves everything in place for a future call to unpause.
Instructs the player to start playing - unsuspend if suspended, unpause if paused. If it is already playing, it will do nothing.
Set this if you want to filter or otherwise respond to events.
Changes the speed of the playback clock to the given multiplier. So passing 2.0 will play at double real time. Calling it again will still play a double real time; the multiplier is always relative to real time and will not stack.
Set this to customize what happens when a stream finishes.
Stops the current playback stream. Will call the callback you set in setCallback.
Stops playback and closes the midi device, but keeps the thread waiting for an unsuspend call.
Pauses the midi playback. Will send a silence notes controller message to all channels, but otherwise leaves everything in place for a future call to unpause.
Stops playback and closes the midi device, but keeps the thread waiting for an unsuspend call.