File: tootint.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (124 lines) | stat: -rw-r--r-- 5,979 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<HTML>
<TITLE>TOOT_INTRODUCTION</TITLE>
<CENTER><P><A NAME="Toot_Introduction"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="./TUTORIALS.html">Top of this section</A></B> - <A HREF="./toots.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./note.html">Next</A> 
<HR></P></CENTER>

<H2>Toot Introduction</H2>

<P>Csound instruments are created in an <I><A HREF="./orcfile.html">orchestra
</A></I>file, and the list of notes to play is written in a separate <I><A HREF="./scofile.html">score
</A></I>file. Both are created using a standard word processor. When you
run Csound on a specific orchestra and score, the score is sorted and ordered
in time, the orchestra is translated and loaded, the wavetables are computed
and filled, and then the score is performed. The score drives the orchestra
by telling the specific instruments when and for how long to play, and
what parameters to use during the course of each note event. </P>

<P>Unlike today's commercial hardware synthesizers, which have a limited
set of oscillators, envelope generators, filters, and a fixed number of
ways in which these can be interconnected, Csound's power is not limited.
If you want an instrument with hundreds of oscillators, envelope generators,
and filters you just type them in. More important is the freedom to interconnect
the modules, and to interrelate the parameters which control them. Like
acoustic instruments, Csound instruments can exhibit a sensitivity to the
musical context, and display a level of &quot;musical intelligence&quot;
to which hardware synthesizers can only aspire. </P>

<P>Because the intent of this tutorial is to familiarize the novice with
the syntax of the language, we will design several simple instruments.
You will find many instruments of the sophistication described above in
various Csound directories, and a study of these will reveal Csound's real
power. </P>

<P>The Csound <B><A HREF="./orcfile.html">orchestra file</A></B> has
two main parts: </P>

<P>1. <I>the <A HREF="./../Syntax/orches.html">header
section </A></I>- defining the sample rate, control rate, and number of
output channels.</P>

<P>2. <I>the <A HREF="./../Syntax/instr.html">instrument
section </A></I>- in which the instruments are designed. </P>

<P><B>The <A HREF="./../Syntax/orches.html">Header
Section</A></B><A HREF="./../Syntax/orches.html">:</A>
A Csound orchestra generates signals at two rates - an audio sample rate
and a control sample rate. Each can represent signals with frequencies
no higher than half that rate, but the distinction between audio signals
and sub-audio control signals is useful since it allows slower moving signals
to require less compute time. In the header below, we have specified a
sample rate of 16kHz, a control rate of 1kHz, and then calculated the number
of samples in each control period using the formula: ksmps = sr / kr</P>

<PRE>                    sr   =              16000
                    kr   =              1000
                    ksmps     =         16
                    nchnls    =         1 
</PRE>

<P>In Csound orchestras and scores, spacing is arbitrary. It is important
to be consistent in laying out your files, and you can use spaces to help
this. In the Tutorial Instruments shown below you will see we have adopted
one convention. The reader can choose his or her own. </P>

<P><B>The <A HREF="./../Syntax/instr.html">Instrument
Section</A></B>: All instruments are numbered and are referenced thus in
the score. Csound instruments are similar to patches on a hardware synthesizer.
Each instrument consists of a set of &quot;unit generators,&quot; or software
&quot;modules,&quot; which are &quot;patched&quot; together with &quot;i/o&quot;
blocks - <B>i</B>, <B>k</B>, or <B>a </B>variables. Unlike a hardware module,
a software module has a number of variable &quot;arguments&quot; which
the user sets to determine its behavior. The four types of variables are:</P>

<PRE>          setup only

          <B>i</B>-rate variables, changed at the note rate
          <B>k</B>-rate variables, changed at the control signal rate
          <B>a</B>-rate variables, changed at the audio signal rate

</PRE>

<P><B><A HREF="./CsOrcGen.html#2._SYNTAX_OF_THE_ORCHESTRA">Orchestra Statements</A></B>:
Each statement occupies a single line and has the same basic format: </P>

<PRE>          <B>result</B>    <B>action</B>    <B>arguments</B>

</PRE>

<P>To include an oscillator in our orchestra, you might specify it as follows:</P>

<PRE>          <B>a1</B>        <B>oscil</B>          <B>10000, 440, 1</B>


</PRE>

<P>The three &quot;arguments&quot; for this oscillator set its amplitude
(10000), its frequency (440Hz), and its waveshape (1). The output is put
in i/o block &quot;a1.&quot; This output symbol is significant in prescribing
the rate at which the oscillator should generate output-here the audio
rate. We could have named the result anything (e.g. &quot;asig&quot;) as
long as it began with the letter &quot;a&quot;. </P>

<P><B>Comments</B>: To include text in the orchestra or score which will
not be interpreted by the program, precede it with a semicolon. This allows
you to fully comment your code. On each line, any text which follows a
semicolon will be ignored by the orchestra and score translators.</P>

<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="./TUTORIALS.html">Top of this section</A></B> - <A HREF="./toots.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./note.html">Next</A> 
<HR></P></CENTER>


<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B>&nbsp;
</CENTER>
</HTML>