Cracked Documentation examples/selector.html

Type

//create a bunch of sines __().sine(440); __().sine(554.37); __().sine(659.26); __().sine(880); //select all the sines and connect them all to the dac __("sine").dac(.5).play(); //use jquery to bind to events from the slider $("input[type='range']").bind("input",function(evt){ if(evt && evt.target) { //change the detune of the all the sines in one go __("sine").detune(evt.target.value); } });
Detune

//staggered delays & lowpass fitlers in parallel __().delay(1).lowpass(330); //one sec __().delay(2).lowpass(660); //two __().delay(3).lowpass(1220); //three __().delay(4).lowpass(1800); //four //set all the delay feedbacks to 0 __("delay").feedback(0); //create a sine and connect them to the delays //and then connect the lowpass all delays to the dac __().saw(3600).connect("delay"); __("lowpass").dac().play();

Class

//these sines have the classname "foo" __().sine({frequency:440,class:"foo"}); __().sine({frequency:554.37,class:"foo"}); //these have a classname "bar" __().sine({frequency:659.26,class:"bar"}); __().sine({frequency:880,class:"bar"}); //select all the sines, connect them to the dac //and start them playing __("sine").dac(.5).play(); //use jquery to bind to events from the slider $("input[type='range']").bind("input",function(evt){ if(evt && evt.target) { //change the detune of the two "foo" sines __(".foo").detune(evt.target.value); } }); //use jquery to bind to events from the slider $("input[type='range']").bind("input",function(evt){ if(evt && evt.target) { //change the detune of the two "bar" sines __(".bar").detune(evt.target.value); } });
Detune Foo Detune Bar

Id

//parallel delays- all delay times set to 0 __().delay({id:"d1"}); __().delay({id:"d2"}); __().delay({id:"d3"}); __().delay({id:"d4"}); //set all the delay feedbacks to 0 using ids __("#d1,#d2,#d3,#d4").feedback(0); //use ids to address the delays __("#d1").time(1); //set the delay time to 1 __("#d2").time(2); //2 __("#d3").time(3); //3 __("#d4").time(4); //4 //create an lfo & sine and connect them to the delays //and then connect the all delays to the dac __().lfo({frequency:2.5,gain:25}).sine(180).connect("delay").dac().play();