@sebastbake/music-tempo
Version:
Finding out tempo of the music
325 lines (234 loc) • 13.4 kB
HTML
<html>
<head>
<meta charset="utf-8">
<base data-ice="baseUrl" href="../../">
<title data-ice="title">BeatTracking | API Document</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
<script src="script/prettify/prettify.js"></script>
<script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">
<header>
<a href="./">Home</a>
<a href="identifiers.html">Reference</a>
<a href="source.html">Source</a>
<a data-ice="repoURL" href="https://github.com/killercrush/music-tempo" class="repo-url-github">Repository</a>
<div class="search-box">
<span>
<img src="./image/search.png">
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
</span>
<ul class="search-result"></ul>
</div>
</header>
<nav class="navigation" data-ice="nav"><div>
<ul>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/Agent.js~Agent.html">Agent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BeatTracking.js~BeatTracking.html">BeatTracking</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/FFT.js~FFT.html">FFT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/MusicTempo.js~MusicTempo.html">MusicTempo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/OnsetDetection.js~OnsetDetection.html">OnsetDetection</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/TempoInduction.js~TempoInduction.html">TempoInduction</a></span></span></li>
</ul>
</div>
</nav>
<div class="content" data-ice="content"><div class="header-notice">
<div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import BeatTracking from '<span><a href="file/src/BeatTracking.js.html#lineNumber6">music-tempo/src/BeatTracking.js</a></span>'</code></pre></div>
<span data-ice="access">public</span>
<span data-ice="kind">class</span>
<span data-ice="source">| <span><a href="file/src/BeatTracking.js.html#lineNumber6">source</a></span></span>
</div>
<div class="self-detail detail">
<h1 data-ice="name">BeatTracking</h1>
<div class="description" data-ice="description"><p>Performs automatic beat tracking</p>
</div>
</div>
<div data-ice="staticMethodSummary"><h2>Static Method Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3">Static Public Methods</td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/BeatTracking.js~BeatTracking.html#static-method-trackBeat">trackBeat</a></span></span><span data-ice="signature">(events: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, eventsScores: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, tempoList: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, params: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Perform beat tracking on a array of onsets</p>
</div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div data-ice="staticMethodDetails"><h2 data-ice="title">Static Public Methods</h2>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="static-method-trackBeat">
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span data-ice="name">trackBeat</span><span data-ice="signature">(events: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, eventsScores: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, tempoList: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, params: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/BeatTracking.js.html#lineNumber25">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>Perform beat tracking on a array of onsets</p>
</div>
<div data-ice="properties"><div data-ice="properties">
<h4 data-ice="title">Params:</h4>
<table class="params">
<thead>
<tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
</thead>
<tbody>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">events</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>the array of onsets to beat track</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">eventsScores</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>the array of corresponding salience values</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">tempoList</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>the array of tempo hypothesis</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">params</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: {}</li></ul></td>
<td data-ice="description"><p>parameters</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.initPeriod</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 5</li></ul></td>
<td data-ice="description"><p>duration of the initial section</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.thresholdBI</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 0.02</li></ul></td>
<td data-ice="description"><p>for the purpose of removing duplicate agents, the default JND of IBI</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.thresholdBT</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 0.04</li></ul></td>
<td data-ice="description"><p>for the purpose of removing duplicate agents, the default JND of phase</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.expiryTime</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 10</li></ul></td>
<td data-ice="description"><p>the time after which an Agent that has not accepted any beat will be destroyed</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.toleranceWndInner</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 0.04</li></ul></td>
<td data-ice="description"><p>the maximum time that a beat can deviate from the predicted beat time without a fork occurring</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.toleranceWndPre</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 0.15</li></ul></td>
<td data-ice="description"><p>the maximum amount by which a beat can be earlier than the predicted beat time, expressed as a fraction of the beat period</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.toleranceWndPost</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 0.3</li></ul></td>
<td data-ice="description"><p>the maximum amount by which a beat can be later than the predicted beat time, expressed as a fraction of the beat period</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.correctionFactor</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 50</li></ul></td>
<td data-ice="description"><p>correction factor for updating beat period</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.maxChange</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 0.2</li></ul></td>
<td data-ice="description"><p>the maximum allowed deviation from the initial tempo, expressed as a fraction of the initial beat period</p>
</td>
</tr>
<tr data-ice="property" data-depth="1">
<td data-ice="name" data-depth="1">params.penaltyFactor</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></span></td>
<td data-ice="appendix"><ul><li>optional</li>
<li>default: 0.5</li></ul></td>
<td data-ice="description"><p>factor for correcting score, if onset do not coincide precisely with predicted beat time</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
<td class="return-desc" data-ice="returnDescription"><p>agents - agents array</p>
</td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.5.2)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>
<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>