| 1 | <refentry id="shiftout"> |
| 2 | <indexterm id="IndexShiftout"><primary>shiftout</primary></indexterm> |
| 3 | |
| 4 | <refentryinfo><title>Array Opcodes</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>shiftout</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>shiftout</refname> |
| 11 | <refpurpose> |
| 12 | Shifts the contents of a 1-dimensional array into an audio variable. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | This opcode can be used to push data to an audio variable from a 1-dimensional array. The array needs to be at least ksmps numbers long, but can be longer. Data is shifted out circularly, with the writing position moving by ksmps positions every k-cycle. When the array gets emptied, the writing position wraps around to the beginning of the array again. Together with the shiftin opcode, it can form a FIFO queue. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>asig <command>shiftout</command> kIn[][, ioff]</synopsis> |
| 26 | </refsect1> |
| 27 | <refsect1> |
| 28 | <title>Initialization</title> |
| 29 | <para> |
| 30 | <emphasis>ioff</emphasis> -- initial read offset position (optional, defaults to 0). |
| 31 | </para> |
| 32 | </refsect1> |
| 33 | <refsect1> |
| 34 | <title>Performance</title> |
| 35 | <para> |
| 36 | <emphasis>kin[]</emphasis> -- input array, needs to be at least ksmps numbers long. |
| 37 | </para> |
| 38 | <para> |
| 39 | <emphasis>asig</emphasis> -- output audio |
| 40 | </para> |
| 41 | </refsect1> |
| 42 | |
| 43 | <refsect1> |
| 44 | <title>Examples</title> |
| 45 | <para> |
| 46 | Here is an example of the shiftout opcode. It uses the file <ulink |
| 47 | url="examples/shiftout.csd"><citetitle>shiftout.csd</citetitle></ulink>.</para> |
| 48 | |
| 49 | <example> |
| 50 | <title>Example of the shiftout opcode.</title> |
| 51 | |
| 52 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 53 | <xi:include href="examples-xml/shiftout.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 54 | </example> |
| 55 | </refsect1> |
| 56 | |
| 57 | <refsect1> |
| 58 | <title>See Also</title> |
| 59 | <para> |
| 60 | <link linkend="vectorial"><citetitle></citetitle>Vectorial opcodes</link>, |
| 61 | <link linkend="arrayOpcodes"><citetitle></citetitle>array opcodes</link> |
| 62 | </para> |
| 63 | </refsect1> |
| 64 | |
| 65 | <refsect1> |
| 66 | <title>Credits</title> |
| 67 | <para> |
| 68 | <simplelist> |
| 69 | <member>Author: &namevictor;</member> |
| 70 | <member>NUI Maynooth</member> |
| 71 | <member>2014</member> |
| 72 | </simplelist> |
| 73 | </para> |
| 74 | <para>New in version 6.04</para> |
| 75 | </refsect1> |
| 76 | </refentry> |