| 1 | |
| 2 | <refentry id="readscratch"> |
| 3 | <indexterm id="IndexReadscratch"><primary>readscratch</primary></indexterm> |
| 4 | <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>readscratch</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>readscratch</refname> |
| 13 | |
| 14 | <refpurpose> |
| 15 | returns a value stored in the instance of an instrument. |
| 16 | </refpurpose> |
| 17 | </refnamediv> |
| 18 | |
| 19 | <refsect1> |
| 20 | <title>Description</title> |
| 21 | <para> |
| 22 | The <emphasis>readscratch</emphasis> opcode returns one of four |
| 23 | scalar values stored in the instance of an instrument. |
| 24 | </para> |
| 25 | </refsect1> |
| 26 | |
| 27 | <refsect1> |
| 28 | <title>Syntax</title> |
| 29 | <synopsis>ival <command>readscratch</command>[index]</synopsis> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Initialisation</title> |
| 34 | <para> |
| 35 | <emphasis>ival</emphasis> -- variable for result. |
| 36 | </para> |
| 37 | <para> |
| 38 | <emphasis>index</emphasis> -- which value to read, defaulting |
| 39 | to zero. |
| 40 | </para> |
| 41 | |
| 42 | </refsect1> |
| 43 | |
| 44 | <refsect1> |
| 45 | <title>Examples</title> |
| 46 | <para> |
| 47 | Here is an example of the readscratch opcode. It uses the file <ulink url="examples/readscratch.csd"><citetitle>readscratch.csd</citetitle></ulink>. |
| 48 | <example> |
| 49 | <title>Example of the readscratch opcode.</title> |
| 50 | <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> |
| 51 | <xi:include href="examples-xml/readscratch.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 52 | </example> |
| 53 | </para> |
| 54 | </refsect1> |
| 55 | |
| 56 | <refsect1> |
| 57 | <title>See Also</title> |
| 58 | <para> |
| 59 | <link linkend="writescratch"><citetitle>writescratch</citetitle></link>, |
| 60 | </para> |
| 61 | </refsect1> |
| 62 | |
| 63 | <refsect1> |
| 64 | <title>Credits</title> |
| 65 | <para> |
| 66 | <simplelist> |
| 67 | <member>Author: &namejohn;</member> |
| 68 | <member>March 2013</member> |
| 69 | </simplelist> |
| 70 | </para> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>See also</title> |
| 74 | <para><link linkend="MiscopcodesTop"><citetitle>Miscellaneous opcodes</citetitle></link></para> |
| 75 | </refsect1> |
| 76 | |
| 77 | <para>New in Csound version 6.00</para> |
| 78 | </refsect1> |
| 79 | </refentry> |