Home Reference Source Repository
import TempoInduction from 'music-tempo/src/TempoInduction.js'
public class | source

TempoInduction

Performs tempo induction by finding clusters of similar inter-onset intervals (IOIs)

Static Method Summary

Static Public Methods
public static

calculateScore(clusters: Object, params: Object): {clScores: Array, clScoresIdxs: Array}

Score intervals

public static

createTempoList(clusters: Object, params: Object): Array

Get array of tempo hypotheses

public static

mergeClusters(clusters: Object, params: Object): {clIntervals: Array, clSizes: Array}

Merge similar intervals

public static

processRhythmicEvents(events: Array, params: Object): {clIntervals: Array, clSizes: Array}

Find clusters

Static Public Methods

public static calculateScore(clusters: Object, params: Object): {clScores: Array, clScoresIdxs: Array} source

Score intervals

Params:

NameTypeAttributeDescription
clusters Object

object with clusters

clusters.clIntervals Array

clusters IOIs array

clusters.clSizes Array

clusters sizes array

params Object
  • optional
  • default: {}

parameters

params.widthTreshold Number
  • optional
  • default: 0.025

the maximum difference in IOIs which are in the same cluster

params.maxTempos Number
  • optional
  • default: 10

initial amount of tempo hypotheses

Return:

{clScores: Array, clScoresIdxs: Array}

object with intervals scores

public static createTempoList(clusters: Object, params: Object): Array source

Get array of tempo hypotheses

Params:

NameTypeAttributeDescription
clusters Object

object with clusters

clusters.clIntervals Array

clusters IOIs array

clusters.clSizes Array

clusters sizes array

clusters.clScores Array

clusters scores array

clusters.clScoresIdxs Array

clusters scores indexes array

params Object
  • optional
  • default: {}

parameters

params.widthTreshold Number
  • optional
  • default: 0.025

the maximum difference in IOIs which are in the same cluster

params.minBeatInterval Number
  • optional
  • default: 0.3

the minimum inter-beat interval (IBI) (0.30 seconds == 200 BPM)

params.maxBeatInterval Number
  • optional
  • default: 1

the maximum inter-beat interval (IBI) (1.00 seconds == 60 BPM)

Return:

Array

tempoList - tempo hypotheses array

public static mergeClusters(clusters: Object, params: Object): {clIntervals: Array, clSizes: Array} source

Merge similar intervals

Params:

NameTypeAttributeDescription
clusters Object

object with clusters

clusters.clIntervals Array

clusters IOIs array

clusters.clSizes Array

clusters sizes array

params Object
  • optional
  • default: {}

parameters

params.widthTreshold Number
  • optional
  • default: 0.025

the maximum difference in IOIs which are in the same cluster

Return:

{clIntervals: Array, clSizes: Array}

object with clusters

public static processRhythmicEvents(events: Array, params: Object): {clIntervals: Array, clSizes: Array} source

Find clusters

Params:

NameTypeAttributeDescription
events Array

the onsets from which the tempo is induced

params Object
  • optional
  • default: {}

parameters

params.widthTreshold Number
  • optional
  • default: 0.025

the maximum difference in IOIs which are in the same cluster

params.maxIOI Number
  • optional
  • default: 2.5

the maximum IOI for inclusion in a cluster

params.minIOI Number
  • optional
  • default: 0.07

the minimum IOI for inclusion in a cluster

Return:

{clIntervals: Array, clSizes: Array}

object with clusters