sean's final project ::: granular synthesis in ChucK
granular synthesis is a type of audio synthesis that functions by dissolving a sampled waveform into several microchunks--called grains--that are then reassembled to form an altogether different sound. grains often have durations of 1 to 100 ms in length, each capable of transformation as an individual waveform. this ability to operate on a micro-time scale allows for a vast amount of control on the treatment of the sound. (as always, wikipedia is not a bad place to start for some reading.)
what i'm trying to do here
my hope for this project was to build a granular synthesizer from the ground up. luckily, ChucK is readily prepared for this task; both its unit analyzer bank as well as its live sampling unit generator, LiSa, serve as ample tools for both the audio analysis and playback we need. i opted to use LiSa, for no particular reason.
the code is (conceptually) pretty simple: begin by loading a soundfile into a LiSa buffer, then specify what grain you want to pull out and how you want to play it in terms of its duration, position in the buffer, rate of playback (pitch) and how hard/soft you'd like attack and decay. the code will interpolate (and loop) through the soundfile, pulling and grains and reassembling soundforms according to these specified conditions. what gets interesting, however, is when a bit of randomness is involved: each of these parameters has an accompanying scatter value that significantly affects the sound's output. it is easy to get creative quickly with these. for instance, a scatter value for grain length that is larger than the base grain length value introduces the possibility to travel backwards in the file-- if grainlen=20ms, and grainlen_scatter=80ms, there is a coded possibility that the next grain pulled will reach 60ms backwards in the soundfile.
in addition to hardcoded values for these parameters, considerably further expression can be found with dynamic control of these values. unfortunately, i quite flatly ran out of time for a proper interface. what i was able to add was a bit of control via the laptop's tilt. in "standard mode" (default), the x-axis tilt contributes for more randomness in grain length, and the y-axis more variation in grain pitch. by hitting capslock, however, the patch enters a "scrub mode" where the y-axis rigorously controls playback position while the x-axis controls a scatter value for this position. in other words, grains will be pulled only from where you have tilted the laptop to on the y-axis, plus or minus the value taken from the x-axis. while this is by no means a fully useful tool (oh how nice it would've been if i could've just gotten a few sliders to work!), it's a start (and fun to play with).
a few examples
no video (sadly) but a few (pretty lame) audio clips showing different effects.
things i really, really want to add
- a gui (obviously)
- sliders controlling base and scatter values, button indicating mode, more modes, etc.
- a "jitter" delay
- more randomness: a feedback-based delay that draws from another LiSa buffer that is recording what has already been played
- also controlled with random parameters
- lots of little micro-editing things
- grain panspread
- basic filtering tools
- fix my LiSa setup to accept 2+ channels (currently only mono works)
- fix everything to make it more user-friendly (including me-friendly)
- polish the code in general
how to run
- download granulator.ck
- put your MONO (important) soundfile, .wav format, in the miniAudicle directory
- open granulator.ck in the miniAudicle
- change the path as indicated at the top of the code
- tweak settings and shred 'er up