View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

floatAt it

needs floatAt
//___floatAt #1
(
#{
	var funcs, table, mx;
	table = Wavetable.chebyFill(512, [0.2, 0.2, 1]);
	funcs = [
		{ arg freq, phase, amp;
			Mix.ar(SinOsc.ar(freq*[1, 1 + 0.02.rand], phase, amp))
		},
		{ arg freq, phase, amp;
			SyncSaw.ar(freq/2, freq/2*phase, amp)
		},
		{ arg freq, phase, amp;
			Osc.ar(table, freq, phase, amp)
		}
		];
	{
	mx = MouseX.kr([0, funcs.size]);
	Spawn.ar({
		var out;
		out = funcs.floatAt(mx.poll,
			MouseY.kr([100, 300]),
			SinOsc.kr(Line.kr(40.rand, 0, 3.0.rand), 0, pi.rand),
			SinOsc.kr(Line.kr(40.rand, 0, 3.0.rand), 0, 0.1.rand, 0.1.rand2).max(0)
			);
		Pan2.ar(out, 1.0.rand2)* EnvGen.kr(Env.linen(0.2, 0.5, 0.8))
		}, 2, 0.5)
	}.play;
}.send;
)


//___floatAt #2
(
#{
	var funcs, controls, table, mx, my;
	table = Wavetable.chebyFill(512, [0.2, 0.2, 1]);
	funcs = [
		{ arg freq, phase, amp;
			Mix.ar(SinOsc.ar(freq*[1, 1 + 0.02.rand], phase, amp))
		},
		{ arg freq, phase, amp;
			SyncSaw.ar(freq/2, freq/2*phase, amp)
		},
		{ arg freq, phase, amp;
			Osc.ar(table, freq, phase, amp)
		}
		];
	controls = [
		Pseq([Pshuf([0.1, 0.1, 0.1, 0.5, 8], 4)], inf).asStream,
		{ Line.kr(40.rand, 0, 3.0.rand) },
		0.1,
		5,
		{ SinOsc.kr(5, 0, 0.6, 0.8) }
		
		];
	{
	mx = MouseX.kr([0, funcs.size]);
	my = MouseY.kr([0, controls.size]);
	Spawn.ar({
		var out;
		out = funcs.floatAt(mx.poll,
			controls.floatAt(my.poll)*200+100,
			SinOsc.ar(controls.floatAt(my.poll), 0, pi.rand),
			SinOsc.kr(controls.floatAt(my.poll), 0, 0.1.rand, 0.1.rand2).max(0)
			);
		Pan2.ar(out, 1.0.rand2)* EnvGen.kr(Env.linen(0.2, 0.5, 0.8))
		}, 2, 0.5)
	}.play;
}.send;
)


//___floatAt #3
(
#{
	var funcs, controls, table, mx, my;
	table = Wavetable.chebyFill(512, [0.2, 0.2, 1]);
	funcs = [
		{ arg freq;
			Mix.ar(SinOsc.ar(freq*[1, 1 + 0.02.rand], 0, 0.1))
		},
		{ arg freq;
			SyncSaw.ar(freq/2, freq/3, 0.1)
		},
		{ arg freq;
			Osc.ar(table, freq, 0, 0.1)
		}
		];
	controls = [
		0.1,
		Pseq([Pshuf([0.1, 0.1, 0.1, 0.5, 1], 4)], inf).asStream,
		Pseq([0, 0, 1], inf).asStream,
		Pseq([0, 0, 1, 0, 0.5], inf).asStream
		
		];

	{
	var diff;
	mx = MouseX.kr([0, funcs.size]);
	my = MouseY.kr([0, controls.size]);
	diff = 3.0.rand;
	Spawn.ar({
		var out, c, amp;
		c = controls.floatAt(my.poll);
		amp = controls.floatAt(my.poll+diff)*4;
		out = funcs.floatAt(mx.poll, c*200+100);
		Pan2.ar(out, (c*mx.value*2-1).wrap2(-1.0, 1.0), amp) * EnvGen.kr(Env.perc(0.02, 0.2))
		}, 2, 0.1)
	}.play;
}.send;
)







Links to this Page