SET VALUE
Value Item | |||
---|---|---|---|
NEW | SET | ATTRIBUTES | MESSAGES |
You can modify the value item's data using the following SET VALUE commands.
Contents
TIMER
SET value TIMER mode [step=100 stop=0]
Configure the timer of a value item. The timer can be started and stopped (mode = ON
|OFF
). The incremental value (step in ms) and the time when the timer should be stopped automatically (stop in ms, <= 0 for endless) can be set. If a timer is active, it sends a TIMER
message for each step to the shell.
INPUT
SET value INPUT itemOutput|* [ /R ]
Connect the input of the value item value to the output of an SPU, graph (e.g. cursors) or other value item. If the option /R is used, an asynchronous data transfer is performed. To read data without changing the connection use '*
' for itemOutput.
- itemOutput
- The output of a value, SPU or graph. If an input has already been specified by a previous command, you can use an asterisk in association with the /Read option to transfer the data.
The output of an item is addressed using the syntax itemname.outputname
(e.g. $#graphitem.cursors
).SET value INPUT
Disconnect the input of a value item. The input is disconnected automatically when the connected item or the value item itself is deleted.
OUTPUT
The OUTPUT command is used to change a value item's data and optionally write it to any connected item (see INPUT
). Since the extension of the STx macro syntax in version 3.7.0, value item assignment has become much easier and therefore the use of the OUTPUT command as the primary means of assigning data is probably no longer the case.
A simple way to assign the value of one item to another is:
$#v1 := $#v2 // assign the contents of #v2 to #v1
Creation and initialisation of an output
If you want to connect a value item to another value item (or SPU etc) the output must be activated. Any data assignment will activate the output. Changing the value item's data will not, however, write it to the output. You must use the OUTPUT
command with the /Write option to write data to the output.
The output data must be created before another item can be connected to the output and before it can be updated or written.
SET value OUTPUT /String nCharacters
Create a string output with nCharacters characters.
SET value OUTPUT /Number numericValue [/Double]
Create a numeric value output with the initial value numericValue. If the flag /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-big floating-point numbers.
SET value OUTPUT /Vector nElements [/Double]
Create a vector output with nElements elements. If the flag /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-big floating-point numbers.
SET value OUTPUT /Array length count [/Double]
Create a vector array output. The output has count vectors where each vector has length elements. If the option /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-bit floating-point numbers.
You can change the data type of a value item with this command.
Updating an output
Update the value item's data and write it to it's output.
If the option /Write is used, the data is sent to the connected input (if any). The output data type is defined during creation (see above). The connection of a value item to an output is performed via the input connect function of another value item, or during SPU item creation if the value item is used as an argument (input) for the SPU.
The value item output can be used, for example, to control SPU items performing real-time processing.
The following option is valid for all four commands below.
- /Write
- If the new value to the item's output.
SET value OUTPUT string [/Write]
Set the value item's content to the value of string.
- string
- Any character string.
Another way to assign data to a value item is by using the assignment operator. E.g. if you value item is stored in the variable #v and you want to assign the string 'hello', the following command will work: $#v := 'hello'SET value OUTPUT numericValue [/Write]
Initialize a numerical output with the value numericValue.
SET value OUTPUT index1 number1 [index2 number2 coef] [/Write]
Initialize a vector output in the following way:
elementindex1 = number1 elementi = number1 + (number2 – number1) . ((i – index1) / (index2 – index1))coef
with: 0 <= index1 < index2 < nElements and coef > 0
SET value OUTPUT number [index count row] [/Write]
Update the element index and the next count elements of the vector row with the value number.
- number
- The numerical value