User Guide
Ruby Component
When a MIDI object containing sysex arrives at a Ruby component you can look at it using the to_array method. This will give you a Ruby
array containing two entries. The first is the sysex hex data string and the second is the number of hex bytes in that string (as each byte is
two characters this number will of ocurse be half the length of the string).
The above example shows how to look at the data in a system exclusive message. You can see the array with the hex data as the first entry.
Creating MIDI Objects
You can create your own MIDI messages using the MIDI class. This is done differently depending on whether you want a MIDI channel or
system exclusive message.
MIDI Channel Messages
To create a MIDI channel message you need to supply the four properties mentioned above as inputs to the new method.
The example below shows how to create a NOTE ON message for middle C and send it out.
Ideally you'd want to create a note on together with a note off shortly after, so that you get a note of a particular length. To do this you use the
event scheduling capabilities of the Ruby component.
163 of 212