Skip to main content
100%

Sampler using Web Audio

✓ Published0🌍 Public
Aalexmacy
Last edited Nov 15, 2016
Created on Nov 6, 2016

This interactive audio sampler displays a waveform of an imported WAV file and divides it into eight equal sections. Users trigger playback from any section by pressing the corresponding number key or touching the waveform on mobile devices. A red line animates across the waveform to show playback position while the active section highlights in blue. The visualization uses d3.v4 for SVG rendering, transitions, and scales, alongside the Web Audio API for audio decoding and playback. A stop button resets the playback position and highlights.

AI-generated description

This is something I made using the Web Audio API along with d3.js. Lots of credit goes to my friend <a href="http://www.cooperbaker.com/" target="_blank">Cooper Baker</a> because this is like a VERY slimmed-down version of an application he made back when we were in college - I believe it was <a href="http://www.cooperbaker.com/lib/view.php?image=/home/code/maxmsp/files/gallery/images/cuisinart.png" target="_blank">cuisinart</a>. He's got some pretty cool stuff that's definitely worth checking out!

Anyway, you trigger the different cuts using the number keys that correspond with the numbered sections of the loop. Or if you are on a mobile device, touch the section you want to hear. When loading this directly instead of in its <a href="http://bl.ocks.org/alexmacy/raw/5e4b763bf399027de8c110086c74eba0/" target="_blank">own window</a>, you might have to click inside the iframe so that it can detect keystrokes.

Here's an updated version with the ability load more samples and customize the cues: <a href="http://bl.ocks.org/alexmacy/0ecc505b717acc18936284464c4b8185">Web Audio Sampler v2</a>.

mit Licensed

Similar vizzes