| 1 |
<section id="PrefaceToot3"> |
| 2 |
<title>Toot 3</title> |
| 3 |
<para> |
| 4 |
Although in the second instrument we could control and vary the overall amplitude from note to note, it would be more musical if we could contour the loudness during the course of each note. To do this we'll need to employ an additional opcode <link linkend="linen"><citetitle>linen</citetitle></link>, which is used as follows: |
| 5 |
<programlisting> |
| 6 |
kr <emphasis role="opc">linen</emphasis> kamp, irise, idur, idec |
| 7 |
|
| 8 |
ar <emphasis role="opc">linen</emphasis> xamp, irise, idur, idec</programlisting> |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
<link linkend="linen"><citetitle>linen</citetitle></link> produces a set of values which go linearly from 0 to <emphasis>kamp</emphasis> in the time (in seconds) specified by <emphasis>irise</emphasis>. It will stay there for some time and then it will return to 0 again taking <emphasis>idec</emphasis> time. The output of <link linkend="linen"><citetitle>linen</citetitle></link> (k1) is patched into the <emphasis>kamp</emphasis> argument of an <link linkend="oscil"><citetitle>oscil</citetitle></link>. This applies an envelope to the <link linkend="oscil"><citetitle>oscil</citetitle></link>. The csd appears in file <ulink url="examples/toot3.csd"><citetitle>toot3.csd</citetitle></ulink>. |
| 13 |
</para> |
| 14 |
|
| 15 |
<para> |
| 16 |
<mediaobject> |
| 17 |
<imageobject> |
| 18 |
<imagedata fileref="images/linen.jpg" format="JPG"/> |
| 19 |
</imageobject> |
| 20 |
<textobject> |
| 21 |
<phrase>[Envelope generated by the linen opcode]</phrase> |
| 22 |
</textobject> |
| 23 |
<caption> |
| 24 |
<para>Envelope generated by the <emphasis>linen</emphasis> opcode</para> |
| 25 |
</caption> |
| 26 |
</mediaobject> |
| 27 |
</para> |
| 28 |
|
| 29 |
<para> |
| 30 |
<xi:include href="examples-xml/toot3.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 31 |
</para> |
| 32 |
</section> |