[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SCRangeSlider modification
hello
this is a small modification to the Range Slieder
SCRangeSlider now respondes to:
option click to extend the hi range
shift click to extend the lo range
ctrl click to move the entire range up and down // usefull for bandpass filter or sample scanning
Please check it out and put it, if it's ok in the distribution .
all the best Heiko and Nicholas
s.boot; // boot it
(
// define a synth
"bandpass", { arg freqlow = 440, freqhigh = 880;
freqlow = Lag.kr(freqlow);
freqhigh = Lag.kr(freqhigh);
p = RLPF.ar(RHPF.ar(WhiteNoise.ar(0.3),freqlow,0.5),freqhigh,0.5);
Out.ar(0, p);
}).writeDefFile;
s.sendSynthDef("bandpass");
)
(
var spec;
w = SCWindow.new;
s.sendMsg("/s_new","bandpass",1001,0);
r = SCRangeSlider(w, Rect(20,170,180,24));
spec = \freq.asSpec;
r.action = {
s.sendMsg("/n_set", 1001, 'freqlow', spec.map(r.lo));
s.sendMsg("/n_set", 1001, 'freqhigh', spec.map(r.hi));
};
r.lo = spec.unmap(spec.default);
r.hi = spec.unmap(spec.default*2);
w.front;
w.refresh;
)
Nicholas Busssmann
Auguststrasse 10
10117 Berlin
http://www.studiobeige.de
++49-30-47306119