-
Csound Programming and the CECILIA file
structure. top
CECILIA is a highly efficient Csound programming environment.
Some of the tools to make the job easier and more productive:
-
Text-editor optimized for Csound coding
-
Full on-line Csound manual
-
Orchestra and Score Opcode inserters
-
Quick syntax checker
-
Full in-text error reporting
-
Service functions for soundfile information
-
Colorized and tabulated syntax
-
Unified (orc & sco) document structure
-
Comprehensive Search and Replace facilities.
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.
-
Making a simple orchestra and score top
-
Start CECILIA. Start Netscape.
-
Under the File menu in the Main window, select New... and
then Module...
The CECILIA editor 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:
-
info. In this section, the author can enter any relevant
information about what this particular module does. This information can
be displayed by selecting the About this module... menu in the grapher
window when the module is saved and recalled.
-
tk_interface. 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 third tutorial deals
with this.
-
mono, stereo, quad. 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.
-
score. In this section the score is input. There are a number
of different types of CECILIA scores.
-
orcOut, scoreOut, csoundOut. 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.
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.
-
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.
Click in the stereo pane. We are now ready to enter our first orchestra.
Note: 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.
-
For this example, we will program a simple frequency-modulation instrument.
You can type in a foscil opcode but, more than likely, you
may not remember all the parameters associated with tha particular opcode.
So we will use the opcode-inserter 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 popup menu will appear containing cascades
of all the Csound opcodes. Navigate to the Generate, then
to oscils and finally select foscil. The foscil
opcode is inserted with all its syntax and parameters. You only need to
replace the variables with appropriate values.
-
Repeat the above procedure to insert a linseg opcode so we
can control the modulation index of the foscil.
-
Go to the Edit menu and select Colorize syntax. 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.
-
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.
-
Select the foscil opcode by double-clicking on it. When it is highlighted,
under the Edit menu the Help with selected opcode... Netscape
will open up the Csound manual at the correct page.
-
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 Play. 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...
-
Note that we did not have to save 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.
-
Testing, changing... The CECILIA interaction loop.
top
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:
-
make use of all quick-key shortcuts, specially
those for Playing, pausing and stopping computations.
-
make use of the opcode-inserter
-
make use of the on-line manual.
-
make use of CECILIA's interface objects to test the range of effective
parameter values. This is the topic of our next tutorial