// slider with freq and amp control
(
	var strangler;
	var osc;
SynthDef("slidertest2", { arg freq = 440, amp = 0.1, bus = 0, osc = 100, strangler = 100, grain = 100;
	strangler = SinOsc.ar(freq * strangler, 0, freq * grain * LFNoise1.kr(1.reciprocal).abs
	);
	osc = SinOsc.ar((freq * osc) + strangler, 0, amp
	);
	Out.ar(
		bus,
		osc
	)
}).load(s);
)

(
var w, c, d, spec, specd, spece, specf, specg, synthid, strangler, osc;
var str1, str2, str3, str4, str5;
synthid = 1001;
s.sendMsg("/s_new", "slidertest2", synthid, 1, 0);
w = SCWindow("LFNoise Frequency Strangler", Rect(148, 144, 350, 175));
w.view.background = Color.blue;
str1 = SCStaticText(w, Rect(233, 10, 303, 30));
str1.string = "frequency";
str1.font = Font("Futura-Medium", 14);
str2 = SCStaticText(w, Rect(233, 35, 133, 30));
str2.string = "amp";
str2.font = Font("Futura-Medium", 14);
str3 = SCStaticText(w, Rect(233, 65, 303, 25));
str3.string = "oscillator";
str3.font = Font("Futura-Medium", 14);
str4 = SCStaticText(w, Rect(233, 95, 303, 25));
str4.string = "strangler";
str4.font = Font("Futura-Medium", 14);
str5 = SCStaticText(w, Rect(233, 125, 303, 25));
str5.string = "grainy";
str5.font = Font("Futura-Medium", 14);
c = SCSlider(w, Rect(12, 12, 200, 24));
d = SCSlider(w, Rect(12, 40, 200, 24));
e = SCSlider(w, Rect(12, 68, 200, 24));
f = SCSlider(w, Rect(12, 96, 200, 24));
g = SCSlider(w, Rect(12, 124, 200, 24));
spec = ControlSpec.new(20, 200, 'linear', 0, 10);
specd = ControlSpec.new(0, 1, 'linear', 0, 0.1);
spece = ControlSpec.new(1, 55, 'linear', 0, 1);
specf = ControlSpec.new(1, 55, 'linear', 0, 1);
specg = ControlSpec.new(1, 66, 'linear', 0, 1);
c.action = {
	s.sendMsg("/n_set", synthid, 'freq', spec.map(c.value)); 
};
d.action = {
	s.sendMsg("/n_set", synthid, \amp, specd.map(d.value));
};
e.action = {
	s.sendMsg("/n_set", synthid, \osc, spece.map(e.value));
};
f.action = {
	s.sendMsg("/n_set", synthid, \strangler, specf.map(f.value));
};
g.action = {
	s.sendMsg("/n_set", synthid, \grain, specg.map(g.value));
};
c.value = spec.unmap(spec.default);
d.value = specd.unmap(specd.default);
e.value = spece.unmap(spece.default);
f.value = specf.unmap(specf.default);
g.value = specg.unmap(specg.default);
w.onClose = { s.sendMsg("/n_free", synthid) };
w.front;
)