BasicMIDISocket installs a pair of functions to respond to note-on and -off messages. The functions receive the note number and velocity as arguments.
Channel information is not passed in, on the assumption that you're filtering the messages by device and channel according to the specification given in ddwMIDI_Guide: Identifying MIDI channels. If you need a function to respond to incoming note messages from multiple devices or channels, and the function needs to be aware of the message's source, use MIDIFunc or MIDIdef instead.
Create a new instance. Arguments are:
|note_num, velocity|
.onfunc
.Note that the argument names shown by SCIde's method completion pop-up are different. This is because *new
is inherited from AbstractMIDISocket, which provides a generic argument template.
A BasicMIDISocket instance.
The note-on function.
The note-off function.
This method is called in response to note-on messages. In normal use, you do not need to call this method. You may call it directly for testing or debugging.
note |
The MIDI note number (0-127). |
vel |
Velocity (0-127). |
This method is called in response to note-off messages. In normal use, you do not need to call this method. You may call it directly for testing or debugging.
note |
The MIDI note number (0-127). |
vel |
Velocity (0-127). |
Boolean: true
if the socket's destination exists and is active; false
otherwise.