| 1 | |
| 2 | <refentry id="writescratch"> |
| 3 | <indexterm id="IndexWritescratch"><primary>writescratch</primary></indexterm> |
| 4 | <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>writescratch</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>writescratch</refname> |
| 13 | |
| 14 | <refpurpose> |
| 15 | writes a value into the scratchpad of the instance of an instrument. |
| 16 | </refpurpose> |
| 17 | </refnamediv> |
| 18 | |
| 19 | <refsect1> |
| 20 | <title>Description</title> |
| 21 | <para> |
| 22 | The <emphasis>writescratch</emphasis> opcode writes one of four |
| 23 | scalar values to be stored in the instance of an instrument. |
| 24 | </para> |
| 25 | </refsect1> |
| 26 | |
| 27 | <refsect1> |
| 28 | <title>Syntax</title> |
| 29 | <synopsis><command>writescratch</command>ival[, index]</synopsis> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Initialisation</title> |
| 34 | <para> |
| 35 | <emphasis>ival</emphasis> -- variable to write. |
| 36 | </para> |
| 37 | <para> |
| 38 | <emphasis>index</emphasis> -- which value to write, 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 writescratch opcode. It uses the file <ulink url="examples/readscratch.csd"><citetitle>readscratch.csd</citetitle></ulink>. |
| 48 | <example> |
| 49 | <title>Example of the writescratch 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><link linkend="MiscopcodesTop"><citetitle>Miscellaneous opcodes</citetitle></link></para> |
| 59 | </refsect1> |
| 60 | |
| 61 | <refsect1> |
| 62 | <title>Credits</title> |
| 63 | <para> |
| 64 | <simplelist> |
| 65 | <member>Author: &namejohn;</member> |
| 66 | <member>March 2013</member> |
| 67 | </simplelist> |
| 68 | </para> |
| 69 | |
| 70 | <para>New in Csound version 6.00</para> |
| 71 | </refsect1> |
| 72 | </refentry> |