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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
|
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
<TITLE>Tutorial 2 - Csound Programming with CECILIA</TITLE>
</HEAD>
<BODY>
<CENTER> </CENTER>
<CENTER><TABLE COLS=3 WIDTH="100%" NOSAVE >
<TR ALIGN=CENTER VALIGN=CENTER NOSAVE>
<TD ALIGN=LEFT VALIGN=TOP NOSAVE><B><A HREF="tut1.html"><--</A></B></TD>
<TD ALIGN=CENTER VALIGN=CENTER NOSAVE><A HREF="index.html"><IMG SRC="help.gif" ></A></TD>
<TD ALIGN=RIGHT VALIGN=TOP NOSAVE><B><FONT COLOR="#000000"><A HREF="tut3.html">--></A></FONT></B></TD>
</TR>
</TABLE></CENTER>
<CENTER>
<H2>
<B>TUTORIAL 2 : CSOUND PROGRAMMING WITH CECILIA</B></H2></CENTER>
<CENTER><A HREF="#Getting ready">Why use CECILIA?</A></CENTER>
<CENTER><A HREF="#Opening">Making a simple orchestra and score</A></CENTER>
<CENTER><A HREF="#Using">Testing, changing, testing...</A></CENTER>
<CENTER> </CENTER>
<CENTER>
<HR></CENTER>
<UL>
<LI>
<A NAME="Getting ready"></A><B>Csound Programming and the CECILIA file
structure. <FONT SIZE=-2><A HREF="#">top</A></FONT></B></LI>
<P>CECILIA is a highly efficient Csound programming environment.
Some of the tools to make the job easier and more productive:
<UL>
<LI>
Text-editor optimized for Csound coding</LI>
<LI>
Full on-line Csound manual</LI>
<LI>
Orchestra and Score Opcode inserters</LI>
<LI>
Quick syntax checker</LI>
<LI>
Full in-text error reporting</LI>
<LI>
Service functions for soundfile information</LI>
<LI>
Colorized and tabulated syntax</LI>
<LI>
Unified (orc & sco) document structure</LI>
<LI>
Comprehensive Search and Replace facilities.</LI>
<BR> </UL>
CECILIA saves documents as single files. These files are called modules
and include both the orchestra and the score along with a number of other
useful information. The reason for this is to make file managment easier.
It is entirely possible to save the orchestra and score independently in
the traditional way, but we believe even the experienced Csound programmer
will find the unified document structure easier to deal with.
<BR>
<HR WIDTH="100%">
<BR>
<LI>
<A NAME="Opening"></A><B>Making a simple orchestra and score <FONT SIZE=-2><A HREF="#">top</A></FONT></B></LI>
<BR>
<UL>
<LI>
Start CECILIA. Start Netscape.</LI>
<BR>
<LI>
Under the <B>File</B> menu in the Main window, select <B>New...</B> and
then <B>Module...</B></LI>
<P>The <A HREF="editor.html">CECILIA editor</A> opens up with a couple of
window panes. The CECILIA Csound Editor is divided into 9 different sections
(or panes). These can be posted in the editor window through the Sections
menu or the buttons under the editor menubar:
<UL>
<LI>
<B><I>info.</I></B> In this section, the author can enter any relevant
information about what this particular module does. This information can
be displayed by selecting the <B>About this module...</B> menu in the grapher
window when the module is saved and recalled.</LI>
<LI>
<B><I>tk_interface.</I></B> In this section the author will enter
definitions for any CECILIA interface object to be used in this module.
THis is of course optional. The <A HREF="tut3.html">third tutorial </A>deals
with this.</LI>
<LI>
<B><I>mono, stereo, quad.</I></B> These three sections are where the orchestra
is entered. Which variant will be used for the computation is determined
by which "channel" button is selected in the Main window. This separation
is useful for permitting three variations on the number of output channels.
It is not necessary to use all three versions. Only the versions with some
content will be available in the Main window.</LI>
<LI>
<B><I>score.</I></B> In this section the score is input. There are a number
of different <A HREF="score.html">types of CECILIA scores</A>.</LI>
<LI>
<B><I>orcOut, scoreOut, csoundOut.</I></B> These panes are read-only and
show the orchestra and score files that are actually sent to Csound for
computation. the csoundOut pane show the csound command.</LI>
</UL>
<BR>For the time being, close off all the editor panes, except the stereo
and the score panes. As you can see, a stereo orchestra template has been
filled out in the stereo pane and a short score has been entered
containing a sine wave function table and a single 10 second note.
<BR>
<LI>
Adjust the relative size of the panes by dragging on their name plate on
the top-right side of their pane. You can also solo any given panel.</LI>
<BR>
<BR>Click in the stereo pane. We are now ready to enter our first orchestra.
<B>Note:</B> the regular Csound header specifying sampling rates,
control rate, no. of channels and ksmps, is given in the Main window. However,
like in regular Csound programming, any global definitions can be given
at the top of the orchestra before the first instrument definition.
<BR>
<LI>
For this example, we will program a simple frequency-modulation instrument.
You can type in a <B><I>foscil </I></B>opcode but, more than likely, you
may not remember all the parameters associated with tha particular opcode.
So we will use the <B>opcode-inserter</B> to facilitate our job. In the
stereo pane, command-click or Button-3 on the line where you wish to include
the new opcode. A <I>popup menu<B> </B></I>will appear containing cascades
of all the Csound opcodes. Navigate to the <B><I>Generate</I></B>, then
to <B><I>oscils</I></B> and finally select <B><I>foscil. </I></B>The <B><I>foscil</I></B>
opcode is inserted with all its syntax and parameters. You only need to
replace the variables with appropriate values.</LI>
<BR>
<LI>
Repeat the above procedure to insert a<B><I> linseg</I></B> opcode so we
can control the modulation index of the <B><I>foscil.</I></B></LI>
<BR>
<LI>
Go to the<B> Edit </B>menu and select <B>Colorize syntax</B>. As you can
see, the opcodes are colorized and whenever the mouse travels over a legal
opcode, its syntax is given in the assistance window at the bottom of the
editor window.</LI>
<BR>
<LI>
Now go back and insert tabs between the output variables, the opcodes and
the parameters. Then grab and drag the small blue line just below the pane
buttons. Adjust the beginning and the end of the blue line.</LI>
<BR>
<LI>
Select the foscil opcode by double-clicking on it. When it is highlighted,
under the <B>Edit</B> menu the <B>Help with selected opcode... </B>Netscape
will open up the Csound manual at the correct page.</LI>
<BR>
<LI>
Once you have entered a valid orchestra and a valid score (in the score
pane), bring up the Main window, select DAC (for real-time output) and
press <B>Play. </B>Should you have any errors in your orchestra, the system
will beep and the error will be highlighted in the editor. In fact, you
should try a deliberate error just to check out this feature...</LI>
<BR>
<LI>
Note that<B><I> we did not have to save</I></B> our orchestra and score
in order to hear the computation. This actually saves an enormous amount
of time when testing and developping orchestras ansd scores. We only need
to save once we wish to keep the work we have done.</LI>
</UL>
<BR>
<P>
<HR WIDTH="100%">
<BR>
<LI>
<A NAME="Using"></A><B>Testing, changing... The CECILIA interaction loop.
<FONT SIZE=-2><A HREF="#">top</A></FONT></B></LI>
<P>Developing orchestras and scores in Csound is a process of going back
and forth between adjusting parameters, listening to results, readjusting
until results are satisfactory. CECILIA facilitates this loop by giving
instant access to Csound's rich syntax and allowing instantaneous auditory
feedback from programs. To take full advantage of this optimized loop,
it is recommended that the user:
<BR>
<UL>
<LI>
make use of all <A HREF="short.html">quick-key shortcuts,</A> specially
those for Playing, pausing and stopping computations.</LI>
<LI>
make use of the opcode-inserter</LI>
<LI>
make use of the on-line manual.</LI>
<LI>
make use of CECILIA's interface objects to test the range of effective
parameter values. This is the topic of our <A HREF="tut3.html">next tutorial</A></LI>
</UL>
</UL>
<HR WIDTH="100%">
<BR>
<UL> </UL>
</BODY>
</HTML>
|