RedLbyl look before you leap
Inherits from: Filter
an implementation of Matt Wright's MaxMSP object [lbyl].
it can be used for filtering sensor data as well as removing clicks in audio signals.
*kr(in, thresh, samples)
*ar(in, thresh, samples)
in - signal to be filtered.
thresh - threshold. (tolerance).
samples - number of samples that must be received before making the jump. (quota).
lbyl(in, thresh, samples)
language side
//--
s.boot;
b= Buffer.sendCollection(s, [0.1, 0.1, 0.1, 1, 0.2, 0.2, 0.2, 1, 1, 0.3, 0.3, 0.3, 0.3, 1, 1, 1, 0.4, 0.4, 0.4, 0.4])
{a= PlayBuf.kr(1, b); [a, RedLbyl.kr(a)]}.plot(0.03)
{a= PlayBuf.ar(1, b); [a, RedLbyl.ar(a)]}.plot(0.0005)
b.free;
//--
{SinOsc.ar(RedLbyl.kr(MouseX.kr(400, 4000, 'exponential'), 20, 300), 0, 0.5)}.play
{a= Dust.ar(5); [a, RedLbyl.ar(a, 0.1, 2)]}.play //no clicks above 0.1 or below -0.1 in right chan
{a= LFPulse.ar(2, 0, MouseX.kr, 0.5); SinOsc.ar([400, 404], 0, [a, RedLbyl.ar(a, MouseY.kr, 5000)])}.play
//--
b= [0.1, 0.1, 0.1, 1, 0.2, 0.2, 0.2, 1, 1, 0.3, 0.3, 0.3, 0.3, 1, 1, 1, 0.4, 0.4, 0.4, 0.4]
a= RedLbyl.new
b.do{|x| [x, a.lbyl(x)].postln}; ""