Debian Codegraph @

preface/toot1XO.xml

raw symbols SCIP
1 <section id="PrefaceToot1">
2 <title>Toot 1</title>
3 <para>
4 In the Csound language, the words are called <emphasis>opcodes</emphasis>. <emphasis>Opcodes</emphasis> are instructions that Csound understands and performs actions with. This manual contains a long list of <emphasis>opcodes</emphasis> in alphabetical order in the <link linkend="PartReference"><citetitle>Reference Section</citetitle></link>.
5 </para>
6 <para>
7 <emphasis>Opcodes</emphasis> can produce results and receive parameters. The output of an <emphasis>opcode</emphasis> will always be to the left, while the inputs or parameters will be to the right.
8 </para>
9 <para>
10 This first <emphasis>csd</emphasis> file, called <ulink url="examples/toot1.csd"><citetitle>toot1.csd</citetitle></ulink> contains a single instrument which uses the <link linkend="oscil"><citetitle>oscil</citetitle></link> opcode to play a 440Hz sine wave (defined by f1 in the score) at an amplitude of 10000.
11 </para>
12 <tip>
13 <para>
14 If you are using the Csound Editor Activity, remember that you can open csd files directly from the File Menu. You can also copy and paste from this page, but you must paste the orchestra section and the score section separately. To do this, select the text between the <emphasis>&lt;CsInstruments&gt;</emphasis> and <emphasis>&lt;/CsInstruments&gt;</emphasis> tags, without including them. Then press CTRL-C, to copy to the clipboard. Switch to the Csound Editor Activity and click on the Instrument panel, then press CTRL-V. To paste the score section, do the same for all text contained between the <emphasis>&lt;CsScore&gt;</emphasis> and <emphasis>&lt;/CsScore&gt;</emphasis> tags, and paste it on the Editor's Score panel.
15 </para>
16 </tip>
17 <para>
18 The opcode <link linkend="oscil"><citetitle>oscil</citetitle></link> produces an oscillation which is stored in variable <emphasis>a1</emphasis>. That is the output or result of the opcode as it is to the left. On the right we have the parameters the opcode uses to determine it output. In the case of <link linkend="oscil"><citetitle>oscil</citetitle></link>, we need to specify the amplitude of oscillation, which is the first parameter, the frequency of oscillation, which is the second one, and the shape or waveform of the oscillation.
19 </para>
20 <para>
21 The shape of the oscillation is created not in the orchestra, but in the score section. The shape is stored in the computer's memory using what Csound calls an <link linkend="f"><citetitle>f-table</citetitle></link>, which is created using an <link linkend="f"><citetitle>f statement</citetitle></link>. There are many different shapes you can create using the different <link linkend="ScoreGenRef"><citetitle>GEN routines</citetitle></link> provided by Csound.
22 </para>
23 <para>
24 The oscillation produced by the <link linkend="oscil"><citetitle>oscil</citetitle></link> opcode is made audible by the <link linkend="out"><citetitle>out</citetitle></link> opcode. Notice that this opcode doesn't have any outputs. Its output is actually the sound you hear!
25 </para>
26 <para>
27 In the Orchestra section of a <emphasis>csd</emphasis> file we define the instruments, but no instrument sounds if it is not played. To play an instrument, the <link linkend="i"><citetitle>i statement</citetitle></link> in the score must be used.
28 </para>
29 <para>
30 <xi:include href="examples-xml/toot1.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
31 </para>
32 </section>