ExtensionBasicMIDISocket 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). |
Remove the socket completely from the ddwMIDI hierarchy.
The socket's parent MIDIChannel object. From this, you can get information about the device and channel from which the socket is receiving messages.
Move the socket to the parent MIDIChannel's list of enabled sockets. The socket will then respond to incoming messages.
Move the socket to the parent MIDIChannel's list of disabled sockets. The socket will not respond to incoming messages, but it remains intact so that you can reenable it at any time.
Subclasses may implement clear to keep the socket registered in the hierarchy, but become inactive.
Boolean: true if the socket's destination exists and is active; false otherwise.