Random Control Wave Program


so, I needed a way to modulate an effect that was being applied to a .wav file. The modulation needed to be "sort of" random, and needed to vary smoothly over time (i.e. not varying in chunky discrete increments). I hit on the idea of encoding the modulation signal into another .wav file, the same length as the .wav I was modifying. The program "random_control_wave" is the result: The user is prompted for a filename, a file length in seconds, how often the random value should change (in hertz--think "sample-and-hold" frequency, sampling white noise), and how smooth to make the result.

The image at left shows a resulting .wav file, viewed in a audio editing program. The right channel is the original, "stepped" random signal, and the left channel is the "smoothed" version. Most of the programs I wrote to use this type of encoded .wav just use the left channel.

The resulting .wav file is certainly playable, tho it won't sound like much. You'll hear some clicking in the right channel, but that's about it.

Back to program list