DANM 220: Week 5, Thursday, 2/07/08

Boulanger's Etude 1, the orchestra file, dissected by ralph
Header section (same for all our csound projects)


sr 	= 	44100	;;;; sample rate 44.1K for audio output
kr 	= 	4410	;;;; control rate 4410 to conserve compute cycles
ksmps 	= 	10	;;;; 10 samples per control cycle
nchnls 	= 	1	;;;; mono sound output

Instrument section, six instruments using four wavetables.

Definition of instrument 101

	instr  	101		;;;; begin def of instrument 101 (SIMPLE OSCIL)
a1   	oscil   10000, 440, 1 	;;;; simple sine wave written to a1 (see NOTE)
       	out      a1 		;;;; a1 sent to output
	endin			;;;; end def of instr 101

NOTE: The syntax for the "oscil" opcode (from the Csound Dictionary) is:

output, opcode, args
so here the output is sent to a wavetable, a1. The args are:
ampl, freq, and input wavetable number,
so here the amplitude is 10,000, the frquency is 440 cps (A above middle C), and the input is to be taken from wavetable f1, created by the top section of the score file.

Definition of instrument 102

	instr   102	;;;; begin instr def 102 (FM oscil)
a1   	foscil 	10000, 440, 1, 2, 3, 1 ;simple 2 operator fm opcode ;;; see NOTE
	out     a1
	endin		;;;; end instr def 102 (FM oscil)

NOTE: The args for the "foscil" opcode (from the Csound Dictionary) are

xamp, kcps, xcar, xmod, kndx, and ifn
so here the amplitude is 10,000 and the carrier (base) frequency is ( kcps * xcar ) = 440 * 1 = 440 as above, and the modulating frequency is ( kcps * xmod ) = 440 * 2 = 880. The index of modulation (read about this in the chapter on FM synthesis) is 3, and ifn (the wavetable) is f1 as above).

Definition of instruments 103-106 (not dissected)


	instr   103
a1   	buzz   	10000, 440, 10, 1  ;variable pulse train
        out     a1
	endin

	instr   104					
a1 	pluck 	10000, 440, 440, 2, 1   ;karplus-strong plucked string
	out 	a1
	endin

	instr 	105
a1 	grain 	5000, 440, 55, 5000, 10, .05, 1, 3, 1  ;asynchronous granular synthesis
	out 	a1
	endin
		
	instr 	106					
a1 	loscil  10000, 440, 4  ;sample-based looping oscillator
	out 	a1
	endin

Revised by Ralph, 07 February 2008