Accessible Adventures In Audio Synthesis

This is my attempt to learn about audio synthesis by generating waveforms in the browser.

This experiment requires support for the HTML5 Web Audio API, which your browser does not seem to have.

For more details, check out the GitHub repository.

Pulse Wave

 

I thought it would be easiest to start by recreating the beginning of my experience, as a listener, of interesting electronic audio.

This was the Nintendo Entertainment System (NES). It had two pulse wave generators, and each could be configured to use one of four different duty cycles.

Click (or touch) and drag on the gray waveform pad above to experiment with pulse wave synthesis. The x axis controls the frequency of the pulse wave, while the y axis controls the duty cycle.

A square wave is just a pulse wave with a 50% duty cycle. According to Dean Friedman, it was pioneered by Bob Moog when he invented the modern synthesizer.

Triangle Wave

 

The NES had one triangle wave generator, and it came with a number of limitations. According to NES Audio: Brief Explanation of Sound Channels, it was most frequently used for basslines.

Sine Wave

 

The sine wave is a pure tone, which as I understand it, is the fundamental building block of more complex sounds. In fact, any periodic waveform, including the pulse and triangle waves, can be described as a series of these.

None of the early audio systems I know of produce plain old sine waves. I'm not sure if this is because they're boring, or because pure tones were hard to produce back then, or something else.

Noise

Just a bunch of random numbers, I guess.

Noise has no intrinsic "frequency", it's just a bunch of random numbers. And yet the noise generator in the NES somehow supported 16 different frequencies.

I think this is because running the noise through a filter can be used to effectively remove the higher or lower frequencies from the noise.

The above pad uses something called a FIR filter to remove higher frequencies from noise by effectively "blurring" the audio samples using averaging. It probably isn't how the NES achieved 16 different varieties of noise, but maybe the general idea is similar.

In any case, it looks like noise is mostly used to synthesize percussive sounds.