Keith Hamel's Csound Course

Week 2

In this tutorial:


Index Next Week


Introduction to Csound

Csound is an implementation of Csound on the Macintosh PowerPC computer. Csound was first developed at M.I.T. in the late 1970's and has been gradually added to and enhanced since then. It is a programming language designed for non-realtime sound synthesis. For creating digital sound from scratch, it is a very comprehensive and open-ended environment, but also somewhat awkward and at times confusing. (You will find parts of the manual particularly baffling). The PPC implementation of Csound attaches a Macintosh user interface to the program and simplifies the file organization. During the week you should read the Beginning Tutorial chapter in the Csound manual.

goto top Index


Programs used in creating music with Csound

Csound:

The Csound application should be located on the desktop (it has a Mondrian style icon). When you want to use the Csound application, simply double-click on the Csound icon.

BBEdit:

In order to use Csound, you will need a text editor to create and edit all the files necessary to create your sounds. These files are the orchestra file (extension .orc), and the score file (extension .sco) - Csound creates a sound file or files, usually aiff files that can be played with a number of programs (PlayAiff, for example). N.B. Changes you make to files in the Edit application are not saved until you select save (Command-s) from the menu. Whenever you make changes to a score or orchestra file, you must save your files before returning to the Csound program. If you don't, the previous version of these files will be used by Csound.

PlayAiff:

PlayAiff is a small application used to listen toAIFF sound files once they have been created in Csound. An editor, such as SoundEdit 16 can be used to cut, paste, modify and mix sounds files.

goto top Index


Using Csound

;**********************ORCHESTRA FILE *************************
 
sr = 22050.0
kr = 2205.0
ksmps = 10.0
nchnls = 2

;************************************************************ 

instr 1

  kctrl   line    10000, p3, 0            ; ramp envelope
  asig    oscil   kctrl, cpspch(p5), 1    ; sine wave oscilator
  outs    asig * 1, asig * 0              ; output to left channel only

endin

;************************************************************

instr 2

  kctrl   line    10000, p3, 0            ; ramp envelope
  asig    oscil   kctrl, cpspch(p5), 2    ; sine wave oscilator
  outs    asig * 0, asig * 1              ; output to right channel only

endin

;******************** END OF ORCHESTRA ********************** 



;*********************** SCORE FILE **************************

f1  0  512  10  1
f2  0  512  10  1 0 .4 0 .25 0 .1

;     st     dur  --   pitch
i1    0     .5    0    8.00
i1    .5    .5    0    8.02
i1    1.0   .5    0    8.04
i1    1.5   .5    0    8.05
i1    2.0   .5    0    8.07
i1    2.5   .5    0    8.09
i1    3.0   .5    0    8.11
i1    3.5   .5    0    9.00

e



SECTION 1:
new alloc for instr 1:
B 0.000 .. 0.500 T 0.500 TT 0.500 M: 9981.1 9981.1 
B 0.500 .. 1.000 T 1.000 TT 1.000 M: 9990.29990.2 
B 1.000 .. 1.500 T 1.500 TT 1.500 M: 9987.9 9987.9 
B 1.500 .. 2.000 T 2.000 TT 2.000 M:9990.2 9990.2 
B 2.000 .. 2.500 T 2.500 TT 2.500 M: 9990.2 9990.2 
B 2.500 .. 3.000 T 3.000 TT3.000 M: 9978.9 9978.9 
B 3.000 .. 3.500 T 3.500 TT 3.500 M: 9987.9 9987.9 
B 3.500 .. 4.000 T4.000 TT 4.000 M: 9972.1 9972.1 
end of score.     
overall amps: 9990.2 9990.2
overall samples out of range:     0     0
0 errors in performance
44 8192-byte soundblks written to ass2.snd (shorts) 


goto top Index


Suggested Assignment

HINT: Leave space for the rests. The first instrument line might will look something like:

 
i1  0.25  .25  10000  8.00

goto top Index Next Week