OCube Max Plugin-83 Commands

From I-CubeX Wiki
Jump to: navigation, search

The oCube Max plugin responds to commands sent to it using a Max message object or as a (int or float) number.


Ocube-400 ocube basic max patch.png


Commands can be sent while the digitizer is in host or standalone mode, with the control of actuators available in either mode.

Commands sent as a number message can be an int or a float. When repeating pulse (RP) output is off, 1 (or rather any value greater than zero, in fact) or 0 turns the actuator on or off. Any number greater than 1 sets the duration of a single (ie. not repeating) pulse. When RP output is enabled for the actuator output that's connected to the control inlet and configured for a digital binary actuator, any number (0..127) sets the pulse width. If it's configured for an I2C actuator it sets the method to be executed.

The command format, when sent as a Max list message, has the general form "<inlet> <command> <value>", where <inlet> is a value between 0 and 8, and where <value> can be a float as well as an integer and is not required for all commands. If the inlet value is 0 it signifies the command applies system-wide, and not just for a specific output. All other values specified for <inlet> refer to the oCube inlet with the same number, ie. not the actuator output since the control inlet could have been connected to an actuator output with a different number. Multiple commands can be entered as one message, ie. without commas between each command. The inlet parameter "<inlet>" can be substituted by "<inlet1> - <inlet2>" to specify all inlets from <inlet1> to <inlet2>, which range can be ascending or descending.

If a command has aliases they are listed following the command, in brackets and separated by commas.

Commands that in turn send commands as System Exclusive MIDI messages to the digitizer refer to the firmware command in capitals. More information about the command can be found in the applicable firmware section on this support wiki.

For each command (sent or received) messages are output via the message outlet that provides confirmation or reports an error. These messages can be used for eg. debugging or the sequential timing of communication with the digitizer.

Commands may or may not be valid, according to the digitizer's firmware. An error message will be output if the command is not valid for the firmware of the connected digitizer.

For the messages sent to the digitizer by the various oCube commands, see the firmware documentation.


Arguments

oCube takes 4 optional arguments. Arguments are entered after the name "oCube" with spaces between each argument. If no arguments are given, the oCube object will default to 8 inlets (virtual inputs) and the MIDI System Exclusive Device ID will default to 0. The first argument indicates the number of control inlet / status outlet pairs. If the first argument is not in the range [0..8] an error message will be shown in the Max window as well as output via the message outlet. The second argument indicates the MIDI System Exclusive Device ID (which must match the System Exclusive Device ID of a connected digitizer in order to work). If only one argument is provided or if the second argument is less than zero, the System Exclusive Device ID defaults to 0 and an error message will be shown in the Max window as well as output via the message outlet. The third argument (a string with at most 99 characters) can be used to identify messages from the oCube object instance in the Max window. It can be left empty by typing " " (a space with two double quotes). The fourth argument specifies the digitizer firmware (where eg. firmware v7.5 is entered as "75"). If no firmware is specified, oCube will assume default digitizer specs (maximum 8 outputs and System Exclusive Device ID 0) and will try to identify the digitizer upon receipt of the first MIDI byte. See also the oCube version command. If the fourth argument is -1 the oCube object will execute the sync command upon instantiation.


Instantiation

Upon instantiation, the oCube is initialized as follows:

System-wide:

  • rpmode: 1 (repeating pulses as used for control of RC servos)
  • rpinterval: 20 ms
  • rpwidth: 1-2 ms

Output-specific:

  • connect: connect each outlet to the sensor input with the same number
  • address: 0
  • function: 0, ie. a digital actuator that is binary (ie. two-state) and controlled by voltage level (0 or 5V) or that is controlled by repeating pulse width modulation (PWM)
  • method: 0
  • control type: threshold
  • status: 0 (off)
  • status duration: infinite
  • initial configuration:
    • control type: threshold
    • status: 0 (off)
    • status duration: infinite