Granular Synthesis
Posted: Tue Jan 09, 2018 3:01 pm
A friend in our community asked me to explain about granular synthesis and how my Quilcom Harvester goes about it.
So here’s my brief summary…
Every grain player (wave player) has the whole wave file loaded; all of it.
The bit you want to hear is addressed and read out by the wave player’s index value.
If you start at index=0 and run to index=end, at sample rate, you hear the whole wave file at the original pitch, as recorded.
Now, by setting the index start and end positions to shorter values within the wave file’s range, you can play just a section of the file; a “grain”.
By changing the count rate of the index you alter the pitch.
If you count down instead of up the grain plays backwards.
If you keep a constant range of index values but change the offset, and keep repeating the grain, you can scan the file faster or slower than the original recorded time. For example the index could go from 100 to 200 then the next cycle would be 101 to 201, then 102 to 202 and so on. In this example it would take 100 cycles to completely move on to 200-300. The pitch would be correct (at the original sample rate) but the speed would be slow.
Granular synthesis comes into its own when you have several grains playing close together, apart, or randomly, as in my Harvester.
Another thing to think about is cross-fading between playing successive grains. This is to avoid clicks on non-zero crossings. I used a sample accurate AHD envelope for this.
For changing the musical pitch (count rate for the index value) you need to interpolate between individual samples since most pitches will involve non-integer values for the index.
------------------------------------------------------------------------------------------------------------------------------
If anyone wants to add to this, or can offer better or different methods, or even ASM optimised stuff, this might become a useful topic for me and others. My intention is to re-visit granular synthesis and/or wavetable synthesis at some point, so any offerings I would greatly welcome.
Cheers
Spogg
So here’s my brief summary…
Every grain player (wave player) has the whole wave file loaded; all of it.
The bit you want to hear is addressed and read out by the wave player’s index value.
If you start at index=0 and run to index=end, at sample rate, you hear the whole wave file at the original pitch, as recorded.
Now, by setting the index start and end positions to shorter values within the wave file’s range, you can play just a section of the file; a “grain”.
By changing the count rate of the index you alter the pitch.
If you count down instead of up the grain plays backwards.
If you keep a constant range of index values but change the offset, and keep repeating the grain, you can scan the file faster or slower than the original recorded time. For example the index could go from 100 to 200 then the next cycle would be 101 to 201, then 102 to 202 and so on. In this example it would take 100 cycles to completely move on to 200-300. The pitch would be correct (at the original sample rate) but the speed would be slow.
Granular synthesis comes into its own when you have several grains playing close together, apart, or randomly, as in my Harvester.
Another thing to think about is cross-fading between playing successive grains. This is to avoid clicks on non-zero crossings. I used a sample accurate AHD envelope for this.
For changing the musical pitch (count rate for the index value) you need to interpolate between individual samples since most pitches will involve non-integer values for the index.
------------------------------------------------------------------------------------------------------------------------------
If anyone wants to add to this, or can offer better or different methods, or even ASM optimised stuff, this might become a useful topic for me and others. My intention is to re-visit granular synthesis and/or wavetable synthesis at some point, so any offerings I would greatly welcome.
Cheers
Spogg