| 1 | |
| 2 | <refentry id="oscil1"> |
| 3 | <indexterm id="IndexOscil1"><primary>oscil1</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Table Access</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>oscil1</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>oscil1</refname> |
| 11 | <refpurpose> |
| 12 | Accesses table values by incremental sampling. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Accesses table values by incremental sampling. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>kres <command>oscil1</command> idel, kamp, idur [, ifn]</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Initialization</title> |
| 30 | <para> |
| 31 | <emphasis>idel</emphasis> -- delay in seconds before <emphasis>oscil1</emphasis> incremental sampling begins. |
| 32 | </para> |
| 33 | |
| 34 | <para> |
| 35 | <emphasis>idur</emphasis> -- duration in seconds to sample |
| 36 | through the <emphasis>oscil1</emphasis> table just once. A |
| 37 | negative value will make the table be read from the end to the beginning. |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis>ifn</emphasis> -- (optional) function table |
| 42 | number. <emphasis>tablei, oscil1i</emphasis> require the |
| 43 | extended guard point. The number defaults to -1 which indicates |
| 44 | a sinewave. |
| 45 | </para> |
| 46 | |
| 47 | </refsect1> |
| 48 | |
| 49 | <refsect1> |
| 50 | <title>Performance</title> |
| 51 | <para> |
| 52 | <emphasis>kamp</emphasis> -- amplitude factor. |
| 53 | </para> |
| 54 | |
| 55 | <para> |
| 56 | <emphasis>oscil1</emphasis> accesses values by sampling once through the function table at a rate determined by <emphasis>idur</emphasis>. For the first <emphasis>idel</emphasis> seconds, the point of scan will reside at the first location of the table; it will then begin moving through the table at a constant rate, reaching the end in another <emphasis>idur</emphasis> seconds; from that time on (i.e. after <emphasis>idel</emphasis> + <emphasis>idur</emphasis> seconds) it will remain pointing at the last location. Each value obtained from sampling is then multiplied by an amplitude factor <emphasis>kamp</emphasis> before being written into the result. |
| 57 | </para> |
| 58 | </refsect1> |
| 59 | |
| 60 | <refsect1> |
| 61 | <title>Examples</title> |
| 62 | <para> |
| 63 | Here is an example of the oscil1 opcode. It uses the file <ulink url="examples/oscil1.csd"><citetitle>oscil1.csd</citetitle></ulink>. |
| 64 | <example> |
| 65 | <title>Example of the oscil1 opcode.</title> |
| 66 | <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> |
| 67 | <xi:include href="examples-xml/oscil1.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 68 | </example> |
| 69 | </para> |
| 70 | <para> |
| 71 | The example will produce the following output: |
| 72 | <screen> |
| 73 | i1 0.50000 |
| 74 | i1 0.20000 |
| 75 | i1 0.80000 |
| 76 | i1 0.10000 |
| 77 | i1 0.90000 |
| 78 | i1 0.00000 |
| 79 | i1 1.00000 |
| 80 | i1 0.50000 |
| 81 | </screen> |
| 82 | </para> |
| 83 | </refsect1> |
| 84 | |
| 85 | <refsect1> |
| 86 | <title>See Also</title> |
| 87 | <para><link linkend="SiggenTableacc"><citetitle>Table Access</citetitle></link></para> |
| 88 | </refsect1> |
| 89 | |
| 90 | </refentry> |