| 1 |
|
| 2 |
<refentry id="chani"> |
| 3 |
<indexterm id="Indexchani"><primary>chani</primary></indexterm> |
| 4 |
<refentryinfo><title>Signal I/O:Software Bus</title></refentryinfo> |
| 5 |
<refmeta> |
| 6 |
<refentrytitle>chani</refentrytitle> |
| 7 |
</refmeta> |
| 8 |
|
| 9 |
<refnamediv> |
| 10 |
<refname>chani</refname> |
| 11 |
<refpurpose> |
| 12 |
Reads data from the software bus |
| 13 |
</refpurpose> |
| 14 |
</refnamediv> |
| 15 |
|
| 16 |
<refsect1> |
| 17 |
<title>Description</title> |
| 18 |
<para> |
| 19 |
Reads data from a channel of the inward software bus. |
| 20 |
</para> |
| 21 |
</refsect1> |
| 22 |
|
| 23 |
<refsect1> |
| 24 |
<title>Syntax</title> |
| 25 |
<synopsis>kval <command>chani</command> kchan</synopsis> |
| 26 |
|
| 27 |
<synopsis>aval <command>chani</command> kchan</synopsis> |
| 28 |
</refsect1> |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
<refsect1> |
| 38 |
<title>Performance</title> |
| 39 |
<para> |
| 40 |
<emphasis>kchan</emphasis> -- a positive integer that indicates |
| 41 |
which channel of the software bus to read |
| 42 |
</para> |
| 43 |
|
| 44 |
<para> |
| 45 |
Note that the inward and outward software busses are independent, and |
| 46 |
are not mixer buses. Also the k-rate and a-rate busses are |
| 47 |
independent. The last value remains until a new value is |
| 48 |
written. There is no imposed limit to the number of busses but they |
| 49 |
use memory so small numbers are to be preferred. |
| 50 |
</para> |
| 51 |
</refsect1> |
| 52 |
|
| 53 |
<refsect1> |
| 54 |
<title>Example</title> |
| 55 |
<para> |
| 56 |
The example shows the software bus being used as an asynchronous |
| 57 |
control signal to select a filter cutoff. It assumes that an |
| 58 |
external program that has access to the API is feeding the values |
| 59 |
</para> |
| 60 |
|
| 61 |
<informalexample> |
| 62 |
<programlisting> |
| 63 |
<emphasis role="ohdr">sr</emphasis> <emphasis role="op">=</emphasis> 44100 |
| 64 |
<emphasis role="ohdr">kr</emphasis> <emphasis role="op">=</emphasis> 100 |
| 65 |
<emphasis role="ohdr">ksmps</emphasis> <emphasis role="op">=</emphasis> 1 |
| 66 |
|
| 67 |
|
| 68 |
<emphasis role="oblock">instr</emphasis> 1 |
| 69 |
kc <emphasis role="opc">chani</emphasis> 1 |
| 70 |
a1 <emphasis role="opc">oscil</emphasis> p4, p5, 100 |
| 71 |
a2 <emphasis role="opc">lowpass2</emphasis> a1, kc, 200 |
| 72 |
<emphasis role="opc">out</emphasis> a2 |
| 73 |
<emphasis role="oblock">endin</emphasis> |
| 74 |
</programlisting> |
| 75 |
</informalexample> |
| 76 |
|
| 77 |
</refsect1> |
| 78 |
|
| 79 |
<refsect1> |
| 80 |
<title>See also</title> |
| 81 |
<para><link linkend="SoftwareBus"><citetitle>Software Bus</citetitle></link></para> |
| 82 |
</refsect1> |
| 83 |
|
| 84 |
<refsect1> |
| 85 |
<title>Credits</title> |
| 86 |
<para> |
| 87 |
<simplelist> |
| 88 |
<member>Author: &namejohn;</member> |
| 89 |
<member>2005</member> |
| 90 |
</simplelist> |
| 91 |
</para> |
| 92 |
<para>New in Csound 5.00</para> |
| 93 |
</refsect1> |
| 94 |
</refentry> |