Class: Kick

Kick

Find a kick from the sensors values. The module must be connected to the output of the Intensity operator. The module outputs when a kick is found.

Constructor

new Kick(optionsopt)

Parameters:
Name Type Attributes Description
options Object <optional>

Override default options.

Properties
Name Type Attributes Default Description
filterOrder Number <optional>
5

Buffer size of the internal median filter.

threshold Number <optional>
0.01

Delta intensity threshold above which to trig a kick.

minInter Number <optional>
0.2

Minimum interval between successive trigs in seconds.

Source:
Example
import * as lfo from 'waves-lfo';
import * as lfoMotion from 'lfo-motion';

const sensors = new lfoMotion.source.MotionInput();
const intensity = new lfoMotion.operator.Intensity();
const kick = new lfoMotion.operator.Kick();
const bridge = new lfo.sink.Bridge({
  processFrame: frame => {
    if (frame[0] === 1)
      // do some cool stuff
      console.log('kick');
  }
});

sensors.connect(intensity);
intensity.connect(kick);
kick.connect(bridge);

sensors.init().then(() => sensors.start());