Recreate Sounds with the Browser-Based Web Audio API

Back in 2012 on the BBC’s Research & Development Blog, Chris Lowis and his team recreated some of the classic early Radiophonic Workshop sounds using JavaScript. They then published their work using the Web Audio API as an interactive tool, allowing users to play with the sounds and study the code.

The four demo sounds the team played with have different backgrounds and offer a range of use-cases. The Ring Modulator box took a recording of a 30Hz sine wave from a tape machine and multiplied it with the signal from a microphone. The demo output is adjustable via a “distortion” control, as well as a speed control which adjusts pitch. This effect was used for Cybermen and Daleks in Dr Who, and users running Google Chrome Canary can use their computer microphone to add their own voice to the mix.

The Wobbulator created a variety of space-like sounds by generating sine waves with a controllable modulator frequency. The team simplified the implementation by adding the OscillatorNode to the Web Audio API, and also added a waveshape switch to allow the production of sine, square, or sawtooth waves. The Radiophonic Workshop created longer compositions by manually splicing tapes together and combining multiple tape machine tracks. Lowis’ Tape Loops demo can create a piece of music by adjusting the playback speed of the tapes to allow “beat-matching.”

The final demo is the Gunfire Effects Generator, based on the block diagram from the BBC Engineering Monograph. It supplies a buffer containing a burst of white noise, which is gated and filtered, with an allowance for reverb to simulate the sound profile it would make in a small room. It includes instructions on how to create a customized white-noise generator using ScriptProcessorNode. Lowis and his team are hoping that their code will encourage developers to take an interest in audio on the web.

Be sure to read the next Audio article: Bose Releases SoundTouch Developers API

Original Article

Audio on the Web - Explore the BBC sound of the 1960s