Home Reference VEX VEX functions 

ch vex function

Contexts: chop , pop , sop

Tags: utility

Evaluates a channel (or parameter) and return its value.

  1. float ch(string channel)

  2. string ch(string channel)

  3. float ch(string channel, float time)

  4. string ch(string channel, float time)

Evaluates a channel (or parameter) and return its value. When evaluating string parameters at a specified time, the time value must be the same for all evaluations of the parameter.

If the time is not constant over the all the points/pixels being evaluated, results are not predictable. For example, the following functions will produce unpredictable results:

string s = ch(channel_path, ptnum); // SOP/POP
string s = ch(channel_path, cinput(X, Y).r); // COP
string s = ch(channel_path, age); // SOP/POP
string s = ch(channel_path, V); // CHOP
since the time specified will be different for every evaluation of the VEX function. The following functions will work correctly:

string s = ch(channel_path, Time*.7); // SOP/POP
string s = ch(channel_path, XRES); // COP
string s = ch(channel_path, SR); // CHOP
…because the time specified will be the same for every evaluation of the VEX function. The time specified is in seconds