// modulate everything

(

{

Bend({ |in|

in * LFDNoise3.kr(MouseX.kr(0.1, 200, 1), 0.1, 1)

}, {

Splay.ar(SinOsc.ar({ exprand(300.0, 10000.0) } ! 17, 0, { 1.0.rand } ! 17))

}) * 0.1

}.play

)


// basic test

{ Bend.time(MouseX.kr(-2, 2), { SinOsc.ar(656, LFPar.ar(12000)) * LFSaw.ar([70, 37]) }) * 0.1 }.play;



(

// time warped analog bubbles, time scale is mouse x position

{

Bend.time(MouseX.kr(0.02, 20, 1), {

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 4) // echoing sine wave

})

}.play)


(

// random bent analog bubbles, probablity of a bend is 0.6, intensity is mouse x position

{

Bend.new({ |x| if(0.6.coin) { x * MouseX.kr().exprange(rrand(0.01, 10), rrand(0.01, 10)) } }, {

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 4) // echoing sine wave

})

}.play)



(

// bend all numerical values by adding controls

Ndef(\bubbles, {

var index = 0;

Bend({ |original|

[original, original.isNumber, index].postln;

if(original.isNumber) {

original = NamedControl.kr("bend_"++index, original);

index = index + 1;

};

original;

}, {

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 4) // echoing sine wave

})

}).play)



Ndef(\bubbles).gui(20);



// "analog" bend: pass in bendFunc directly

(

{ 

var bypass = 1 - MouseButton.kr; // press mouse button to bypass

Bend({ |original, argName, ugen|

var res = original;

argName.postln;

if(#[\freq, \delaytime].includes(argName)) { 

res = res * LFNoise2.kr(0.4, bypass * 0.1, 1) 

};

if(original.rate == \audio) { 

res = res + BPF.ar(PinkNoise.ar(bypass * 0.04), Rand(200, 10000), 0.1) 

};

res

}, {

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23]/10, 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 4) // echoing sine wave

});

}.play;

)




(

// circuit bent analog bubbles, bend intensity is mouse x position

{

Bend.time(MouseY.kr(0.02, 20, 1), {

CircuitBend.central({

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 0.4) // echoing sine wave

}, 2, MouseX.kr(0.01, 1, 1))

})

}.play

)


(

// circuit bent analog bubbles, bend intensity is mouse x position, combined with time stretch

{

CircuitBend.central({

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 0.4) // echoing sine wave

}, 6, MouseX.kr(0.01, 1, 1))

}.play

)



(

// circuit bent analog bubbles,  bend intensity is mouse x position, bend focus is drifting 

{

CircuitBend.drift({

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 0.4) // echoing sine wave

}, 6, MouseX.kr(0.01, 5, 1), MouseY.kr(0.01, 30, 1))

}.play

)





(

// circuit bent analog bubbles

Ndef(\x, {

CircuitBend.controls({

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 0.4) // echoing sine wave

}, 5)

}).play

)

Ndef(\x).setn(\bend_10_1, {[1, 0].choose} ! 16);

Ndef(\x).setn(\bend_11_1, {[1, 0].choose} ! 16);

Ndef(\x).setn(\bend_10_3, {[1, 0].choose} ! 16);

Ndef(\x).setn(\bend_2_1, {[1, 0].choose} ! 16);


// we need a good gui for finding the good ones.




Ndef(\x).clear;


(

// circuit bent analog bubbles

Ndef(\x, {

CircuitBend.controls1({

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 0.4) // echoing sine wave

}, 5)

}).play

)



Ndef(\x).gui(32);

Ndef(\x).setn(\bend_10_1, {[1, 0].choose} ! 16);

Ndef(\x).setn(\bend_11_1, {[1, 0].choose} ! 16);

Ndef(\x).setn(\bend_10_3, {[1, 0].choose} ! 16);

Ndef(\x).setn(\bend_2_1, {[1, 0].choose} ! 16);



// blend is not tuned yet

(

// circuit bent analog bubbles

Ndef(\x, {

CircuitBend.controls1({

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 0.4) // echoing sine wave

}, 5, blend: true)

}).play

)



(

// circuit bent analog bubbles (blend: true)

{

CircuitBend.drift({

f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function

CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 0.4) // echoing sine wave

}, 6, MouseX.kr(0, 3), MouseY.kr(0.01, 30, 1), blend: true)

}.play

)