Difference between revisions of "OCube Max Plugin-40 Commands"

From I-CubeX Wiki
Jump to: navigation, search
(Created page with "The oCube Max plugin responds to the commands listed below, sent to it using a Max message object. File:ocube-400_ocube_basic_max_patch.png Commands can be sent whil...")
 
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
The oCube Max plugin responds to the commands listed below, sent to it using a Max message object.  
+
The oCube Max plugin responds to commands sent to it using a Max message object or as a (int or float) number.
  
  
Line 5: Line 5:
 
   
 
   
  
Commands can be sent while the digitizer is in host or standalone mode, with sensor data being output in either mode.
+
Commands can be sent while the digitizer is in host or standalone mode, with the control of actuators available in either mode.
  
The command format 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 only for a specific output. All other values specified for <inlet> refer to the oCube inlet with the same 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.
+
Commands sent as a number message can be an int or a flost. 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, any number (0..127) sets the pulse width.
 +
 
 +
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.  
 
If a command has aliases they are listed following the command, in brackets and separated by commas.  
Line 15: Line 17:
 
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.  
 
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.
  
  
 
<b>Arguments</b>
 
<b>Arguments</b>
  
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 inlets. 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 <u>version</u> command. If the fourth argument is -1 the oCube object will execute the sync command upon instantiation.
+
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 <u>version</u> command. If the fourth argument is -1 the oCube object will execute the sync command upon instantiation.
 
 
 
 
 
 
<b>System-wide commands</b>
 
  
  
<u>version</u> (0 version)
+
<b>Instantiation</b>
  
Reports the oCube version and, if available, digitizer version in the Max window.
+
Upon instantiation, the oCube is initialized as follows:
 
 
 
 
<u>reset</u> (0 reset)
 
 
 
Initializes the oCube data structure as per the <u>init</u> command if the digitizer is in host mode, and sends a RESET command to the digitizer. If the connected digitizer is reset by other software, oCube will re-upload its configuration to the digitizer.
 
 
 
 
 
<u>init</u> (0 init)
 
 
 
Initializes the oCube data structure to the default settings as specified below.
 
  
 
System-wide:
 
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
+
*rpmode: 0 (general purpose repeating pulses, not servo-specific)
*mute: 0, ie. off
+
*rpinterval: 5 ms
*id: 0
+
*rpwidthmax: 1 ms
*digid: 0
 
  
 
Output-specific:
 
Output-specific:
Line 51: Line 39:
 
*connect: connect each outlet to the sensor input with the same number
 
*connect: connect each outlet to the sensor input with the same number
 
*address: 0
 
*address: 0
*function: 0, ie. binary (two-state) actuator with voltage input
+
*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
 
*method: 0
 
+
*level: 0 (off)
 
+
*levelinit: 0 (off)
<u>sync</u> (0 sync)
+
*rp: 0 (off)
 
+
*rpinit: 0 (off)
Retrieves all the configuration information from the digitizer and stores it in the oCube data structure. Use the report command to display the information. If multiple oCube objects are connected to the same digitizer, only one object needs to be sent the sync command to sync all objects to the digitizer.
+
*rpwidth: 0 ms
 
+
*rpwidthinit: 0 ms
 
 
<u>digid <value></u> (setdigid <value>, 0 digid <value>)
 
 
 
Sends a SET ID command to the digitizer to set the digitizer's System Exclusive ID to the specified value [0..126]. This command is only useful when connected with digitizers that are serially connected via MIDI cables using the digitizer's MIDI thru function, allowing each digitizer to be identified via the MIDI ports.
 
 
 
 
 
<u>id <value></u> (0 id <value>)
 
 
 
Sets the oCube to respond to and send System Exclusive messages with the System Exclusive ID equal to the specified value [0..126]. This command is only useful when connected with digitizers that are serially connected via MIDI cables using the digitizer's MIDI thru function, allowing each digitizer to be identified via the MIDI ports.
 
 
 
 
 
<u>host</u> (0 host, 0 hostmode)
 
 
 
Sends a SET MODE command to the digitizer to set it to host mode.
 
 
 
 
 
<u>standalone</u> (0 standalone, 0 standalonemode)
 
 
 
Sends a SET MODE command to the digitizer to set it to standalone mode.
 
 
 
 
 
<u>mode <value></u> (0 mode <value>)
 
 
 
Sends a SET MODE command to the digitizer to set to its mode to the specified value [0..1] (0 is host mode, 1 is standalone mode).
 
 
 
 
 
<u>pulse_interval <value></u> (0 pulse_interval <value>)
 
 
 
Sends an SET OUTPUT PULSE command to the digitizer to set its pulse interval to the specified value [1..16383] in milliseconds. 
 
 
 
 
 
<u>pulse_width_max <value></u> (0 pulse_width_max <value>)
 
 
 
Sends an SET OUTPUT PULSE command to the digitizer to set the maximum pulse width to the specified value [1 ..127] in milliseconds.
 
 
 
 
 
<u>mute <value></u> (0 mute <value>)
 
 
 
Sends a SET MUTE command to the digitizer to set its mute status to the specified value [0..1] (0 is off, 1 is on). 
 
 
 
 
 
<u>report</u> (0 report, print, 0 print)
 
 
 
Reports all the available data stored in the oCube data structure in the Max window.
 
 
 
 
 
<u>verbose <value></u> (0 verbose)
 
 
 
Sets what kind of messages are printed in the Max window, according to the specified value [0..3]:
 
 
 
* 0: no messages
 
* 1: confirmation messages
 
* 2: confirmation and error messages
 
* 3: all messages
 
 
 
 
 
<u>help</u> (0 help)
 
 
 
Display the URL of the main page about oCube on this support wiki in the Max window.
 
 
 
 
 
<u>thru <value></u> (0 thru <value>)
 
 
 
Sends a THRU command to the digitizer, if it is a microDig, miniDig or Digitizer, to set the MIDI thru status to the specified value [0..1] (0 is off, 1 is on).
 
 
 
 
 
<u>midiout <value></u> (0 midiout <value>)
 
 
 
Sends a MIDIOUT command to the digitizer, if it is a USB-microDig, to set the MIDI out port status to the specified value [0..1] (0 is off, 1 is on). This command enables the USB-microDig to be used with a USB-microMIDICable.
 
 
 
 
 
 
 
<b>Output-specific commands</b>
 
 
 
Output-specific commands apply only to the specified inlet and the actuator output it is connected to, if any. Inlets and outputs are numbered starting with 1. 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.
 
 
 
 
 
<u><inlet> reset</u>
 
 
 
Initializes the oCube data structure for the specified inlet to the default values.
 
 
 
 
 
<u><inlet> init</u>
 
 
 
Initializes the oCube data structure for the specified inlet to the default values.
 
 
 
 
 
<u><inlet> connect <output></u> (<inlet> assign <output>)
 
 
 
Connects the specified inlet to specified digitizer actuator output. Just like 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, the output parameter "<output>" can be substituted by "<output1> - <output2>" to specify a range of outputs, which can also be ascending or descending. Example: "1 - 4 connect 4 - 1" connects inlets 1 thru 4 to outputs 4 thru 1, ie. inlet 1 is connected to output 4 etc.
 
 
 
 
 
<u><inlet> out <value></u>
 
 
 
Sends a SET OUTPUT command to the digitizer to set the actuator output connected to the specified inlet to the state corresponding to the specified value [0..1] (0 is off or 0 V, 1 is on or 5 V).
 
 
 
 
 
<u><inlet> on</u>
 
 
 
Sends a SET OUTPUT command to the digitizer to enable the actuator output connected to the specified inlet, where enabling means the actuator state corresponding to "1", ie. when applying 5 V to the actuator.
 
 
 
 
 
<u><inlet> off</u>
 
 
Sends a SET OUTPUT command to the digitizer to disable the actuator output connected to the specified inlet, where disabling means the actuator state corresponding to "0", ie. when applying 0 V to the actuator.
 
 
 
 
 
<u><inlet> address <value></u>
 
 
 
Sends a FUNCTION command to the digitizer to set the I2C device id of the digital actuator connected to the actuator output which in turn is connected to the specified inlet, to the specified value [0..127]. 
 
 
 
 
 
<u><inlet> function <value></u> (<inlet> func <value>)
 
 
 
Sends a FUNCTION command to the digitizer to set the function number of the digital actuator connected to the actuator output which in turn is connected to the specified inlet, to the specified value [0..127]. 
 
 
 
 
 
<u><inlet> method <value></u>
 
 
 
Sends a FUNCTION command to the digitizer to set the method number of the digital actuator connected to the actuator output which in turn is connected to the specified inlet, to the specified value [0..127]. 
 
 
 
 
 
<u><inlet> analog, biobeat3d, hotspot2d, magnetic3d, moist3d, movealong, movearound, orient3d, orient4d, reachclosed, reachid, swipe3d <value></u>
 
 
 
Sends a FUNCTION command to the digitizer to set the I2C device id and function number according to the type (as specified by the name of the command) of the digital actuator connected to the actuator output which in turn is connected to the specified inlet, and its method to the specified value [0..127].
 

Latest revision as of 22:59, 14 March 2018

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 flost. 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, any number (0..127) sets the pulse width.

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.


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 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: 0 (general purpose repeating pulses, not servo-specific)
  • rpinterval: 5 ms
  • rpwidthmax: 1 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
  • level: 0 (off)
  • levelinit: 0 (off)
  • rp: 0 (off)
  • rpinit: 0 (off)
  • rpwidth: 0 ms
  • rpwidthinit: 0 ms