ICube Max Plugin-41 Commands

From I-CubeX Wiki
Jump to: navigation, search

The iCube Max plugin responds to the commands listed below, sent to it using a Max message object.


Icube-400 icube basic max patch.png


Commands can be sent while the digitizer is in host or standalone mode, with sensor data being output in either mode.

The command format has the general form "<outlet> <command> <value>", where <outlet> is a value between 0 and 32, and where <value> can be a float as well as an integer and is not required for all commands. If the outlet value is 0 it signifies the command applies system-wide, and not just for a specific input. All other values specified for <outlet> refer to the iCube outlet with the same number, ie. not the sensor input since the data outlet could have been connected to a sensor input with a different number. Multiple commands can be entered as one message, ie. without commas between each command. The outlet parameter "<outlet>" can be substituted by "<outlet1> - <outlet2>" to specify all outlets from <outlet1> to <outlet2>, 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.


Arguments

iCube takes 4 optional arguments. Arguments are entered after the name "iCube" with spaces between each argument. If no arguments are given, the iCube object will default to 8 outlets (virtual outputs) and the MIDI System Exclusive Device ID will default to 0. The first argument indicates the number of outlets. If the first argument is not in the range [0..32] 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 iCube 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, iCube will assume default digitizer specs (maximum 32 inputs, maximum 12-bit resolution, minimum 0 ms sample interval and System Exclusive Device ID 0) and will try to identify the digitizer upon receipt of the first MIDI byte. See also the version command. If the fourth argument is -1 the iCube object will execute the sync command upon instantiation.


Instantiation

Upon instantiation, the oCube is initialized as follows:

System-wide:

  • interval: 10 for firmwares greater than 5.1 and smaller than 6.0, greater than 6.2 and smaller than 7.0, or greater than 7.1, and 100 for other firmwares
  • mute: 0, ie. off
  • id: 0
  • digid: 0

Input-specific:

  • connect: each outlet is connected to the sensor input with the same number
  • stream: 0, ie. off
  • inmin: 0 (sensor input minimum voltage)
  • inmax: 5 (sensor input maximum voltage)
  • min: 0
  • max: 5
  • res: 1/1024 for all digitizers except the Digitizer, or 1/4096 for Digitizer
  • steps: 1024 for all digitizers except the Digitizer, or 4096 for Digitizer
  • noise: 1/(steps - 1) in host mode, or 0 in standalone mode
  • smooth: 0
  • unit: 5/(steps - 1)
  • offset: 0
  • preset: 1
  • address: 0
  • function: 0, ie. analog sensor with voltage output
  • method: 0