| 1 | |
| 2 | <refentry id="vcella"> |
| 3 | <indexterm id="IndexVcella"><primary>vcella</primary></indexterm> |
| 4 | <refentryinfo><title>Vectorial:Cellular Automata</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>vcella</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>vcella</refname> |
| 11 | <refpurpose> |
| 12 | Cellular Automata |
| 13 | |
| 14 | </refpurpose> |
| 15 | </refnamediv> |
| 16 | |
| 17 | <refsect1> |
| 18 | <title>Description</title> |
| 19 | <para> |
| 20 | Unidimensional Cellular Automata applied to Csound vectors |
| 21 | </para> |
| 22 | </refsect1> |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis><command>vcella</command> ktrig, kreinit, ioutFunc, initStateFunc, \ |
| 26 | iRuleFunc, ielements, irulelen [, iradius]</synopsis> |
| 27 | </refsect1> |
| 28 | |
| 29 | <refsect1> |
| 30 | <title>Initialization</title> |
| 31 | <para> |
| 32 | <emphasis>ioutFunc</emphasis> - number of the table where the state of each cell is stored |
| 33 | </para> |
| 34 | <para> |
| 35 | <emphasis>initStateFunc</emphasis> - number of a table containig the inital states of each cell |
| 36 | </para> |
| 37 | <para> |
| 38 | <emphasis>iRuleFunc</emphasis> - number of a lookup table containing the rules |
| 39 | </para> |
| 40 | <para> |
| 41 | <emphasis>ielements</emphasis> - total number of cells |
| 42 | </para> |
| 43 | <para> |
| 44 | <emphasis>irulelen</emphasis> - total number of rules |
| 45 | </para> |
| 46 | <para> |
| 47 | <emphasis>iradius</emphasis> (optional) - radius of Cellular Automata. At present time CA radius can be 1 or 2 (1 is the default) |
| 48 | </para> |
| 49 | </refsect1> |
| 50 | |
| 51 | <refsect1> |
| 52 | <title>Performance</title> |
| 53 | <para> |
| 54 | <emphasis>ktrig</emphasis> - trigger signal. Each time it is non-zero, a new generation of cells is evaluated |
| 55 | </para> |
| 56 | <para> |
| 57 | <emphasis>kreinit</emphasis> - trigger signal. Each time it is non-zero, state of all cells is forced to be that of <emphasis>initStateFunc</emphasis>. |
| 58 | </para> |
| 59 | <para> |
| 60 | <emphasis>vcella</emphasis> supports unidimensional cellular automata, where the state of each cell is stored in <emphasis>ioutFunc</emphasis>. So <emphasis>ioutFunc</emphasis> is a vector containing current state of each cell. This variant vector can be used together with any other vector-based opcode, such as |
| 61 | <link linkend="adsynt"><citetitle>adsynt</citetitle></link>, |
| 62 | <link linkend="vmap"><citetitle>vmap</citetitle></link>, |
| 63 | <link linkend="vpowv"><citetitle>vpowv</citetitle></link> etc. |
| 64 | </para> |
| 65 | <para> |
| 66 | <emphasis>initStateFunc</emphasis> is an input vector containing the inital value of the row of cells, while <emphasis>iRuleFunc</emphasis> is an input vector containing the rules in the form of a lookup table. Notice that <emphasis>initStateFunc</emphasis> and <emphasis>iRuleFunc</emphasis> can be updated during the performance by means of other vector-based opcodes (for example <link linkend="vcopy"><citetitle>vcopy</citetitle></link>) in order to force to change rules and status at performance time. |
| 67 | </para> |
| 68 | <para> |
| 69 | A new generation of cells is evaluated each time <emphasis>ktrig</emphasis> contains a non-zero value. Also the status of all cells can be forced to assume the status corresponding to the contents of <emphasis>initStateFunc</emphasis> each time <emphasis>kreinit</emphasis> contains a non-zero value. |
| 70 | </para> |
| 71 | <para> |
| 72 | Radius of CA algorithm can be 1 or 2 (optional <emphasis>iradius</emphasis> arguement). |
| 73 | </para> |
| 74 | </refsect1> |
| 75 | <refsect1> |
| 76 | <title>Examples</title> |
| 77 | <para> |
| 78 | Here is an example of the vcella opcode. It uses the file <ulink url="examples/vcella.csd"><citetitle>vcella.csd</citetitle></ulink>.</para> |
| 79 | <para> |
| 80 | The following example uses <emphasis>vcella</emphasis> |
| 81 | <example> |
| 82 | <title>Example of the vcella opcode.</title> |
| 83 | <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> |
| 84 | <xi:include href="examples-xml/vcella.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 85 | </example> |
| 86 | </para> |
| 87 | </refsect1> |
| 88 | |
| 89 | <refsect1> |
| 90 | <title>See also</title> |
| 91 | <para><link linkend="vectorialvectorial"><citetitle>Vectorial:Cellular Automata</citetitle></link></para> |
| 92 | <para><link linkend="SiggenModels"><citetitle>Models and Emulations</citetitle></link></para> |
| 93 | </refsect1> |
| 94 | |
| 95 | |
| 96 | <refsect1> |
| 97 | <title>Credits</title> |
| 98 | <para>Written by: Gabriel Maldonado.</para> |
| 99 | <para>New in Csound 5 (Previously available only on CsoundAV)</para> |
| 100 | <para>Example by: Anthony Kozar</para> |
| 101 | </refsect1> |
| 102 | </refentry> |