Thursday, January 3, 2013

Start to Finish: A Story of Resampling

Resampling is such a wonderful concept. The idea of taking an audio stem, processing it, processing it again, and then again (and so forth) is a very attractive one to me, since you are not constricted by how much RAM you have. All you need is a fast enough CPU to render things offline in a decent amount of time.




Using (mostly) csound for processing audio files, I tried doing some resampling myself, and I was quite pleased with the end results. This recording below shows the sound in the various phases of development:


Here were the steps involved:

Step 0: Create an instrument:
I made a very simple Karplus-Strong instrument in csound using the pluck opcode. This instrument was sampled and converted to a Milkytracker *.xi instrument using a tool I wrote.

Step 1: Sequence a melody:
Using my sampled csound instrument, I wrote out a short melody inside of milkytracker. 

Step 2: Render the sequence:
The melody sequenced in milkytracker was converted to a csound score file using a tool I wrote. This score file was then rendered in csound to create a high-quality version of the sequence.

Step 3: Reverse
The audio file from Step 2 is then reversed using a free command-line utility called sox.

Step 4: Reverb
The reversed melody is put through reverb in Csound using the reverbsc opcode. The audio file is extended to preserve the massive reverb tail.

Step 5: Waveset
The reverbed audio file is sent through Csound again, this time using the waveset opcode. This opcode timestretches the audio by looping a waveform at two zero crossing points N number of times.


The big picture:
This little experiment is was a product of a little tool I'm working on called SoundPipe, which will be a perl module that will allow you to create scripts that will non-destructively resample audio files. A little bit like SoundHack, only more DSP options using Csound...