Next post: Code Tidbits

Audio Experiments!

This program is a little interactive demo of "audio experiments" I came up with. My goal here was to create interesting sounds, experiment with FFTs, and test my digital audio code.

Have you ever played with video feedback, where when you tilt the camera the picture spirals and twists? When experimenting with audio code, I invented an effect that I like to think of this as the audio analog of those spirals. In this case, the song spirals out of control and degenerates into interesting noise. What you hear is like the sum of the song and many slower versions of itself. Play with the parameters - the "right" settings seem to be dependent on the clip you choose.

Hear an example:



I also made "Frequency Sketch" -- where you can draw shapes and curves, and then hear the results as audio. Last semester I took a course in Signals and Systems - most of the course dealt with signals in the context of voltage and current, but I wanted to apply what I had learned to audio. In this experiment, you can draw in the frequency domain, and hear the result! I've wanted to try something like this for a while.

Microsoft Paint is the user interface for Frequency Sketch :). If you draw red pixels or lines on "input.png", you can hear the results. For example, drawing one red dot creates one sine wave, and so you will hear one pitch. The x-axis (in blue) is the frequency in Hz. If there is more than one red pixel in a column, the highest red pixel is chosen. It tends to create ambient, wind-like, flute-like, and eerie siren noises, but this is just the beginning.



All of this was accomplished in a few days - using a library of digital audio code I've been working on for the past few weeks. I created a project in C# called CsWaveAudio; features include saving and opening wave files, synthesizing sounds, FFT, and certain effects. I chose to store samples in memory as doubles between -1.0 and 1.0. This makes it much easier to do calculations - and when writing effects you don't need to consider whether you are in 8-bit or 16-bit. The library also includes code for some "instruments" made from adding sine waves.

Links:
Hear an example:
Library source code (27k zip)