an open-source digital signal processing and sound synthesis language
about · links · contact
f_arg/i_arg/s_arg/n_arg - return command-line arguments


val = f_arg(arg_index)
val = i_arg(arg_index)
val = s_arg(arg_index)
val = n_arg()


These functions allow command-line arguments to the CMIX command to be entered into the RTcmix scorefile environment. For example, the command:

    CMIX 1 2 3 4 5 < scorefile.sco
contains 5 ingeter command-line arguments. The command:
    CMIX 1.0 2.0 "hey" < scorefile.sco
contains 2 floating-point arguments and 1 string argument.

f_arg(n) returns the nth argument as a floating-point value.
i_arg(n) returns the nth argument as an integer value.
s_arg(n) returns the nth argument as a string value.
n_arg() returns the number of arguments in the CMIX command.


The index of the argument to retrieve. Numbering of arguments starts at "0" for the first argument after the CMIX command.


   floatval = f_arg(3)
   stringval = s_arg(1)
   nargs = n_arg()

See Also

print, printf, rtsetparams, set_option, stringify, type