Awesome Open Source
Awesome Open Source

I Dropped My Phone The Screen Cracked

I Dropped My Phone The Screen Cracked is a web audio library that uses method chaining and CSS-style selectors to simplify creating, configuring and connecting audio nodes in the browser. Here's hello world:

//create and connect sine and system out. start the sine

and a slightly more complex example:

//create and connect a sine oscillator (frequency of 180), lowpass,
//compressor and system output (level of .5).

//select the sine using its type and change the detune to 10

//use the id to get a reference to the lowpass
//filter and set the frequency to 600

//create and connect a sawtooth oscillator, waveshaper & compressor
//and connect the compressor to the existing dac we created above.

//change the ratio of both compressors to 12

//start the sine and the sawtooth

Audio node chains can be encapsulated as units using macros

//define a simple macro named "microsynth"

//change the frequency of the sine

//start it up

and macros can be wrapped in simple factory functions to create plugins, making it possible to instantiate instances, connect them to other nodes, address them individually or as a group, nest them within other macros, etc.

//define a plugin called microsynth
cracked.microsynth = function(params) {
    //pass any params to begin() so they can associated with the instance
    //return cracked so we can chain methods
    return cracked;

//create two instances with different ids

//change the frequency in the first
//change the frequency in the second

//set the gain in both and start them

Generally, the goal of I Dropped My Phone The Screen Cracked is simplicity, brevity without obscurity and making audio coding as intuitive as patching a modular, so that noise makers can focus on keeping it weird and fun.

If you're interested in knowing more, there's a one page overview, full source documentation, a Reddit interview, some press, and a useful app for Mac or Linux to try it all out.

Also cat pictures.

If you'd like to contribute, you can send a comment to [email protected], open an issue for bugs or feature enhancements or best of all, submit a pull request.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (67,985
music (566
synthesis (44
web-audio (39
music-library (31
audio-library (20
html5-audio (16

Find Open Source By Browsing 7,000 Topics Across 59 Categories