BeatTracking | API Document

    import BeatTracking from 'music-tempo/src/BeatTracking.js'

public class | source

# BeatTracking

Performs automatic beat tracking

## Static Method Summary

Static Public Methods
public static | trackBeat(events: Array, eventsScores: Array, tempoList: Array, params: Object): Array Perform beat tracking on a array of onsets |

## Static Public Methods

### public static trackBeat(events: Array, eventsScores: Array, tempoList: Array, params: Object): Array source

Perform beat tracking on a array of onsets

#### Params:

Name | Type | Attribute | Description
events | Array |  | the array of onsets to beat track
eventsScores | Array |  | the array of corresponding salience values
tempoList | Array |  | the array of tempo hypothesis
params | Object | optional default: {} | parameters
params.initPeriod | Number | optional default: 5 | duration of the initial section
params.thresholdBI | Number | optional default: 0.02 | for the purpose of removing duplicate agents, the default JND of IBI
params.thresholdBT | Number | optional default: 0.04 | for the purpose of removing duplicate agents, the default JND of phase
params.expiryTime | Number | optional default: 10 | the time after which an Agent that has not accepted any beat will be destroyed
params.toleranceWndInner | Number | optional default: 0.04 | the maximum time that a beat can deviate from the predicted beat time without a fork occurring
params.toleranceWndPre | Number | optional default: 0.15 | the maximum amount by which a beat can be earlier than the predicted beat time, expressed as a fraction of the beat period
params.toleranceWndPost | Number | optional default: 0.3 | the maximum amount by which a beat can be later than the predicted beat time, expressed as a fraction of the beat period
params.correctionFactor | Number | optional default: 50 | correction factor for updating beat period
params.maxChange | Number | optional default: 0.2 | the maximum allowed deviation from the initial tempo, expressed as a fraction of the initial beat period
params.penaltyFactor | Number | optional default: 0.5 | factor for correcting score, if onset do not coincide precisely with predicted beat time

#### Return:

Array | agents - agents array