xout — Retrieves variables from a user-defined opcode block,


The xin and xout opcodes copy variables to and from the opcode definition, allowing communication with the calling instrument.

The types of input and output variables are defined by the parameters intypes and outtypes.

[Note] Notes

  • xin and xout should be called only once, and xin should precede xout, otherwise an init error and deactivation of the current instrument may occur.

  • These opcodes actually run only at i-time. Performance time copying is done by the user opcode call. This means that skipping xin or xout with kgoto has no effect, while skipping with igoto affects both init and performance time operation.


xout xoutarg1 [, xoutarg2] ... [, xoutargN]


xoutarg1, xoutarg2, ... - output arguments. The number and type of variables must agree with the user-defined opcode's outtypes declaration. However, xout does not check for incorrect use of init-time and control-rate variables.

The syntax of a user-defined opcode block is as follows:

opcode  name, outtypes, intypes
xinarg1 [, xinarg2] [, xinarg3] ... [xinargN]  xin
[setksmps  iksmps]
... the rest of the instrument's code.
xout  xoutarg1 [, xoutarg2] [, xoutarg3] ... [xoutargN]

The new opcode can then be used with the usual syntax:

[xinarg1] [, xinarg2] ... [xinargN]  name  [xoutarg1] [, xoutarg2] ... [xoutargN] [, iksmps]


See the example for the opcode opcode.

See Also

User Defined Opcodes (UDO)


Author: Istvan Varga, 2002; based on code by Matt J. Ingalls

New in version 4.22