leapjs-plugins
leapjs-plugins copied to clipboard
Filtering plugin/out of the box
cc @nashira @paulmand3l
function LowPassFilter(cutoff) {
var accumulator = 0;
this.setCutoff = function (value) {
cutoff = value;
};
this.sample = function(sample) {
accumulator += (sample - accumulator) * cutoff;
return accumulator;
}
}