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.
Cleans up any remaining resources used by this object.
Provides a reference to the calling thread.
Starts the thread and invokes the function or delegate passed upon construction.
Waits for this thread to complete. If the thread terminated as the result of an unhandled exception, this exception will be rethrown.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
The minimum scheduling priority that may be set for a thread. On systems where multiple scheduling policies are defined, this value represents the minimum valid priority for the scheduling policy of the process.
The maximum scheduling priority that may be set for a thread. On systems where multiple scheduling policies are defined, this value represents the maximum valid priority for the scheduling policy of the process.
The default scheduling priority that is set for a thread. On systems where multiple scheduling policies are defined, this value represents the default priority for the scheduling policy of the process.
Gets the scheduling priority for the associated thread.
Sets the scheduling priority for the associated thread.
Tests whether this thread is running.
Suspends the calling thread for at least the supplied period. This may result in multiple OS calls if period is greater than the maximum sleep duration supported by the operating system.
Forces a context switch to occur away from the calling thread.