Lecture 6
More on filters, Vocoder, LPC, Granular Synthesis
Lecture Slides
A series of gif images of the lecture slides... (sorry, only accesible from within Stanford University)
More on filters
FIR and IIR filters, comparison and basic concepts. To ways to use filters: the vocoder and the LPC techniques.
Granular Synthesis
Overview of granular synthesis techniques.
Examples
Here's a simple granular synthesis instrument in clm (grani.ins).
Here is the header of the instrument and a short description of its parameters:
(definstrument grani (start-time duration amplitude file
&key
(amp-envelope '(0 0.3 1 0.7 1 1 0))
(grain-envelope '(0 0 0.3 1 0.7 1 1 0))
(grain-duration 0.1)
(grain-hop 0.2)
(grain-hop-spread 0.05)
(in-file-srate 1.0)
(in-file-start 0)
(in-file-hop 0.2)
(in-file-hop-spread 0.05)
(degree 45)
(distance 1)
(reverb-amount 0.01))
Mandatory parameters
- start-time
- starting time in seconds
- duration
- duration of the note in seconds
- amplitude
- amplitude of the note
- file
- the complete pathname of the soundfile you want to use as source material
Optional parameters
- amp-envelope
- amplitude envelope for the whole note
- grain-envelope
- amplitude envelope for an individual grain
- grain-duration
- duration of each individual grain
- grain-hop
- distance in seconds between grains (can be smaller than the grain-duration)
- grain-hop-spread
- maximum random component in seconds added to the grain-hop
- in-file-srate
- sample rate conversion factor for the input file
- in-file-start
- position in seconds in the input file where to start getting samples
- in-file-hop
- distance in seconds between starts of grains in the input file
- in-file-hop-spread
- random component added to the distance in seconds between starts of grains
- degree
- angle in degrees from where the sound is coming from in a stereo rendition. "0" is left and "90" is right; "45" is right in the middle of the stereo field.
- distance
- distance in feet from where the sound is coming from.
- reverb-amount
- amount of reverberation added to the sound. For this to work you must have a reverberator loaded and the with-sound call has to specify it.
Some examples...
- Just a silly stuttering gong:
(with-sound()(grani 0 8 2 "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/small-gong.snd"))
- Smaller grains:
(with-sound()(grani 0 8 2 "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/small-gong.snd" :grain-duration 0.06 :grain-hop 0.045 :grain-hop-spread 0.008 :in-file-hop 0.05 :in-file-hop-spread 0.001))
- Smaller grains, downsampled by a 0.3x factor:
(with-sound(:statistics t)(grani 0 8 2 "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/small-gong.snd" :grain-duration 0.06 :grain-hop 0.045 :grain-hop-spread 0.008 :in-file-hop 0.05 :in-file-hop-spread 0.001 :in-file-srate 0.3))
- Smaller grains, downsampled by a 0.3x factor. Note that we change the position were we start sampling the input file and create a big spread there so that we are actually jumping around randomly:
(with-sound(:statistics t)(grani 0 8 2 "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/small-gong.snd" :grain-duration 0.06 :grain-hop 0.07 :grain-hop-spread 0.04 :in-file-hop 0.05 :in-file-hop-spread 0.9 :in-file-srate 1.5 :in-file-start 2.6))
- Three notes spread in the stereo field:
(with-sound(:channels 2 :statistics t)
(grani 0 8 4 "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/tubular-bell.snd"
:grain-duration 0.06 :grain-hop 0.05 :grain-hop-spread 0.02
:in-file-hop 0.05 :in-file-hop-spread 0.6 :in-file-srate 1 :in-file-start 2)
(grani 0 8 4 "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/tubular-bell.snd"
:grain-duration 0.08 :grain-hop 0.06 :grain-hop-spread 0.02
:in-file-hop 0.05 :in-file-hop-spread 0.3 :in-file-srate 1.1 :in-file-start 2.6
:degree 0)
(grani 0 8 4 "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/tubular-bell.snd"
:grain-duration 0.05 :grain-hop 0.03 :grain-hop-spread 0.02
:in-file-hop 0.05 :in-file-hop-spread 0.5 :in-file-srate 0.9 :in-file-start 1.6
:degree 90))
Try replacing the turkish-cymbal-1.snd soundfile instead of the tubular-bell...
Assignment
Use the "grani" granular synthesis instrument for processing (ie: mangling) input soundfiles. Create some interesting transformations on the input. Make soundfiles sing and or sttttttutttter. There are some soundfiles available for use (or you can roll your own). You can find a small gong in "/Web/Info/CCRMA/Courses/220a/Lectures/6/Sounds/small-gong.snd", a small cowbell in the same directory, file name "cencerros-1.snd", a cymball and a tubular bell... Have fun!