A naive but generic beat-detection module.
detect = require('beats')(bins[, minSeparation])
Takes an array of
bins, and an optional
minSeparation value which
determines the minimum amount of time between beats for each bin (defaults to
Each bin takes the following options:
// the minimum index to sample in// the frequencies array.lo: 0// The maximum index to sample in// the frequencies array.hi: 512// The minimum volume at which to// trigger a beat for this bin.threshold: 0// the amount by which to decay// the threshold for this bin for// each sampled frame.decay: 0005
result = detect(frequencies[, dt])
Float32Array containing the beats for the current frame: one
element per bin. If an element's value is 0, then there is no beat this frame.
Otherwise, the value will match the average volume of the bin's frequencies.
frequencies is an array of audio frequencies for the current frame.
the amount of time between this frame and the last one - it defaults to 1.
MIT. See LICENSE.md for details.