| 1 | |
| 2 | <refentry id="xin"> |
| 3 | <indexterm id="IndexXin"><primary>xin</primary></indexterm> |
| 4 | <refentryinfo><title>Signal I/O:Software Bus</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>xin</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>xin</refname> |
| 11 | <refpurpose> |
| 12 | Passes variables to a user-defined opcode block, |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | The <emphasis>xin</emphasis> and <emphasis>xout</emphasis> opcodes copy variables to and from the opcode definition, allowing communication with the calling instrument. |
| 20 | </para> |
| 21 | |
| 22 | <para> |
| 23 | The types of input and output variables are defined by the parameters <emphasis>intypes</emphasis> and <emphasis>outtypes</emphasis>. |
| 24 | </para> |
| 25 | |
| 26 | <note> |
| 27 | <title>Notes</title> |
| 28 | <para> |
| 29 | <itemizedlist> |
| 30 | <listitem><para><emphasis>xin</emphasis> and <emphasis>xout</emphasis> should be called only once, and <emphasis>xin</emphasis> should precede <emphasis>xout</emphasis>, otherwise an init error and deactivation of the current instrument may occur.</para></listitem> |
| 31 | <listitem><para>These opcodes actually run only at i-time. Performance time copying is done by the user opcode call. This means that skipping <emphasis>xin</emphasis> or <emphasis>xout</emphasis> with <link linkend="kgoto"><citetitle>kgoto</citetitle></link> has no effect, while skipping with <link linkend="igoto"><citetitle>igoto</citetitle></link> affects both init and performance time operation.</para></listitem> |
| 32 | </itemizedlist> |
| 33 | </para> |
| 34 | </note> |
| 35 | </refsect1> |
| 36 | |
| 37 | <refsect1> |
| 38 | <title>Syntax</title> |
| 39 | <synopsis>xinarg1 [, xinarg2] ... [xinargN] <command>xin</command></synopsis> |
| 40 | </refsect1> |
| 41 | |
| 42 | <refsect1> |
| 43 | <title>Performance</title> |
| 44 | <para> |
| 45 | <emphasis>xinarg1</emphasis>, <emphasis>xinarg2</emphasis>, ... - input arguments. The number and type of variables must agree with the user-defined opcode's <emphasis>intypes</emphasis> declaration. However, <emphasis>xin</emphasis> does not check for incorrect use of init-time and control-rate variables. |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | The syntax of a user-defined opcode block is as follows: |
| 50 | |
| 51 | <programlisting> |
| 52 | <emphasis role="oblock">opcode</emphasis> name, outtypes, intypes |
| 53 | xinarg1 [, xinarg2] [, xinarg3] ... [xinargN] <emphasis role="opc">xin</emphasis> |
| 54 | [<emphasis role="opc">setksmps</emphasis> iksmps] |
| 55 | ... the rest of the instrument's code. |
| 56 | <emphasis role="opc">xout</emphasis> xoutarg1 [, xoutarg2] [, xoutarg3] ... [xoutargN] |
| 57 | <emphasis role="oblock">endop</emphasis> |
| 58 | </programlisting> |
| 59 | </para> |
| 60 | |
| 61 | <para> |
| 62 | The new opcode can then be used with the usual syntax: |
| 63 | |
| 64 | <literallayout> |
| 65 | [xinarg1] [, xinarg2] ... [xinargN] name [xoutarg1] [, xoutarg2] ... [xoutargN] [, iksmps] |
| 66 | </literallayout> |
| 67 | </para> |
| 68 | </refsect1> |
| 69 | |
| 70 | <refsect1> |
| 71 | <title>Examples</title> |
| 72 | <para> |
| 73 | See the example for the <link linkend="opcode"><citetitle>opcode</citetitle></link> opcode. |
| 74 | </para> |
| 75 | </refsect1> |
| 76 | |
| 77 | <refsect1> |
| 78 | <title>See Also</title> |
| 79 | <para> |
| 80 | <link linkend="OrchUDO"><citetitle>User Defined Opcodes (UDO)</citetitle></link> |
| 81 | </para> |
| 82 | </refsect1> |
| 83 | |
| 84 | <refsect1> |
| 85 | <title>Credits</title> |
| 86 | <para>Author: Istvan Varga, 2002; based on code by Matt J. Ingalls</para> |
| 87 | <para>New in version 4.22</para> |
| 88 | </refsect1> |
| 89 | </refentry> |