| 1 | |
| 2 | <refentry id="zawm"> |
| 3 | <indexterm id="IndexZawm"><primary>zawm</primary></indexterm> |
| 4 | <refentryinfo><title>Zak Patch System</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>zawm</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>zawm</refname> |
| 13 | <refpurpose> |
| 14 | Writes to a za variable at a-rate with mixing. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Writes to a za variable at a-rate with mixing. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis><command>zawm</command> asig, kndx [, imix]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>imix</emphasis> (optional, default=1) -- indicates if mixing should occur. |
| 34 | </para> |
| 35 | </refsect1> |
| 36 | |
| 37 | <refsect1> |
| 38 | <title>Performance</title> |
| 39 | <para> |
| 40 | <emphasis>asig</emphasis> -- value to be written to the za location. |
| 41 | </para> |
| 42 | |
| 43 | <para> |
| 44 | <emphasis>kndx</emphasis> -- points to the za location to which to write. |
| 45 | </para> |
| 46 | |
| 47 | <para> |
| 48 | These opcodes are fast, and always check that the index is within the range of zk or za space. If not, an error is reported, 0 is returned, and no writing takes place. |
| 49 | </para> |
| 50 | |
| 51 | <para> |
| 52 | <emphasis>zawm</emphasis> is a mixing opcode, it adds the signal to the current value of the variable. If no <emphasis>imix</emphasis> is specified, mixing always occurs. <emphasis>imix</emphasis> = 0 will cause overwriting like <emphasis>ziw</emphasis>, <emphasis>zkw</emphasis>, and <emphasis>zaw</emphasis>. Any other value will cause mixing. |
| 53 | </para> |
| 54 | |
| 55 | <para> |
| 56 | <emphasis>Caution</emphasis>: When using the mixing opcodes <emphasis>ziwm</emphasis>, <emphasis>zkwm</emphasis>, and <emphasis>zawm</emphasis>, care must be taken that the variables mixed to, are zeroed at the end (or start) of each k- or a-cycle. Continuing to add signals to them, can cause their values can drift to astronomical figures. |
| 57 | </para> |
| 58 | |
| 59 | <para> |
| 60 | One approach would be to establish certain ranges of zk or za variables to be used for mixing, then use <emphasis>zkcl</emphasis> or <emphasis>zacl</emphasis> to clear those ranges. |
| 61 | </para> |
| 62 | </refsect1> |
| 63 | |
| 64 | <refsect1> |
| 65 | <title>Examples</title> |
| 66 | <para> |
| 67 | Here is an example of the zawm opcode. It uses the file <ulink url="examples/zawm.csd"><citetitle>zawm.csd</citetitle></ulink>. |
| 68 | |
| 69 | <example> |
| 70 | <title>Example of the zawm opcode.</title> |
| 71 | |
| 72 | |
| 73 | |
| 74 | <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> |
| 75 | <xi:include href="examples-xml/zawm.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 76 | </example> |
| 77 | </para> |
| 78 | </refsect1> |
| 79 | |
| 80 | <refsect1> |
| 81 | <title>See also</title> |
| 82 | <para><link linkend="ZakTop"><citetitle>Zak Patch System</citetitle></link></para> |
| 83 | </refsect1> |
| 84 | |
| 85 | <refsect1> |
| 86 | <title>Credits</title> |
| 87 | <para> |
| 88 | <simplelist> |
| 89 | <member>Author: Robin Whittle</member> |
| 90 | <member>Australia</member> |
| 91 | <member>May 1997</member> |
| 92 | </simplelist> |
| 93 | </para> |
| 94 | <para>New in version 3.45</para> |
| 95 | <para>Example written by &namekevin;.</para> |
| 96 | </refsect1> |
| 97 | </refentry> |