Cracked – methodology chaining/CSS-style selector internet audio library

Cracked – methodology chaining/CSS-style selector internet audio library

I Dropped My Phone The Screen Cracked

I Dropped My Phone The Screen Cracked is a internet audio library that makes use of methodology chaining and CSS-style selectors to simplify creating, configuring and connecting audio nodes within the browser. Here’s hey world:

//create and join sine and system out. begin the sine
__().sine().dac().play();

and a barely extra complicated instance:

//create and join a sine oscillator (frequency of 180), lowpass,
//compressor and system output (stage of .5).
__().sine(180).lowpass({frequency:160,q:5,id:"lp1"}).compressor().dac(.5);

//choose the sine utilizing its sort and alter the detune to 10
__("sine").detune(10);

//use the id to get a reference to the lowpass
//filter and set the frequency to 600
__("#lp1").frequency(600);

//create and join a sawtooth oscillator, waveshaper & compressor
//and join the compressor to the present dac we created above.
__().noticed(800).waveshaper().compressor().join("dac");

//change the ratio of each compressors to 12
__("compressor").attr("ratio",12);

//begin the sine and the sawtooth
__("sine,noticed").begin();

Audio node chains might be encapsulated as models utilizing macros

//outline a easy macro named "microsynth"
__().start("microsynth").sine().acquire().finish("microsynth").dac();

//change the frequency of the sine
__("microsynth").frequency(100);

//begin it up
__("microsynth").begin();

and macros might be wrapped in easy manufacturing facility features to create plugins, making it potential
to instantiate situations, join them to different nodes, handle them individually or as a gaggle,
nest them inside different macros, and many others.

//outline a plugin known as microsynth
cracked.microsynth = perform(params) {
    //cross any params to start() to allow them to related to the occasion
    __().start("microsynth",params).sine().acquire(0).finish("microsynth");
    //return cracked so we are able to chain strategies
    return cracked;
}

//create two situations with totally different ids
__().microsynth({id:"micro1"}).lowpass().dac();
__().microsynth({id:"micro2"}).lowpass().join("dac");

//change the frequency within the first
__("#micro1").frequency(1200);
//change the frequency within the second
__("#micro2").frequency(600);

//set the acquire in each and begin them
__("microsynth").quantity(1).begin();

Generally, the objective of I Dropped My Phone The Screen Cracked is simplicity, brevity with out obscurity and making audio coding as intuitive as patching a modular, in order that noise makers can give attention to holding it bizarre and enjoyable.

If you are eager about realizing extra, there is a one web page overview, full supply documentation, a Reddit interview, some press, and a helpful app for Mac or Linux to strive all of it out.

Also cat footage.

If you’d prefer to contribute, you possibly can ship a remark to [email protected], open an concern for bugs or characteristic enhancements or better of all, submit a pull request.

HI-FI News

by way of Hacker News https://ift.tt/rG8efh6

May 16, 2025 at 05:09AM