COURSE NOTES 7
Localization, Reverberation and Speech Synthesis

Localization

Localization Cues

Localization through Varying Intensity

Example

Localization in Csound

instr 1
k1          linseg 0, p3, 1
a1          oscil p4, p5, 2
a2,a3,a4,a5 pan a1, k1, k1 3
            outq a2, a3, a4, a5
endin

f2 0 2048 10 15 0 5 0 3
f3 0 8193 -8 0 819 .122 819 .294 819 .517 819 .769 819 1 819 1.154 819 1.207 819 1.176 819 1.098 822 1

Other Localization Techniques

Reverberation

Echo (delay) in Csound

instr 1
k1 linseg 0, p3*0.1, p4, p3*0.9, 0
a1 oscil k1, p5, 1
a2 delay a1, p3*0.5
   outs a1, a2
endin

Comb Filter

Example

AllPass Filter

Reverberation in Csound

instr 1
; p4 = amp, p5 = pitch, p6 = reverb time in seconds
k1 linseg 0, p3*.1, p4, p3*.9, 0
a1 oscil k1, p5, 1
a2 comb a1, p6, .0297	; .0297 is loop time
a3 comb a1, p6, .0371
a4 comb a1, p6, .0411
a5 comb a1, p6, .0437
a6 = a2 + a3 + a4 + a5
a7 alpass a6, .09683, .005
a8 alpass a7, .03292, .0017
a9 reverb a1, p6	; reverb is same as comb/alpass combination
   outs a8, a9
endin

Speech Synthesis

Types of Excitation Sources

Voiced Speech

Unvoiced Speech

Speech Synthesis Example in Csound

; speech synthesis of /A/ (as in "hot")
; p4 = note amp
instr 1
iformant1 = 730
iformant2 = 1090
iformant3 = 2440
k1 linseg 0, .1, p4, p3-.2, p4, .1, 0
a1 buzz k1, 10, (sr/2)/10, 1
a2 reson a1, iformant1, 0.05*iformant1
a3 reson 0.5*a1, iformant2, 0.04*iformant2
a4 reson 0.33*a1, iformant3, 0.03*iformant3
   out a2+a3+a4
endin

f1 0 8192 10 1

COURSE INFORMATION | HOMEWORK ASSIGNMENTS
COURSE PROJECT | CS240 HELP DESK