@viji-dev/core 0.2.20 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -32
- package/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global.d.ts +114 -13
- package/dist/artist-js-ambient.d.ts +43 -1
- package/dist/artist-jsdoc.d.ts +43 -1
- package/dist/assets/{viji.worker-BANvuSYW.js → viji.worker-b3XR7zKX.js} +525 -53
- package/dist/assets/viji.worker-b3XR7zKX.js.map +1 -0
- package/dist/assets/wasm/essentia-wasm.web.wasm +0 -0
- package/dist/essentia-wasm.web-CO8uMw0d.js +5696 -0
- package/dist/essentia-wasm.web-CO8uMw0d.js.map +1 -0
- package/dist/essentia.js-core.es-DnrJE0uR.js +3174 -0
- package/dist/essentia.js-core.es-DnrJE0uR.js.map +1 -0
- package/dist/index-BdLMCFEN.js +16180 -0
- package/dist/index-BdLMCFEN.js.map +1 -0
- package/dist/index.d.ts +1128 -36
- package/dist/index.js +5 -2613
- package/dist/index.js.map +1 -1
- package/dist/shader-uniforms.js +125 -0
- package/package.json +5 -2
- package/dist/assets/viji.worker-BANvuSYW.js.map +0 -1
|
@@ -0,0 +1,3174 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
16
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
17
|
+
function fulfilled(value) {
|
|
18
|
+
try {
|
|
19
|
+
step(generator.next(value));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
reject(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function rejected(value) {
|
|
25
|
+
try {
|
|
26
|
+
step(generator["throw"](value));
|
|
27
|
+
} catch (e) {
|
|
28
|
+
reject(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function step(result) {
|
|
32
|
+
result.done ? resolve(result.value) : new P(function(resolve2) {
|
|
33
|
+
resolve2(result.value);
|
|
34
|
+
}).then(fulfilled, rejected);
|
|
35
|
+
}
|
|
36
|
+
step((generator = generator.apply(thisArg, [])).next());
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function __generator(thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() {
|
|
41
|
+
if (t[0] & 1) throw t[1];
|
|
42
|
+
return t[1];
|
|
43
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
|
44
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
|
+
return this;
|
|
46
|
+
}), g;
|
|
47
|
+
function verb(n) {
|
|
48
|
+
return function(v) {
|
|
49
|
+
return step([n, v]);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function step(op) {
|
|
53
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
54
|
+
while (_) try {
|
|
55
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
56
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
57
|
+
switch (op[0]) {
|
|
58
|
+
case 0:
|
|
59
|
+
case 1:
|
|
60
|
+
t = op;
|
|
61
|
+
break;
|
|
62
|
+
case 4:
|
|
63
|
+
_.label++;
|
|
64
|
+
return { value: op[1], done: false };
|
|
65
|
+
case 5:
|
|
66
|
+
_.label++;
|
|
67
|
+
y = op[1];
|
|
68
|
+
op = [0];
|
|
69
|
+
continue;
|
|
70
|
+
case 7:
|
|
71
|
+
op = _.ops.pop();
|
|
72
|
+
_.trys.pop();
|
|
73
|
+
continue;
|
|
74
|
+
default:
|
|
75
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
76
|
+
_ = 0;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
80
|
+
_.label = op[1];
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
84
|
+
_.label = t[1];
|
|
85
|
+
t = op;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
if (t && _.label < t[2]) {
|
|
89
|
+
_.label = t[2];
|
|
90
|
+
_.ops.push(op);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (t[2]) _.ops.pop();
|
|
94
|
+
_.trys.pop();
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
op = body.call(thisArg, _);
|
|
98
|
+
} catch (e) {
|
|
99
|
+
op = [6, e];
|
|
100
|
+
y = 0;
|
|
101
|
+
} finally {
|
|
102
|
+
f = t = 0;
|
|
103
|
+
}
|
|
104
|
+
if (op[0] & 5) throw op[1];
|
|
105
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @license
|
|
110
|
+
* Copyright (C) 2006-2020 Music Technology Group - Universitat Pompeu Fabra
|
|
111
|
+
*
|
|
112
|
+
* This file is part of Essentia
|
|
113
|
+
*
|
|
114
|
+
* Essentia is free software: you can redistribute it and/or modify it under
|
|
115
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
116
|
+
* Software Foundation (FSF), either version 3 of the License, or (at your
|
|
117
|
+
* option) any later version.
|
|
118
|
+
*
|
|
119
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
120
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
121
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
122
|
+
* details.
|
|
123
|
+
*
|
|
124
|
+
* You should have received a copy of the Affero GNU General Public License
|
|
125
|
+
* version 3 along with this program. If not, see http://www.gnu.org/licenses/
|
|
126
|
+
*/
|
|
127
|
+
var Essentia = (
|
|
128
|
+
/** @class */
|
|
129
|
+
function() {
|
|
130
|
+
function Essentia2(EssentiaWASM, isDebug) {
|
|
131
|
+
if (isDebug === void 0) {
|
|
132
|
+
isDebug = false;
|
|
133
|
+
}
|
|
134
|
+
this.EssentiaWASM = EssentiaWASM;
|
|
135
|
+
this.isDebug = isDebug;
|
|
136
|
+
this.algorithms = new EssentiaWASM.EssentiaJS(isDebug);
|
|
137
|
+
this.module = EssentiaWASM;
|
|
138
|
+
this.version = this.algorithms.version;
|
|
139
|
+
this.algorithmNames = this.algorithms.algorithmNames;
|
|
140
|
+
}
|
|
141
|
+
Essentia2.prototype.getAudioBufferFromURL = function(audioURL, webAudioCtx) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
143
|
+
var response, arrayBuffer, audioBuffer;
|
|
144
|
+
return __generator(this, function(_a) {
|
|
145
|
+
switch (_a.label) {
|
|
146
|
+
case 0:
|
|
147
|
+
return [4, fetch(audioURL)];
|
|
148
|
+
case 1:
|
|
149
|
+
response = _a.sent();
|
|
150
|
+
return [4, response.arrayBuffer()];
|
|
151
|
+
case 2:
|
|
152
|
+
arrayBuffer = _a.sent();
|
|
153
|
+
return [4, webAudioCtx.decodeAudioData(arrayBuffer)];
|
|
154
|
+
case 3:
|
|
155
|
+
audioBuffer = _a.sent();
|
|
156
|
+
return [2, audioBuffer];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
Essentia2.prototype.getAudioChannelDataFromURL = function(audioURL, webAudioCtx, channel) {
|
|
162
|
+
if (channel === void 0) {
|
|
163
|
+
channel = 0;
|
|
164
|
+
}
|
|
165
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
166
|
+
var response, arrayBuffer, audioBuffer;
|
|
167
|
+
return __generator(this, function(_a) {
|
|
168
|
+
switch (_a.label) {
|
|
169
|
+
case 0:
|
|
170
|
+
return [4, fetch(audioURL)];
|
|
171
|
+
case 1:
|
|
172
|
+
response = _a.sent();
|
|
173
|
+
return [4, response.arrayBuffer()];
|
|
174
|
+
case 2:
|
|
175
|
+
arrayBuffer = _a.sent();
|
|
176
|
+
return [4, webAudioCtx.decodeAudioData(arrayBuffer)];
|
|
177
|
+
case 3:
|
|
178
|
+
audioBuffer = _a.sent();
|
|
179
|
+
return [2, audioBuffer.getChannelData(channel)];
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
Essentia2.prototype.audioBufferToMonoSignal = function(buffer) {
|
|
185
|
+
if (buffer.numberOfChannels === 1) {
|
|
186
|
+
return buffer.getChannelData(0);
|
|
187
|
+
}
|
|
188
|
+
if (buffer.numberOfChannels === 2) {
|
|
189
|
+
var left = this.arrayToVector(buffer.getChannelData(0));
|
|
190
|
+
var right = this.arrayToVector(buffer.getChannelData(1));
|
|
191
|
+
var monoSignal = this.MonoMixer(left, right).audio;
|
|
192
|
+
return this.vectorToArray(monoSignal);
|
|
193
|
+
}
|
|
194
|
+
throw new Error("Unexpected number of channels found in audio buffer. Only accepts mono or stereo audio buffers.");
|
|
195
|
+
};
|
|
196
|
+
Essentia2.prototype.shutdown = function() {
|
|
197
|
+
this.algorithms.shutdown();
|
|
198
|
+
};
|
|
199
|
+
Essentia2.prototype.reinstantiate = function() {
|
|
200
|
+
this.algorithms = new this.module.EssentiaJS(this.isDebug);
|
|
201
|
+
};
|
|
202
|
+
Essentia2.prototype.delete = function() {
|
|
203
|
+
this.algorithms.delete();
|
|
204
|
+
};
|
|
205
|
+
Essentia2.prototype.arrayToVector = function(inputArray) {
|
|
206
|
+
return this.module.arrayToVector(inputArray);
|
|
207
|
+
};
|
|
208
|
+
Essentia2.prototype.vectorToArray = function(inputVector) {
|
|
209
|
+
return this.module.vectorToArray(inputVector);
|
|
210
|
+
};
|
|
211
|
+
Essentia2.prototype.FrameGenerator = function(inputAudioData, frameSize, hopSize) {
|
|
212
|
+
if (frameSize === void 0) {
|
|
213
|
+
frameSize = 2048;
|
|
214
|
+
}
|
|
215
|
+
if (hopSize === void 0) {
|
|
216
|
+
hopSize = 1024;
|
|
217
|
+
}
|
|
218
|
+
return this.algorithms.FrameGenerator(inputAudioData, frameSize, hopSize);
|
|
219
|
+
};
|
|
220
|
+
Essentia2.prototype.MonoMixer = function(leftSignal, rightSignal) {
|
|
221
|
+
return this.algorithms.MonoMixer(leftSignal, rightSignal);
|
|
222
|
+
};
|
|
223
|
+
Essentia2.prototype.LoudnessEBUR128 = function(leftSignal, rightSignal, hopSize, sampleRate, startAtZero) {
|
|
224
|
+
if (hopSize === void 0) {
|
|
225
|
+
hopSize = 0.1;
|
|
226
|
+
}
|
|
227
|
+
if (sampleRate === void 0) {
|
|
228
|
+
sampleRate = 44100;
|
|
229
|
+
}
|
|
230
|
+
if (startAtZero === void 0) {
|
|
231
|
+
startAtZero = false;
|
|
232
|
+
}
|
|
233
|
+
return this.algorithms.LoudnessEBUR128(leftSignal, rightSignal, hopSize, sampleRate, startAtZero);
|
|
234
|
+
};
|
|
235
|
+
Essentia2.prototype.AfterMaxToBeforeMaxEnergyRatio = function(pitch) {
|
|
236
|
+
return this.algorithms.AfterMaxToBeforeMaxEnergyRatio(pitch);
|
|
237
|
+
};
|
|
238
|
+
Essentia2.prototype.AllPass = function(signal, bandwidth, cutoffFrequency, order, sampleRate) {
|
|
239
|
+
if (bandwidth === void 0) {
|
|
240
|
+
bandwidth = 500;
|
|
241
|
+
}
|
|
242
|
+
if (cutoffFrequency === void 0) {
|
|
243
|
+
cutoffFrequency = 1500;
|
|
244
|
+
}
|
|
245
|
+
if (order === void 0) {
|
|
246
|
+
order = 1;
|
|
247
|
+
}
|
|
248
|
+
if (sampleRate === void 0) {
|
|
249
|
+
sampleRate = 44100;
|
|
250
|
+
}
|
|
251
|
+
return this.algorithms.AllPass(signal, bandwidth, cutoffFrequency, order, sampleRate);
|
|
252
|
+
};
|
|
253
|
+
Essentia2.prototype.AudioOnsetsMarker = function(signal, onsets, sampleRate, type) {
|
|
254
|
+
if (onsets === void 0) {
|
|
255
|
+
onsets = [];
|
|
256
|
+
}
|
|
257
|
+
if (sampleRate === void 0) {
|
|
258
|
+
sampleRate = 44100;
|
|
259
|
+
}
|
|
260
|
+
if (type === void 0) {
|
|
261
|
+
type = "beep";
|
|
262
|
+
}
|
|
263
|
+
var veconsets = new this.module.VectorFloat();
|
|
264
|
+
for (var i = 0; i < veconsets.size(); i++) {
|
|
265
|
+
veconsets.push_back(onsets[i]);
|
|
266
|
+
}
|
|
267
|
+
return this.algorithms.AudioOnsetsMarker(signal, veconsets, sampleRate, type);
|
|
268
|
+
};
|
|
269
|
+
Essentia2.prototype.AutoCorrelation = function(array, frequencyDomainCompression, generalized, normalization) {
|
|
270
|
+
if (frequencyDomainCompression === void 0) {
|
|
271
|
+
frequencyDomainCompression = 0.5;
|
|
272
|
+
}
|
|
273
|
+
if (generalized === void 0) {
|
|
274
|
+
generalized = false;
|
|
275
|
+
}
|
|
276
|
+
if (normalization === void 0) {
|
|
277
|
+
normalization = "standard";
|
|
278
|
+
}
|
|
279
|
+
return this.algorithms.AutoCorrelation(array, frequencyDomainCompression, generalized, normalization);
|
|
280
|
+
};
|
|
281
|
+
Essentia2.prototype.BFCC = function(spectrum, dctType, highFrequencyBound, inputSize, liftering, logType, lowFrequencyBound, normalize, numberBands, numberCoefficients, sampleRate, type, weighting) {
|
|
282
|
+
if (dctType === void 0) {
|
|
283
|
+
dctType = 2;
|
|
284
|
+
}
|
|
285
|
+
if (highFrequencyBound === void 0) {
|
|
286
|
+
highFrequencyBound = 11e3;
|
|
287
|
+
}
|
|
288
|
+
if (inputSize === void 0) {
|
|
289
|
+
inputSize = 1025;
|
|
290
|
+
}
|
|
291
|
+
if (liftering === void 0) {
|
|
292
|
+
liftering = 0;
|
|
293
|
+
}
|
|
294
|
+
if (logType === void 0) {
|
|
295
|
+
logType = "dbamp";
|
|
296
|
+
}
|
|
297
|
+
if (lowFrequencyBound === void 0) {
|
|
298
|
+
lowFrequencyBound = 0;
|
|
299
|
+
}
|
|
300
|
+
if (normalize === void 0) {
|
|
301
|
+
normalize = "unit_sum";
|
|
302
|
+
}
|
|
303
|
+
if (numberBands === void 0) {
|
|
304
|
+
numberBands = 40;
|
|
305
|
+
}
|
|
306
|
+
if (numberCoefficients === void 0) {
|
|
307
|
+
numberCoefficients = 13;
|
|
308
|
+
}
|
|
309
|
+
if (sampleRate === void 0) {
|
|
310
|
+
sampleRate = 44100;
|
|
311
|
+
}
|
|
312
|
+
if (type === void 0) {
|
|
313
|
+
type = "power";
|
|
314
|
+
}
|
|
315
|
+
if (weighting === void 0) {
|
|
316
|
+
weighting = "warping";
|
|
317
|
+
}
|
|
318
|
+
return this.algorithms.BFCC(spectrum, dctType, highFrequencyBound, inputSize, liftering, logType, lowFrequencyBound, normalize, numberBands, numberCoefficients, sampleRate, type, weighting);
|
|
319
|
+
};
|
|
320
|
+
Essentia2.prototype.BPF = function(x, xPoints, yPoints) {
|
|
321
|
+
if (xPoints === void 0) {
|
|
322
|
+
xPoints = [0, 1];
|
|
323
|
+
}
|
|
324
|
+
if (yPoints === void 0) {
|
|
325
|
+
yPoints = [0, 1];
|
|
326
|
+
}
|
|
327
|
+
var vecxPoints = new this.module.VectorFloat();
|
|
328
|
+
for (var i = 0; i < vecxPoints.size(); i++) {
|
|
329
|
+
vecxPoints.push_back(xPoints[i]);
|
|
330
|
+
}
|
|
331
|
+
var vecyPoints = new this.module.VectorFloat();
|
|
332
|
+
for (var i = 0; i < vecyPoints.size(); i++) {
|
|
333
|
+
vecyPoints.push_back(yPoints[i]);
|
|
334
|
+
}
|
|
335
|
+
return this.algorithms.BPF(x, vecxPoints, vecyPoints);
|
|
336
|
+
};
|
|
337
|
+
Essentia2.prototype.BandPass = function(signal, bandwidth, cutoffFrequency, sampleRate) {
|
|
338
|
+
if (bandwidth === void 0) {
|
|
339
|
+
bandwidth = 500;
|
|
340
|
+
}
|
|
341
|
+
if (cutoffFrequency === void 0) {
|
|
342
|
+
cutoffFrequency = 1500;
|
|
343
|
+
}
|
|
344
|
+
if (sampleRate === void 0) {
|
|
345
|
+
sampleRate = 44100;
|
|
346
|
+
}
|
|
347
|
+
return this.algorithms.BandPass(signal, bandwidth, cutoffFrequency, sampleRate);
|
|
348
|
+
};
|
|
349
|
+
Essentia2.prototype.BandReject = function(signal, bandwidth, cutoffFrequency, sampleRate) {
|
|
350
|
+
if (bandwidth === void 0) {
|
|
351
|
+
bandwidth = 500;
|
|
352
|
+
}
|
|
353
|
+
if (cutoffFrequency === void 0) {
|
|
354
|
+
cutoffFrequency = 1500;
|
|
355
|
+
}
|
|
356
|
+
if (sampleRate === void 0) {
|
|
357
|
+
sampleRate = 44100;
|
|
358
|
+
}
|
|
359
|
+
return this.algorithms.BandReject(signal, bandwidth, cutoffFrequency, sampleRate);
|
|
360
|
+
};
|
|
361
|
+
Essentia2.prototype.BarkBands = function(spectrum, numberBands, sampleRate) {
|
|
362
|
+
if (numberBands === void 0) {
|
|
363
|
+
numberBands = 27;
|
|
364
|
+
}
|
|
365
|
+
if (sampleRate === void 0) {
|
|
366
|
+
sampleRate = 44100;
|
|
367
|
+
}
|
|
368
|
+
return this.algorithms.BarkBands(spectrum, numberBands, sampleRate);
|
|
369
|
+
};
|
|
370
|
+
Essentia2.prototype.BeatTrackerDegara = function(signal, maxTempo, minTempo) {
|
|
371
|
+
if (maxTempo === void 0) {
|
|
372
|
+
maxTempo = 208;
|
|
373
|
+
}
|
|
374
|
+
if (minTempo === void 0) {
|
|
375
|
+
minTempo = 40;
|
|
376
|
+
}
|
|
377
|
+
return this.algorithms.BeatTrackerDegara(signal, maxTempo, minTempo);
|
|
378
|
+
};
|
|
379
|
+
Essentia2.prototype.BeatTrackerMultiFeature = function(signal, maxTempo, minTempo) {
|
|
380
|
+
if (maxTempo === void 0) {
|
|
381
|
+
maxTempo = 208;
|
|
382
|
+
}
|
|
383
|
+
if (minTempo === void 0) {
|
|
384
|
+
minTempo = 40;
|
|
385
|
+
}
|
|
386
|
+
return this.algorithms.BeatTrackerMultiFeature(signal, maxTempo, minTempo);
|
|
387
|
+
};
|
|
388
|
+
Essentia2.prototype.Beatogram = function(loudness, loudnessBandRatio, size) {
|
|
389
|
+
if (size === void 0) {
|
|
390
|
+
size = 16;
|
|
391
|
+
}
|
|
392
|
+
return this.algorithms.Beatogram(loudness, loudnessBandRatio, size);
|
|
393
|
+
};
|
|
394
|
+
Essentia2.prototype.BeatsLoudness = function(signal, beatDuration, beatWindowDuration, beats, frequencyBands, sampleRate) {
|
|
395
|
+
if (beatDuration === void 0) {
|
|
396
|
+
beatDuration = 0.05;
|
|
397
|
+
}
|
|
398
|
+
if (beatWindowDuration === void 0) {
|
|
399
|
+
beatWindowDuration = 0.1;
|
|
400
|
+
}
|
|
401
|
+
if (beats === void 0) {
|
|
402
|
+
beats = [];
|
|
403
|
+
}
|
|
404
|
+
if (frequencyBands === void 0) {
|
|
405
|
+
frequencyBands = [20, 150, 400, 3200, 7e3, 22e3];
|
|
406
|
+
}
|
|
407
|
+
if (sampleRate === void 0) {
|
|
408
|
+
sampleRate = 44100;
|
|
409
|
+
}
|
|
410
|
+
var vecbeats = new this.module.VectorFloat();
|
|
411
|
+
for (var i = 0; i < vecbeats.size(); i++) {
|
|
412
|
+
vecbeats.push_back(beats[i]);
|
|
413
|
+
}
|
|
414
|
+
var vecfrequencyBands = new this.module.VectorFloat();
|
|
415
|
+
for (var i = 0; i < vecfrequencyBands.size(); i++) {
|
|
416
|
+
vecfrequencyBands.push_back(frequencyBands[i]);
|
|
417
|
+
}
|
|
418
|
+
return this.algorithms.BeatsLoudness(signal, beatDuration, beatWindowDuration, vecbeats, vecfrequencyBands, sampleRate);
|
|
419
|
+
};
|
|
420
|
+
Essentia2.prototype.BinaryOperator = function(array1, array2, type) {
|
|
421
|
+
if (type === void 0) {
|
|
422
|
+
type = "add";
|
|
423
|
+
}
|
|
424
|
+
return this.algorithms.BinaryOperator(array1, array2, type);
|
|
425
|
+
};
|
|
426
|
+
Essentia2.prototype.BinaryOperatorStream = function(array1, array2, type) {
|
|
427
|
+
if (type === void 0) {
|
|
428
|
+
type = "add";
|
|
429
|
+
}
|
|
430
|
+
return this.algorithms.BinaryOperatorStream(array1, array2, type);
|
|
431
|
+
};
|
|
432
|
+
Essentia2.prototype.BpmHistogramDescriptors = function(bpmIntervals) {
|
|
433
|
+
return this.algorithms.BpmHistogramDescriptors(bpmIntervals);
|
|
434
|
+
};
|
|
435
|
+
Essentia2.prototype.BpmRubato = function(beats, longRegionsPruningTime, shortRegionsMergingTime, tolerance) {
|
|
436
|
+
if (longRegionsPruningTime === void 0) {
|
|
437
|
+
longRegionsPruningTime = 20;
|
|
438
|
+
}
|
|
439
|
+
if (shortRegionsMergingTime === void 0) {
|
|
440
|
+
shortRegionsMergingTime = 4;
|
|
441
|
+
}
|
|
442
|
+
if (tolerance === void 0) {
|
|
443
|
+
tolerance = 0.08;
|
|
444
|
+
}
|
|
445
|
+
return this.algorithms.BpmRubato(beats, longRegionsPruningTime, shortRegionsMergingTime, tolerance);
|
|
446
|
+
};
|
|
447
|
+
Essentia2.prototype.CentralMoments = function(array, mode, range) {
|
|
448
|
+
if (mode === void 0) {
|
|
449
|
+
mode = "pdf";
|
|
450
|
+
}
|
|
451
|
+
if (range === void 0) {
|
|
452
|
+
range = 1;
|
|
453
|
+
}
|
|
454
|
+
return this.algorithms.CentralMoments(array, mode, range);
|
|
455
|
+
};
|
|
456
|
+
Essentia2.prototype.Centroid = function(array, range) {
|
|
457
|
+
if (range === void 0) {
|
|
458
|
+
range = 1;
|
|
459
|
+
}
|
|
460
|
+
return this.algorithms.Centroid(array, range);
|
|
461
|
+
};
|
|
462
|
+
Essentia2.prototype.ChordsDescriptors = function(chords, key, scale) {
|
|
463
|
+
return this.algorithms.ChordsDescriptors(chords, key, scale);
|
|
464
|
+
};
|
|
465
|
+
Essentia2.prototype.ChordsDetection = function(pcp, hopSize, sampleRate, windowSize) {
|
|
466
|
+
if (hopSize === void 0) {
|
|
467
|
+
hopSize = 2048;
|
|
468
|
+
}
|
|
469
|
+
if (sampleRate === void 0) {
|
|
470
|
+
sampleRate = 44100;
|
|
471
|
+
}
|
|
472
|
+
if (windowSize === void 0) {
|
|
473
|
+
windowSize = 2;
|
|
474
|
+
}
|
|
475
|
+
return this.algorithms.ChordsDetection(pcp, hopSize, sampleRate, windowSize);
|
|
476
|
+
};
|
|
477
|
+
Essentia2.prototype.ChordsDetectionBeats = function(pcp, ticks, chromaPick, hopSize, sampleRate) {
|
|
478
|
+
if (chromaPick === void 0) {
|
|
479
|
+
chromaPick = "interbeat_median";
|
|
480
|
+
}
|
|
481
|
+
if (hopSize === void 0) {
|
|
482
|
+
hopSize = 2048;
|
|
483
|
+
}
|
|
484
|
+
if (sampleRate === void 0) {
|
|
485
|
+
sampleRate = 44100;
|
|
486
|
+
}
|
|
487
|
+
return this.algorithms.ChordsDetectionBeats(pcp, ticks, chromaPick, hopSize, sampleRate);
|
|
488
|
+
};
|
|
489
|
+
Essentia2.prototype.ChromaCrossSimilarity = function(queryFeature, referenceFeature, binarizePercentile, frameStackSize, frameStackStride, noti, oti, otiBinary, streaming) {
|
|
490
|
+
if (binarizePercentile === void 0) {
|
|
491
|
+
binarizePercentile = 0.095;
|
|
492
|
+
}
|
|
493
|
+
if (frameStackSize === void 0) {
|
|
494
|
+
frameStackSize = 9;
|
|
495
|
+
}
|
|
496
|
+
if (frameStackStride === void 0) {
|
|
497
|
+
frameStackStride = 1;
|
|
498
|
+
}
|
|
499
|
+
if (noti === void 0) {
|
|
500
|
+
noti = 12;
|
|
501
|
+
}
|
|
502
|
+
if (oti === void 0) {
|
|
503
|
+
oti = true;
|
|
504
|
+
}
|
|
505
|
+
if (otiBinary === void 0) {
|
|
506
|
+
otiBinary = false;
|
|
507
|
+
}
|
|
508
|
+
if (streaming === void 0) {
|
|
509
|
+
streaming = false;
|
|
510
|
+
}
|
|
511
|
+
return this.algorithms.ChromaCrossSimilarity(queryFeature, referenceFeature, binarizePercentile, frameStackSize, frameStackStride, noti, oti, otiBinary, streaming);
|
|
512
|
+
};
|
|
513
|
+
Essentia2.prototype.Chromagram = function(frame, binsPerOctave, minFrequency, minimumKernelSize, normalizeType, numberBins, sampleRate, scale, threshold, windowType, zeroPhase) {
|
|
514
|
+
if (binsPerOctave === void 0) {
|
|
515
|
+
binsPerOctave = 12;
|
|
516
|
+
}
|
|
517
|
+
if (minFrequency === void 0) {
|
|
518
|
+
minFrequency = 32.7;
|
|
519
|
+
}
|
|
520
|
+
if (minimumKernelSize === void 0) {
|
|
521
|
+
minimumKernelSize = 4;
|
|
522
|
+
}
|
|
523
|
+
if (normalizeType === void 0) {
|
|
524
|
+
normalizeType = "unit_max";
|
|
525
|
+
}
|
|
526
|
+
if (numberBins === void 0) {
|
|
527
|
+
numberBins = 84;
|
|
528
|
+
}
|
|
529
|
+
if (sampleRate === void 0) {
|
|
530
|
+
sampleRate = 44100;
|
|
531
|
+
}
|
|
532
|
+
if (scale === void 0) {
|
|
533
|
+
scale = 1;
|
|
534
|
+
}
|
|
535
|
+
if (threshold === void 0) {
|
|
536
|
+
threshold = 0.01;
|
|
537
|
+
}
|
|
538
|
+
if (windowType === void 0) {
|
|
539
|
+
windowType = "hann";
|
|
540
|
+
}
|
|
541
|
+
if (zeroPhase === void 0) {
|
|
542
|
+
zeroPhase = true;
|
|
543
|
+
}
|
|
544
|
+
return this.algorithms.Chromagram(frame, binsPerOctave, minFrequency, minimumKernelSize, normalizeType, numberBins, sampleRate, scale, threshold, windowType, zeroPhase);
|
|
545
|
+
};
|
|
546
|
+
Essentia2.prototype.ClickDetector = function(frame, detectionThreshold, frameSize, hopSize, order, powerEstimationThreshold, sampleRate, silenceThreshold) {
|
|
547
|
+
if (detectionThreshold === void 0) {
|
|
548
|
+
detectionThreshold = 30;
|
|
549
|
+
}
|
|
550
|
+
if (frameSize === void 0) {
|
|
551
|
+
frameSize = 512;
|
|
552
|
+
}
|
|
553
|
+
if (hopSize === void 0) {
|
|
554
|
+
hopSize = 256;
|
|
555
|
+
}
|
|
556
|
+
if (order === void 0) {
|
|
557
|
+
order = 12;
|
|
558
|
+
}
|
|
559
|
+
if (powerEstimationThreshold === void 0) {
|
|
560
|
+
powerEstimationThreshold = 10;
|
|
561
|
+
}
|
|
562
|
+
if (sampleRate === void 0) {
|
|
563
|
+
sampleRate = 44100;
|
|
564
|
+
}
|
|
565
|
+
if (silenceThreshold === void 0) {
|
|
566
|
+
silenceThreshold = -50;
|
|
567
|
+
}
|
|
568
|
+
return this.algorithms.ClickDetector(frame, detectionThreshold, frameSize, hopSize, order, powerEstimationThreshold, sampleRate, silenceThreshold);
|
|
569
|
+
};
|
|
570
|
+
Essentia2.prototype.Clipper = function(signal, max, min) {
|
|
571
|
+
if (max === void 0) {
|
|
572
|
+
max = 1;
|
|
573
|
+
}
|
|
574
|
+
if (min === void 0) {
|
|
575
|
+
min = -1;
|
|
576
|
+
}
|
|
577
|
+
return this.algorithms.Clipper(signal, max, min);
|
|
578
|
+
};
|
|
579
|
+
Essentia2.prototype.CoverSongSimilarity = function(inputArray, alignmentType, disExtension, disOnset, distanceType) {
|
|
580
|
+
if (alignmentType === void 0) {
|
|
581
|
+
alignmentType = "serra09";
|
|
582
|
+
}
|
|
583
|
+
if (disExtension === void 0) {
|
|
584
|
+
disExtension = 0.5;
|
|
585
|
+
}
|
|
586
|
+
if (disOnset === void 0) {
|
|
587
|
+
disOnset = 0.5;
|
|
588
|
+
}
|
|
589
|
+
if (distanceType === void 0) {
|
|
590
|
+
distanceType = "asymmetric";
|
|
591
|
+
}
|
|
592
|
+
return this.algorithms.CoverSongSimilarity(inputArray, alignmentType, disExtension, disOnset, distanceType);
|
|
593
|
+
};
|
|
594
|
+
Essentia2.prototype.Crest = function(array) {
|
|
595
|
+
return this.algorithms.Crest(array);
|
|
596
|
+
};
|
|
597
|
+
Essentia2.prototype.CrossCorrelation = function(arrayX, arrayY, maxLag, minLag) {
|
|
598
|
+
if (maxLag === void 0) {
|
|
599
|
+
maxLag = 1;
|
|
600
|
+
}
|
|
601
|
+
if (minLag === void 0) {
|
|
602
|
+
minLag = 0;
|
|
603
|
+
}
|
|
604
|
+
return this.algorithms.CrossCorrelation(arrayX, arrayY, maxLag, minLag);
|
|
605
|
+
};
|
|
606
|
+
Essentia2.prototype.CrossSimilarityMatrix = function(queryFeature, referenceFeature, binarize, binarizePercentile, frameStackSize, frameStackStride) {
|
|
607
|
+
if (binarize === void 0) {
|
|
608
|
+
binarize = false;
|
|
609
|
+
}
|
|
610
|
+
if (binarizePercentile === void 0) {
|
|
611
|
+
binarizePercentile = 0.095;
|
|
612
|
+
}
|
|
613
|
+
if (frameStackSize === void 0) {
|
|
614
|
+
frameStackSize = 1;
|
|
615
|
+
}
|
|
616
|
+
if (frameStackStride === void 0) {
|
|
617
|
+
frameStackStride = 1;
|
|
618
|
+
}
|
|
619
|
+
return this.algorithms.CrossSimilarityMatrix(queryFeature, referenceFeature, binarize, binarizePercentile, frameStackSize, frameStackStride);
|
|
620
|
+
};
|
|
621
|
+
Essentia2.prototype.CubicSpline = function(x, leftBoundaryFlag, leftBoundaryValue, rightBoundaryFlag, rightBoundaryValue, xPoints, yPoints) {
|
|
622
|
+
if (leftBoundaryFlag === void 0) {
|
|
623
|
+
leftBoundaryFlag = 0;
|
|
624
|
+
}
|
|
625
|
+
if (leftBoundaryValue === void 0) {
|
|
626
|
+
leftBoundaryValue = 0;
|
|
627
|
+
}
|
|
628
|
+
if (rightBoundaryFlag === void 0) {
|
|
629
|
+
rightBoundaryFlag = 0;
|
|
630
|
+
}
|
|
631
|
+
if (rightBoundaryValue === void 0) {
|
|
632
|
+
rightBoundaryValue = 0;
|
|
633
|
+
}
|
|
634
|
+
if (xPoints === void 0) {
|
|
635
|
+
xPoints = [0, 1];
|
|
636
|
+
}
|
|
637
|
+
if (yPoints === void 0) {
|
|
638
|
+
yPoints = [0, 1];
|
|
639
|
+
}
|
|
640
|
+
var vecxPoints = new this.module.VectorFloat();
|
|
641
|
+
for (var i = 0; i < vecxPoints.size(); i++) {
|
|
642
|
+
vecxPoints.push_back(xPoints[i]);
|
|
643
|
+
}
|
|
644
|
+
var vecyPoints = new this.module.VectorFloat();
|
|
645
|
+
for (var i = 0; i < vecyPoints.size(); i++) {
|
|
646
|
+
vecyPoints.push_back(yPoints[i]);
|
|
647
|
+
}
|
|
648
|
+
return this.algorithms.CubicSpline(x, leftBoundaryFlag, leftBoundaryValue, rightBoundaryFlag, rightBoundaryValue, vecxPoints, vecyPoints);
|
|
649
|
+
};
|
|
650
|
+
Essentia2.prototype.DCRemoval = function(signal, cutoffFrequency, sampleRate) {
|
|
651
|
+
if (cutoffFrequency === void 0) {
|
|
652
|
+
cutoffFrequency = 40;
|
|
653
|
+
}
|
|
654
|
+
if (sampleRate === void 0) {
|
|
655
|
+
sampleRate = 44100;
|
|
656
|
+
}
|
|
657
|
+
return this.algorithms.DCRemoval(signal, cutoffFrequency, sampleRate);
|
|
658
|
+
};
|
|
659
|
+
Essentia2.prototype.DCT = function(array, dctType, inputSize, liftering, outputSize) {
|
|
660
|
+
if (dctType === void 0) {
|
|
661
|
+
dctType = 2;
|
|
662
|
+
}
|
|
663
|
+
if (inputSize === void 0) {
|
|
664
|
+
inputSize = 10;
|
|
665
|
+
}
|
|
666
|
+
if (liftering === void 0) {
|
|
667
|
+
liftering = 0;
|
|
668
|
+
}
|
|
669
|
+
if (outputSize === void 0) {
|
|
670
|
+
outputSize = 10;
|
|
671
|
+
}
|
|
672
|
+
return this.algorithms.DCT(array, dctType, inputSize, liftering, outputSize);
|
|
673
|
+
};
|
|
674
|
+
Essentia2.prototype.Danceability = function(signal, maxTau, minTau, sampleRate, tauMultiplier) {
|
|
675
|
+
if (maxTau === void 0) {
|
|
676
|
+
maxTau = 8800;
|
|
677
|
+
}
|
|
678
|
+
if (minTau === void 0) {
|
|
679
|
+
minTau = 310;
|
|
680
|
+
}
|
|
681
|
+
if (sampleRate === void 0) {
|
|
682
|
+
sampleRate = 44100;
|
|
683
|
+
}
|
|
684
|
+
if (tauMultiplier === void 0) {
|
|
685
|
+
tauMultiplier = 1.1;
|
|
686
|
+
}
|
|
687
|
+
return this.algorithms.Danceability(signal, maxTau, minTau, sampleRate, tauMultiplier);
|
|
688
|
+
};
|
|
689
|
+
Essentia2.prototype.Decrease = function(array, range) {
|
|
690
|
+
if (range === void 0) {
|
|
691
|
+
range = 1;
|
|
692
|
+
}
|
|
693
|
+
return this.algorithms.Decrease(array, range);
|
|
694
|
+
};
|
|
695
|
+
Essentia2.prototype.Derivative = function(signal) {
|
|
696
|
+
return this.algorithms.Derivative(signal);
|
|
697
|
+
};
|
|
698
|
+
Essentia2.prototype.DerivativeSFX = function(envelope) {
|
|
699
|
+
return this.algorithms.DerivativeSFX(envelope);
|
|
700
|
+
};
|
|
701
|
+
Essentia2.prototype.DiscontinuityDetector = function(frame, detectionThreshold, energyThreshold, frameSize, hopSize, kernelSize, order, silenceThreshold, subFrameSize) {
|
|
702
|
+
if (detectionThreshold === void 0) {
|
|
703
|
+
detectionThreshold = 8;
|
|
704
|
+
}
|
|
705
|
+
if (energyThreshold === void 0) {
|
|
706
|
+
energyThreshold = -60;
|
|
707
|
+
}
|
|
708
|
+
if (frameSize === void 0) {
|
|
709
|
+
frameSize = 512;
|
|
710
|
+
}
|
|
711
|
+
if (hopSize === void 0) {
|
|
712
|
+
hopSize = 256;
|
|
713
|
+
}
|
|
714
|
+
if (kernelSize === void 0) {
|
|
715
|
+
kernelSize = 7;
|
|
716
|
+
}
|
|
717
|
+
if (order === void 0) {
|
|
718
|
+
order = 3;
|
|
719
|
+
}
|
|
720
|
+
if (silenceThreshold === void 0) {
|
|
721
|
+
silenceThreshold = -50;
|
|
722
|
+
}
|
|
723
|
+
if (subFrameSize === void 0) {
|
|
724
|
+
subFrameSize = 32;
|
|
725
|
+
}
|
|
726
|
+
return this.algorithms.DiscontinuityDetector(frame, detectionThreshold, energyThreshold, frameSize, hopSize, kernelSize, order, silenceThreshold, subFrameSize);
|
|
727
|
+
};
|
|
728
|
+
Essentia2.prototype.Dissonance = function(frequencies, magnitudes) {
|
|
729
|
+
return this.algorithms.Dissonance(frequencies, magnitudes);
|
|
730
|
+
};
|
|
731
|
+
Essentia2.prototype.DistributionShape = function(centralMoments) {
|
|
732
|
+
return this.algorithms.DistributionShape(centralMoments);
|
|
733
|
+
};
|
|
734
|
+
Essentia2.prototype.Duration = function(signal, sampleRate) {
|
|
735
|
+
if (sampleRate === void 0) {
|
|
736
|
+
sampleRate = 44100;
|
|
737
|
+
}
|
|
738
|
+
return this.algorithms.Duration(signal, sampleRate);
|
|
739
|
+
};
|
|
740
|
+
Essentia2.prototype.DynamicComplexity = function(signal, frameSize, sampleRate) {
|
|
741
|
+
if (frameSize === void 0) {
|
|
742
|
+
frameSize = 0.2;
|
|
743
|
+
}
|
|
744
|
+
if (sampleRate === void 0) {
|
|
745
|
+
sampleRate = 44100;
|
|
746
|
+
}
|
|
747
|
+
return this.algorithms.DynamicComplexity(signal, frameSize, sampleRate);
|
|
748
|
+
};
|
|
749
|
+
Essentia2.prototype.ERBBands = function(spectrum, highFrequencyBound, inputSize, lowFrequencyBound, numberBands, sampleRate, type, width) {
|
|
750
|
+
if (highFrequencyBound === void 0) {
|
|
751
|
+
highFrequencyBound = 22050;
|
|
752
|
+
}
|
|
753
|
+
if (inputSize === void 0) {
|
|
754
|
+
inputSize = 1025;
|
|
755
|
+
}
|
|
756
|
+
if (lowFrequencyBound === void 0) {
|
|
757
|
+
lowFrequencyBound = 50;
|
|
758
|
+
}
|
|
759
|
+
if (numberBands === void 0) {
|
|
760
|
+
numberBands = 40;
|
|
761
|
+
}
|
|
762
|
+
if (sampleRate === void 0) {
|
|
763
|
+
sampleRate = 44100;
|
|
764
|
+
}
|
|
765
|
+
if (type === void 0) {
|
|
766
|
+
type = "power";
|
|
767
|
+
}
|
|
768
|
+
if (width === void 0) {
|
|
769
|
+
width = 1;
|
|
770
|
+
}
|
|
771
|
+
return this.algorithms.ERBBands(spectrum, highFrequencyBound, inputSize, lowFrequencyBound, numberBands, sampleRate, type, width);
|
|
772
|
+
};
|
|
773
|
+
Essentia2.prototype.EffectiveDuration = function(signal, sampleRate, thresholdRatio) {
|
|
774
|
+
if (sampleRate === void 0) {
|
|
775
|
+
sampleRate = 44100;
|
|
776
|
+
}
|
|
777
|
+
if (thresholdRatio === void 0) {
|
|
778
|
+
thresholdRatio = 0.4;
|
|
779
|
+
}
|
|
780
|
+
return this.algorithms.EffectiveDuration(signal, sampleRate, thresholdRatio);
|
|
781
|
+
};
|
|
782
|
+
Essentia2.prototype.Energy = function(array) {
|
|
783
|
+
return this.algorithms.Energy(array);
|
|
784
|
+
};
|
|
785
|
+
Essentia2.prototype.EnergyBand = function(spectrum, sampleRate, startCutoffFrequency, stopCutoffFrequency) {
|
|
786
|
+
if (sampleRate === void 0) {
|
|
787
|
+
sampleRate = 44100;
|
|
788
|
+
}
|
|
789
|
+
if (startCutoffFrequency === void 0) {
|
|
790
|
+
startCutoffFrequency = 0;
|
|
791
|
+
}
|
|
792
|
+
if (stopCutoffFrequency === void 0) {
|
|
793
|
+
stopCutoffFrequency = 100;
|
|
794
|
+
}
|
|
795
|
+
return this.algorithms.EnergyBand(spectrum, sampleRate, startCutoffFrequency, stopCutoffFrequency);
|
|
796
|
+
};
|
|
797
|
+
Essentia2.prototype.EnergyBandRatio = function(spectrum, sampleRate, startFrequency, stopFrequency) {
|
|
798
|
+
if (sampleRate === void 0) {
|
|
799
|
+
sampleRate = 44100;
|
|
800
|
+
}
|
|
801
|
+
if (startFrequency === void 0) {
|
|
802
|
+
startFrequency = 0;
|
|
803
|
+
}
|
|
804
|
+
if (stopFrequency === void 0) {
|
|
805
|
+
stopFrequency = 100;
|
|
806
|
+
}
|
|
807
|
+
return this.algorithms.EnergyBandRatio(spectrum, sampleRate, startFrequency, stopFrequency);
|
|
808
|
+
};
|
|
809
|
+
Essentia2.prototype.Entropy = function(array) {
|
|
810
|
+
return this.algorithms.Entropy(array);
|
|
811
|
+
};
|
|
812
|
+
Essentia2.prototype.Envelope = function(signal, applyRectification, attackTime, releaseTime, sampleRate) {
|
|
813
|
+
if (applyRectification === void 0) {
|
|
814
|
+
applyRectification = true;
|
|
815
|
+
}
|
|
816
|
+
if (attackTime === void 0) {
|
|
817
|
+
attackTime = 10;
|
|
818
|
+
}
|
|
819
|
+
if (releaseTime === void 0) {
|
|
820
|
+
releaseTime = 1500;
|
|
821
|
+
}
|
|
822
|
+
if (sampleRate === void 0) {
|
|
823
|
+
sampleRate = 44100;
|
|
824
|
+
}
|
|
825
|
+
return this.algorithms.Envelope(signal, applyRectification, attackTime, releaseTime, sampleRate);
|
|
826
|
+
};
|
|
827
|
+
Essentia2.prototype.EqualLoudness = function(signal, sampleRate) {
|
|
828
|
+
if (sampleRate === void 0) {
|
|
829
|
+
sampleRate = 44100;
|
|
830
|
+
}
|
|
831
|
+
return this.algorithms.EqualLoudness(signal, sampleRate);
|
|
832
|
+
};
|
|
833
|
+
Essentia2.prototype.Flatness = function(array) {
|
|
834
|
+
return this.algorithms.Flatness(array);
|
|
835
|
+
};
|
|
836
|
+
Essentia2.prototype.FlatnessDB = function(array) {
|
|
837
|
+
return this.algorithms.FlatnessDB(array);
|
|
838
|
+
};
|
|
839
|
+
Essentia2.prototype.FlatnessSFX = function(envelope) {
|
|
840
|
+
return this.algorithms.FlatnessSFX(envelope);
|
|
841
|
+
};
|
|
842
|
+
Essentia2.prototype.Flux = function(spectrum, halfRectify, norm) {
|
|
843
|
+
if (halfRectify === void 0) {
|
|
844
|
+
halfRectify = false;
|
|
845
|
+
}
|
|
846
|
+
if (norm === void 0) {
|
|
847
|
+
norm = "L2";
|
|
848
|
+
}
|
|
849
|
+
return this.algorithms.Flux(spectrum, halfRectify, norm);
|
|
850
|
+
};
|
|
851
|
+
Essentia2.prototype.FrameCutter = function(signal, frameSize, hopSize, lastFrameToEndOfFile, startFromZero, validFrameThresholdRatio) {
|
|
852
|
+
if (frameSize === void 0) {
|
|
853
|
+
frameSize = 1024;
|
|
854
|
+
}
|
|
855
|
+
if (hopSize === void 0) {
|
|
856
|
+
hopSize = 512;
|
|
857
|
+
}
|
|
858
|
+
if (lastFrameToEndOfFile === void 0) {
|
|
859
|
+
lastFrameToEndOfFile = false;
|
|
860
|
+
}
|
|
861
|
+
if (startFromZero === void 0) {
|
|
862
|
+
startFromZero = false;
|
|
863
|
+
}
|
|
864
|
+
if (validFrameThresholdRatio === void 0) {
|
|
865
|
+
validFrameThresholdRatio = 0;
|
|
866
|
+
}
|
|
867
|
+
return this.algorithms.FrameCutter(signal, frameSize, hopSize, lastFrameToEndOfFile, startFromZero, validFrameThresholdRatio);
|
|
868
|
+
};
|
|
869
|
+
Essentia2.prototype.FrameToReal = function(signal, frameSize, hopSize) {
|
|
870
|
+
if (frameSize === void 0) {
|
|
871
|
+
frameSize = 2048;
|
|
872
|
+
}
|
|
873
|
+
if (hopSize === void 0) {
|
|
874
|
+
hopSize = 128;
|
|
875
|
+
}
|
|
876
|
+
return this.algorithms.FrameToReal(signal, frameSize, hopSize);
|
|
877
|
+
};
|
|
878
|
+
Essentia2.prototype.FrequencyBands = function(spectrum, frequencyBands, sampleRate) {
|
|
879
|
+
if (frequencyBands === void 0) {
|
|
880
|
+
frequencyBands = [0, 50, 100, 150, 200, 300, 400, 510, 630, 770, 920, 1080, 1270, 1480, 1720, 2e3, 2320, 2700, 3150, 3700, 4400, 5300, 6400, 7700, 9500, 12e3, 15500, 20500, 27e3];
|
|
881
|
+
}
|
|
882
|
+
if (sampleRate === void 0) {
|
|
883
|
+
sampleRate = 44100;
|
|
884
|
+
}
|
|
885
|
+
var vecfrequencyBands = new this.module.VectorFloat();
|
|
886
|
+
for (var i = 0; i < vecfrequencyBands.size(); i++) {
|
|
887
|
+
vecfrequencyBands.push_back(frequencyBands[i]);
|
|
888
|
+
}
|
|
889
|
+
return this.algorithms.FrequencyBands(spectrum, vecfrequencyBands, sampleRate);
|
|
890
|
+
};
|
|
891
|
+
Essentia2.prototype.GFCC = function(spectrum, dctType, highFrequencyBound, inputSize, logType, lowFrequencyBound, numberBands, numberCoefficients, sampleRate, silenceThreshold, type) {
|
|
892
|
+
if (dctType === void 0) {
|
|
893
|
+
dctType = 2;
|
|
894
|
+
}
|
|
895
|
+
if (highFrequencyBound === void 0) {
|
|
896
|
+
highFrequencyBound = 22050;
|
|
897
|
+
}
|
|
898
|
+
if (inputSize === void 0) {
|
|
899
|
+
inputSize = 1025;
|
|
900
|
+
}
|
|
901
|
+
if (logType === void 0) {
|
|
902
|
+
logType = "dbamp";
|
|
903
|
+
}
|
|
904
|
+
if (lowFrequencyBound === void 0) {
|
|
905
|
+
lowFrequencyBound = 40;
|
|
906
|
+
}
|
|
907
|
+
if (numberBands === void 0) {
|
|
908
|
+
numberBands = 40;
|
|
909
|
+
}
|
|
910
|
+
if (numberCoefficients === void 0) {
|
|
911
|
+
numberCoefficients = 13;
|
|
912
|
+
}
|
|
913
|
+
if (sampleRate === void 0) {
|
|
914
|
+
sampleRate = 44100;
|
|
915
|
+
}
|
|
916
|
+
if (silenceThreshold === void 0) {
|
|
917
|
+
silenceThreshold = 1e-10;
|
|
918
|
+
}
|
|
919
|
+
if (type === void 0) {
|
|
920
|
+
type = "power";
|
|
921
|
+
}
|
|
922
|
+
return this.algorithms.GFCC(spectrum, dctType, highFrequencyBound, inputSize, logType, lowFrequencyBound, numberBands, numberCoefficients, sampleRate, silenceThreshold, type);
|
|
923
|
+
};
|
|
924
|
+
Essentia2.prototype.GapsDetector = function(frame, attackTime, frameSize, hopSize, kernelSize, maximumTime, minimumTime, postpowerTime, prepowerThreshold, prepowerTime, releaseTime, sampleRate, silenceThreshold) {
|
|
925
|
+
if (attackTime === void 0) {
|
|
926
|
+
attackTime = 0.05;
|
|
927
|
+
}
|
|
928
|
+
if (frameSize === void 0) {
|
|
929
|
+
frameSize = 2048;
|
|
930
|
+
}
|
|
931
|
+
if (hopSize === void 0) {
|
|
932
|
+
hopSize = 1024;
|
|
933
|
+
}
|
|
934
|
+
if (kernelSize === void 0) {
|
|
935
|
+
kernelSize = 11;
|
|
936
|
+
}
|
|
937
|
+
if (maximumTime === void 0) {
|
|
938
|
+
maximumTime = 3500;
|
|
939
|
+
}
|
|
940
|
+
if (minimumTime === void 0) {
|
|
941
|
+
minimumTime = 10;
|
|
942
|
+
}
|
|
943
|
+
if (postpowerTime === void 0) {
|
|
944
|
+
postpowerTime = 40;
|
|
945
|
+
}
|
|
946
|
+
if (prepowerThreshold === void 0) {
|
|
947
|
+
prepowerThreshold = -30;
|
|
948
|
+
}
|
|
949
|
+
if (prepowerTime === void 0) {
|
|
950
|
+
prepowerTime = 40;
|
|
951
|
+
}
|
|
952
|
+
if (releaseTime === void 0) {
|
|
953
|
+
releaseTime = 0.05;
|
|
954
|
+
}
|
|
955
|
+
if (sampleRate === void 0) {
|
|
956
|
+
sampleRate = 44100;
|
|
957
|
+
}
|
|
958
|
+
if (silenceThreshold === void 0) {
|
|
959
|
+
silenceThreshold = -50;
|
|
960
|
+
}
|
|
961
|
+
return this.algorithms.GapsDetector(frame, attackTime, frameSize, hopSize, kernelSize, maximumTime, minimumTime, postpowerTime, prepowerThreshold, prepowerTime, releaseTime, sampleRate, silenceThreshold);
|
|
962
|
+
};
|
|
963
|
+
Essentia2.prototype.GeometricMean = function(array) {
|
|
964
|
+
return this.algorithms.GeometricMean(array);
|
|
965
|
+
};
|
|
966
|
+
Essentia2.prototype.HFC = function(spectrum, sampleRate, type) {
|
|
967
|
+
if (sampleRate === void 0) {
|
|
968
|
+
sampleRate = 44100;
|
|
969
|
+
}
|
|
970
|
+
if (type === void 0) {
|
|
971
|
+
type = "Masri";
|
|
972
|
+
}
|
|
973
|
+
return this.algorithms.HFC(spectrum, sampleRate, type);
|
|
974
|
+
};
|
|
975
|
+
Essentia2.prototype.HPCP = function(frequencies, magnitudes, bandPreset, bandSplitFrequency, harmonics, maxFrequency, maxShifted, minFrequency, nonLinear, normalized, referenceFrequency, sampleRate, size, weightType, windowSize) {
|
|
976
|
+
if (bandPreset === void 0) {
|
|
977
|
+
bandPreset = true;
|
|
978
|
+
}
|
|
979
|
+
if (bandSplitFrequency === void 0) {
|
|
980
|
+
bandSplitFrequency = 500;
|
|
981
|
+
}
|
|
982
|
+
if (harmonics === void 0) {
|
|
983
|
+
harmonics = 0;
|
|
984
|
+
}
|
|
985
|
+
if (maxFrequency === void 0) {
|
|
986
|
+
maxFrequency = 5e3;
|
|
987
|
+
}
|
|
988
|
+
if (maxShifted === void 0) {
|
|
989
|
+
maxShifted = false;
|
|
990
|
+
}
|
|
991
|
+
if (minFrequency === void 0) {
|
|
992
|
+
minFrequency = 40;
|
|
993
|
+
}
|
|
994
|
+
if (nonLinear === void 0) {
|
|
995
|
+
nonLinear = false;
|
|
996
|
+
}
|
|
997
|
+
if (normalized === void 0) {
|
|
998
|
+
normalized = "unitMax";
|
|
999
|
+
}
|
|
1000
|
+
if (referenceFrequency === void 0) {
|
|
1001
|
+
referenceFrequency = 440;
|
|
1002
|
+
}
|
|
1003
|
+
if (sampleRate === void 0) {
|
|
1004
|
+
sampleRate = 44100;
|
|
1005
|
+
}
|
|
1006
|
+
if (size === void 0) {
|
|
1007
|
+
size = 12;
|
|
1008
|
+
}
|
|
1009
|
+
if (weightType === void 0) {
|
|
1010
|
+
weightType = "squaredCosine";
|
|
1011
|
+
}
|
|
1012
|
+
if (windowSize === void 0) {
|
|
1013
|
+
windowSize = 1;
|
|
1014
|
+
}
|
|
1015
|
+
return this.algorithms.HPCP(frequencies, magnitudes, bandPreset, bandSplitFrequency, harmonics, maxFrequency, maxShifted, minFrequency, nonLinear, normalized, referenceFrequency, sampleRate, size, weightType, windowSize);
|
|
1016
|
+
};
|
|
1017
|
+
Essentia2.prototype.HarmonicBpm = function(bpms, bpm, threshold, tolerance) {
|
|
1018
|
+
if (bpm === void 0) {
|
|
1019
|
+
bpm = 60;
|
|
1020
|
+
}
|
|
1021
|
+
if (threshold === void 0) {
|
|
1022
|
+
threshold = 20;
|
|
1023
|
+
}
|
|
1024
|
+
if (tolerance === void 0) {
|
|
1025
|
+
tolerance = 5;
|
|
1026
|
+
}
|
|
1027
|
+
return this.algorithms.HarmonicBpm(bpms, bpm, threshold, tolerance);
|
|
1028
|
+
};
|
|
1029
|
+
Essentia2.prototype.HarmonicPeaks = function(frequencies, magnitudes, pitch, maxHarmonics, tolerance) {
|
|
1030
|
+
if (maxHarmonics === void 0) {
|
|
1031
|
+
maxHarmonics = 20;
|
|
1032
|
+
}
|
|
1033
|
+
if (tolerance === void 0) {
|
|
1034
|
+
tolerance = 0.2;
|
|
1035
|
+
}
|
|
1036
|
+
return this.algorithms.HarmonicPeaks(frequencies, magnitudes, pitch, maxHarmonics, tolerance);
|
|
1037
|
+
};
|
|
1038
|
+
Essentia2.prototype.HighPass = function(signal, cutoffFrequency, sampleRate) {
|
|
1039
|
+
if (cutoffFrequency === void 0) {
|
|
1040
|
+
cutoffFrequency = 1500;
|
|
1041
|
+
}
|
|
1042
|
+
if (sampleRate === void 0) {
|
|
1043
|
+
sampleRate = 44100;
|
|
1044
|
+
}
|
|
1045
|
+
return this.algorithms.HighPass(signal, cutoffFrequency, sampleRate);
|
|
1046
|
+
};
|
|
1047
|
+
Essentia2.prototype.HighResolutionFeatures = function(hpcp, maxPeaks) {
|
|
1048
|
+
if (maxPeaks === void 0) {
|
|
1049
|
+
maxPeaks = 24;
|
|
1050
|
+
}
|
|
1051
|
+
return this.algorithms.HighResolutionFeatures(hpcp, maxPeaks);
|
|
1052
|
+
};
|
|
1053
|
+
Essentia2.prototype.Histogram = function(array, maxValue, minValue, normalize, numberBins) {
|
|
1054
|
+
if (maxValue === void 0) {
|
|
1055
|
+
maxValue = 1;
|
|
1056
|
+
}
|
|
1057
|
+
if (minValue === void 0) {
|
|
1058
|
+
minValue = 0;
|
|
1059
|
+
}
|
|
1060
|
+
if (normalize === void 0) {
|
|
1061
|
+
normalize = "none";
|
|
1062
|
+
}
|
|
1063
|
+
if (numberBins === void 0) {
|
|
1064
|
+
numberBins = 10;
|
|
1065
|
+
}
|
|
1066
|
+
return this.algorithms.Histogram(array, maxValue, minValue, normalize, numberBins);
|
|
1067
|
+
};
|
|
1068
|
+
Essentia2.prototype.HprModelAnal = function(frame, pitch, fftSize, freqDevOffset, freqDevSlope, harmDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, nHarmonics, orderBy, sampleRate, stocf) {
|
|
1069
|
+
if (fftSize === void 0) {
|
|
1070
|
+
fftSize = 2048;
|
|
1071
|
+
}
|
|
1072
|
+
if (freqDevOffset === void 0) {
|
|
1073
|
+
freqDevOffset = 20;
|
|
1074
|
+
}
|
|
1075
|
+
if (freqDevSlope === void 0) {
|
|
1076
|
+
freqDevSlope = 0.01;
|
|
1077
|
+
}
|
|
1078
|
+
if (harmDevSlope === void 0) {
|
|
1079
|
+
harmDevSlope = 0.01;
|
|
1080
|
+
}
|
|
1081
|
+
if (hopSize === void 0) {
|
|
1082
|
+
hopSize = 512;
|
|
1083
|
+
}
|
|
1084
|
+
if (magnitudeThreshold === void 0) {
|
|
1085
|
+
magnitudeThreshold = 0;
|
|
1086
|
+
}
|
|
1087
|
+
if (maxFrequency === void 0) {
|
|
1088
|
+
maxFrequency = 5e3;
|
|
1089
|
+
}
|
|
1090
|
+
if (maxPeaks === void 0) {
|
|
1091
|
+
maxPeaks = 100;
|
|
1092
|
+
}
|
|
1093
|
+
if (maxnSines === void 0) {
|
|
1094
|
+
maxnSines = 100;
|
|
1095
|
+
}
|
|
1096
|
+
if (minFrequency === void 0) {
|
|
1097
|
+
minFrequency = 20;
|
|
1098
|
+
}
|
|
1099
|
+
if (nHarmonics === void 0) {
|
|
1100
|
+
nHarmonics = 100;
|
|
1101
|
+
}
|
|
1102
|
+
if (orderBy === void 0) {
|
|
1103
|
+
orderBy = "frequency";
|
|
1104
|
+
}
|
|
1105
|
+
if (sampleRate === void 0) {
|
|
1106
|
+
sampleRate = 44100;
|
|
1107
|
+
}
|
|
1108
|
+
if (stocf === void 0) {
|
|
1109
|
+
stocf = 0.2;
|
|
1110
|
+
}
|
|
1111
|
+
return this.algorithms.HprModelAnal(frame, pitch, fftSize, freqDevOffset, freqDevSlope, harmDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, nHarmonics, orderBy, sampleRate, stocf);
|
|
1112
|
+
};
|
|
1113
|
+
Essentia2.prototype.HpsModelAnal = function(frame, pitch, fftSize, freqDevOffset, freqDevSlope, harmDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, nHarmonics, orderBy, sampleRate, stocf) {
|
|
1114
|
+
if (fftSize === void 0) {
|
|
1115
|
+
fftSize = 2048;
|
|
1116
|
+
}
|
|
1117
|
+
if (freqDevOffset === void 0) {
|
|
1118
|
+
freqDevOffset = 20;
|
|
1119
|
+
}
|
|
1120
|
+
if (freqDevSlope === void 0) {
|
|
1121
|
+
freqDevSlope = 0.01;
|
|
1122
|
+
}
|
|
1123
|
+
if (harmDevSlope === void 0) {
|
|
1124
|
+
harmDevSlope = 0.01;
|
|
1125
|
+
}
|
|
1126
|
+
if (hopSize === void 0) {
|
|
1127
|
+
hopSize = 512;
|
|
1128
|
+
}
|
|
1129
|
+
if (magnitudeThreshold === void 0) {
|
|
1130
|
+
magnitudeThreshold = 0;
|
|
1131
|
+
}
|
|
1132
|
+
if (maxFrequency === void 0) {
|
|
1133
|
+
maxFrequency = 5e3;
|
|
1134
|
+
}
|
|
1135
|
+
if (maxPeaks === void 0) {
|
|
1136
|
+
maxPeaks = 100;
|
|
1137
|
+
}
|
|
1138
|
+
if (maxnSines === void 0) {
|
|
1139
|
+
maxnSines = 100;
|
|
1140
|
+
}
|
|
1141
|
+
if (minFrequency === void 0) {
|
|
1142
|
+
minFrequency = 20;
|
|
1143
|
+
}
|
|
1144
|
+
if (nHarmonics === void 0) {
|
|
1145
|
+
nHarmonics = 100;
|
|
1146
|
+
}
|
|
1147
|
+
if (orderBy === void 0) {
|
|
1148
|
+
orderBy = "frequency";
|
|
1149
|
+
}
|
|
1150
|
+
if (sampleRate === void 0) {
|
|
1151
|
+
sampleRate = 44100;
|
|
1152
|
+
}
|
|
1153
|
+
if (stocf === void 0) {
|
|
1154
|
+
stocf = 0.2;
|
|
1155
|
+
}
|
|
1156
|
+
return this.algorithms.HpsModelAnal(frame, pitch, fftSize, freqDevOffset, freqDevSlope, harmDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, nHarmonics, orderBy, sampleRate, stocf);
|
|
1157
|
+
};
|
|
1158
|
+
Essentia2.prototype.IDCT = function(dct, dctType, inputSize, liftering, outputSize) {
|
|
1159
|
+
if (dctType === void 0) {
|
|
1160
|
+
dctType = 2;
|
|
1161
|
+
}
|
|
1162
|
+
if (inputSize === void 0) {
|
|
1163
|
+
inputSize = 10;
|
|
1164
|
+
}
|
|
1165
|
+
if (liftering === void 0) {
|
|
1166
|
+
liftering = 0;
|
|
1167
|
+
}
|
|
1168
|
+
if (outputSize === void 0) {
|
|
1169
|
+
outputSize = 10;
|
|
1170
|
+
}
|
|
1171
|
+
return this.algorithms.IDCT(dct, dctType, inputSize, liftering, outputSize);
|
|
1172
|
+
};
|
|
1173
|
+
Essentia2.prototype.IIR = function(signal, denominator, numerator) {
|
|
1174
|
+
if (denominator === void 0) {
|
|
1175
|
+
denominator = [1];
|
|
1176
|
+
}
|
|
1177
|
+
if (numerator === void 0) {
|
|
1178
|
+
numerator = [1];
|
|
1179
|
+
}
|
|
1180
|
+
var vecdenominator = new this.module.VectorFloat();
|
|
1181
|
+
for (var i = 0; i < vecdenominator.size(); i++) {
|
|
1182
|
+
vecdenominator.push_back(denominator[i]);
|
|
1183
|
+
}
|
|
1184
|
+
var vecnumerator = new this.module.VectorFloat();
|
|
1185
|
+
for (var i = 0; i < vecnumerator.size(); i++) {
|
|
1186
|
+
vecnumerator.push_back(numerator[i]);
|
|
1187
|
+
}
|
|
1188
|
+
return this.algorithms.IIR(signal, vecdenominator, vecnumerator);
|
|
1189
|
+
};
|
|
1190
|
+
Essentia2.prototype.Inharmonicity = function(frequencies, magnitudes) {
|
|
1191
|
+
return this.algorithms.Inharmonicity(frequencies, magnitudes);
|
|
1192
|
+
};
|
|
1193
|
+
Essentia2.prototype.InstantPower = function(array) {
|
|
1194
|
+
return this.algorithms.InstantPower(array);
|
|
1195
|
+
};
|
|
1196
|
+
Essentia2.prototype.Intensity = function(signal, sampleRate) {
|
|
1197
|
+
if (sampleRate === void 0) {
|
|
1198
|
+
sampleRate = 44100;
|
|
1199
|
+
}
|
|
1200
|
+
return this.algorithms.Intensity(signal, sampleRate);
|
|
1201
|
+
};
|
|
1202
|
+
Essentia2.prototype.Key = function(pcp, numHarmonics, pcpSize, profileType, slope, useMajMin, usePolyphony, useThreeChords) {
|
|
1203
|
+
if (numHarmonics === void 0) {
|
|
1204
|
+
numHarmonics = 4;
|
|
1205
|
+
}
|
|
1206
|
+
if (pcpSize === void 0) {
|
|
1207
|
+
pcpSize = 36;
|
|
1208
|
+
}
|
|
1209
|
+
if (profileType === void 0) {
|
|
1210
|
+
profileType = "bgate";
|
|
1211
|
+
}
|
|
1212
|
+
if (slope === void 0) {
|
|
1213
|
+
slope = 0.6;
|
|
1214
|
+
}
|
|
1215
|
+
if (useMajMin === void 0) {
|
|
1216
|
+
useMajMin = false;
|
|
1217
|
+
}
|
|
1218
|
+
if (usePolyphony === void 0) {
|
|
1219
|
+
usePolyphony = true;
|
|
1220
|
+
}
|
|
1221
|
+
if (useThreeChords === void 0) {
|
|
1222
|
+
useThreeChords = true;
|
|
1223
|
+
}
|
|
1224
|
+
return this.algorithms.Key(pcp, numHarmonics, pcpSize, profileType, slope, useMajMin, usePolyphony, useThreeChords);
|
|
1225
|
+
};
|
|
1226
|
+
Essentia2.prototype.KeyExtractor = function(audio, averageDetuningCorrection, frameSize, hopSize, hpcpSize, maxFrequency, maximumSpectralPeaks, minFrequency, pcpThreshold, profileType, sampleRate, spectralPeaksThreshold, tuningFrequency, weightType, windowType) {
|
|
1227
|
+
if (averageDetuningCorrection === void 0) {
|
|
1228
|
+
averageDetuningCorrection = true;
|
|
1229
|
+
}
|
|
1230
|
+
if (frameSize === void 0) {
|
|
1231
|
+
frameSize = 4096;
|
|
1232
|
+
}
|
|
1233
|
+
if (hopSize === void 0) {
|
|
1234
|
+
hopSize = 4096;
|
|
1235
|
+
}
|
|
1236
|
+
if (hpcpSize === void 0) {
|
|
1237
|
+
hpcpSize = 12;
|
|
1238
|
+
}
|
|
1239
|
+
if (maxFrequency === void 0) {
|
|
1240
|
+
maxFrequency = 3500;
|
|
1241
|
+
}
|
|
1242
|
+
if (maximumSpectralPeaks === void 0) {
|
|
1243
|
+
maximumSpectralPeaks = 60;
|
|
1244
|
+
}
|
|
1245
|
+
if (minFrequency === void 0) {
|
|
1246
|
+
minFrequency = 25;
|
|
1247
|
+
}
|
|
1248
|
+
if (pcpThreshold === void 0) {
|
|
1249
|
+
pcpThreshold = 0.2;
|
|
1250
|
+
}
|
|
1251
|
+
if (profileType === void 0) {
|
|
1252
|
+
profileType = "bgate";
|
|
1253
|
+
}
|
|
1254
|
+
if (sampleRate === void 0) {
|
|
1255
|
+
sampleRate = 44100;
|
|
1256
|
+
}
|
|
1257
|
+
if (spectralPeaksThreshold === void 0) {
|
|
1258
|
+
spectralPeaksThreshold = 1e-4;
|
|
1259
|
+
}
|
|
1260
|
+
if (tuningFrequency === void 0) {
|
|
1261
|
+
tuningFrequency = 440;
|
|
1262
|
+
}
|
|
1263
|
+
if (weightType === void 0) {
|
|
1264
|
+
weightType = "cosine";
|
|
1265
|
+
}
|
|
1266
|
+
if (windowType === void 0) {
|
|
1267
|
+
windowType = "hann";
|
|
1268
|
+
}
|
|
1269
|
+
return this.algorithms.KeyExtractor(audio, averageDetuningCorrection, frameSize, hopSize, hpcpSize, maxFrequency, maximumSpectralPeaks, minFrequency, pcpThreshold, profileType, sampleRate, spectralPeaksThreshold, tuningFrequency, weightType, windowType);
|
|
1270
|
+
};
|
|
1271
|
+
Essentia2.prototype.LPC = function(frame, order, sampleRate, type) {
|
|
1272
|
+
if (order === void 0) {
|
|
1273
|
+
order = 10;
|
|
1274
|
+
}
|
|
1275
|
+
if (sampleRate === void 0) {
|
|
1276
|
+
sampleRate = 44100;
|
|
1277
|
+
}
|
|
1278
|
+
if (type === void 0) {
|
|
1279
|
+
type = "regular";
|
|
1280
|
+
}
|
|
1281
|
+
return this.algorithms.LPC(frame, order, sampleRate, type);
|
|
1282
|
+
};
|
|
1283
|
+
Essentia2.prototype.Larm = function(signal, attackTime, power, releaseTime, sampleRate) {
|
|
1284
|
+
if (attackTime === void 0) {
|
|
1285
|
+
attackTime = 10;
|
|
1286
|
+
}
|
|
1287
|
+
if (power === void 0) {
|
|
1288
|
+
power = 1.5;
|
|
1289
|
+
}
|
|
1290
|
+
if (releaseTime === void 0) {
|
|
1291
|
+
releaseTime = 1500;
|
|
1292
|
+
}
|
|
1293
|
+
if (sampleRate === void 0) {
|
|
1294
|
+
sampleRate = 44100;
|
|
1295
|
+
}
|
|
1296
|
+
return this.algorithms.Larm(signal, attackTime, power, releaseTime, sampleRate);
|
|
1297
|
+
};
|
|
1298
|
+
Essentia2.prototype.Leq = function(signal) {
|
|
1299
|
+
return this.algorithms.Leq(signal);
|
|
1300
|
+
};
|
|
1301
|
+
Essentia2.prototype.LevelExtractor = function(signal, frameSize, hopSize) {
|
|
1302
|
+
if (frameSize === void 0) {
|
|
1303
|
+
frameSize = 88200;
|
|
1304
|
+
}
|
|
1305
|
+
if (hopSize === void 0) {
|
|
1306
|
+
hopSize = 44100;
|
|
1307
|
+
}
|
|
1308
|
+
return this.algorithms.LevelExtractor(signal, frameSize, hopSize);
|
|
1309
|
+
};
|
|
1310
|
+
Essentia2.prototype.LogAttackTime = function(signal, sampleRate, startAttackThreshold, stopAttackThreshold) {
|
|
1311
|
+
if (sampleRate === void 0) {
|
|
1312
|
+
sampleRate = 44100;
|
|
1313
|
+
}
|
|
1314
|
+
if (startAttackThreshold === void 0) {
|
|
1315
|
+
startAttackThreshold = 0.2;
|
|
1316
|
+
}
|
|
1317
|
+
if (stopAttackThreshold === void 0) {
|
|
1318
|
+
stopAttackThreshold = 0.9;
|
|
1319
|
+
}
|
|
1320
|
+
return this.algorithms.LogAttackTime(signal, sampleRate, startAttackThreshold, stopAttackThreshold);
|
|
1321
|
+
};
|
|
1322
|
+
Essentia2.prototype.LogSpectrum = function(spectrum, binsPerSemitone, frameSize, rollOn, sampleRate) {
|
|
1323
|
+
if (binsPerSemitone === void 0) {
|
|
1324
|
+
binsPerSemitone = 3;
|
|
1325
|
+
}
|
|
1326
|
+
if (frameSize === void 0) {
|
|
1327
|
+
frameSize = 1025;
|
|
1328
|
+
}
|
|
1329
|
+
if (rollOn === void 0) {
|
|
1330
|
+
rollOn = 0;
|
|
1331
|
+
}
|
|
1332
|
+
if (sampleRate === void 0) {
|
|
1333
|
+
sampleRate = 44100;
|
|
1334
|
+
}
|
|
1335
|
+
return this.algorithms.LogSpectrum(spectrum, binsPerSemitone, frameSize, rollOn, sampleRate);
|
|
1336
|
+
};
|
|
1337
|
+
Essentia2.prototype.LoopBpmConfidence = function(signal, bpmEstimate, sampleRate) {
|
|
1338
|
+
if (sampleRate === void 0) {
|
|
1339
|
+
sampleRate = 44100;
|
|
1340
|
+
}
|
|
1341
|
+
return this.algorithms.LoopBpmConfidence(signal, bpmEstimate, sampleRate);
|
|
1342
|
+
};
|
|
1343
|
+
Essentia2.prototype.LoopBpmEstimator = function(signal, confidenceThreshold) {
|
|
1344
|
+
if (confidenceThreshold === void 0) {
|
|
1345
|
+
confidenceThreshold = 0.95;
|
|
1346
|
+
}
|
|
1347
|
+
return this.algorithms.LoopBpmEstimator(signal, confidenceThreshold);
|
|
1348
|
+
};
|
|
1349
|
+
Essentia2.prototype.Loudness = function(signal) {
|
|
1350
|
+
return this.algorithms.Loudness(signal);
|
|
1351
|
+
};
|
|
1352
|
+
Essentia2.prototype.LoudnessVickers = function(signal, sampleRate) {
|
|
1353
|
+
if (sampleRate === void 0) {
|
|
1354
|
+
sampleRate = 44100;
|
|
1355
|
+
}
|
|
1356
|
+
return this.algorithms.LoudnessVickers(signal, sampleRate);
|
|
1357
|
+
};
|
|
1358
|
+
Essentia2.prototype.LowLevelSpectralEqloudExtractor = function(signal, frameSize, hopSize, sampleRate) {
|
|
1359
|
+
if (frameSize === void 0) {
|
|
1360
|
+
frameSize = 2048;
|
|
1361
|
+
}
|
|
1362
|
+
if (hopSize === void 0) {
|
|
1363
|
+
hopSize = 1024;
|
|
1364
|
+
}
|
|
1365
|
+
if (sampleRate === void 0) {
|
|
1366
|
+
sampleRate = 44100;
|
|
1367
|
+
}
|
|
1368
|
+
return this.algorithms.LowLevelSpectralEqloudExtractor(signal, frameSize, hopSize, sampleRate);
|
|
1369
|
+
};
|
|
1370
|
+
Essentia2.prototype.LowLevelSpectralExtractor = function(signal, frameSize, hopSize, sampleRate) {
|
|
1371
|
+
if (frameSize === void 0) {
|
|
1372
|
+
frameSize = 2048;
|
|
1373
|
+
}
|
|
1374
|
+
if (hopSize === void 0) {
|
|
1375
|
+
hopSize = 1024;
|
|
1376
|
+
}
|
|
1377
|
+
if (sampleRate === void 0) {
|
|
1378
|
+
sampleRate = 44100;
|
|
1379
|
+
}
|
|
1380
|
+
return this.algorithms.LowLevelSpectralExtractor(signal, frameSize, hopSize, sampleRate);
|
|
1381
|
+
};
|
|
1382
|
+
Essentia2.prototype.LowPass = function(signal, cutoffFrequency, sampleRate) {
|
|
1383
|
+
if (cutoffFrequency === void 0) {
|
|
1384
|
+
cutoffFrequency = 1500;
|
|
1385
|
+
}
|
|
1386
|
+
if (sampleRate === void 0) {
|
|
1387
|
+
sampleRate = 44100;
|
|
1388
|
+
}
|
|
1389
|
+
return this.algorithms.LowPass(signal, cutoffFrequency, sampleRate);
|
|
1390
|
+
};
|
|
1391
|
+
Essentia2.prototype.MFCC = function(spectrum, dctType, highFrequencyBound, inputSize, liftering, logType, lowFrequencyBound, normalize, numberBands, numberCoefficients, sampleRate, silenceThreshold, type, warpingFormula, weighting) {
|
|
1392
|
+
if (dctType === void 0) {
|
|
1393
|
+
dctType = 2;
|
|
1394
|
+
}
|
|
1395
|
+
if (highFrequencyBound === void 0) {
|
|
1396
|
+
highFrequencyBound = 11e3;
|
|
1397
|
+
}
|
|
1398
|
+
if (inputSize === void 0) {
|
|
1399
|
+
inputSize = 1025;
|
|
1400
|
+
}
|
|
1401
|
+
if (liftering === void 0) {
|
|
1402
|
+
liftering = 0;
|
|
1403
|
+
}
|
|
1404
|
+
if (logType === void 0) {
|
|
1405
|
+
logType = "dbamp";
|
|
1406
|
+
}
|
|
1407
|
+
if (lowFrequencyBound === void 0) {
|
|
1408
|
+
lowFrequencyBound = 0;
|
|
1409
|
+
}
|
|
1410
|
+
if (normalize === void 0) {
|
|
1411
|
+
normalize = "unit_sum";
|
|
1412
|
+
}
|
|
1413
|
+
if (numberBands === void 0) {
|
|
1414
|
+
numberBands = 40;
|
|
1415
|
+
}
|
|
1416
|
+
if (numberCoefficients === void 0) {
|
|
1417
|
+
numberCoefficients = 13;
|
|
1418
|
+
}
|
|
1419
|
+
if (sampleRate === void 0) {
|
|
1420
|
+
sampleRate = 44100;
|
|
1421
|
+
}
|
|
1422
|
+
if (silenceThreshold === void 0) {
|
|
1423
|
+
silenceThreshold = 1e-10;
|
|
1424
|
+
}
|
|
1425
|
+
if (type === void 0) {
|
|
1426
|
+
type = "power";
|
|
1427
|
+
}
|
|
1428
|
+
if (warpingFormula === void 0) {
|
|
1429
|
+
warpingFormula = "htkMel";
|
|
1430
|
+
}
|
|
1431
|
+
if (weighting === void 0) {
|
|
1432
|
+
weighting = "warping";
|
|
1433
|
+
}
|
|
1434
|
+
return this.algorithms.MFCC(spectrum, dctType, highFrequencyBound, inputSize, liftering, logType, lowFrequencyBound, normalize, numberBands, numberCoefficients, sampleRate, silenceThreshold, type, warpingFormula, weighting);
|
|
1435
|
+
};
|
|
1436
|
+
Essentia2.prototype.MaxFilter = function(signal, causal, width) {
|
|
1437
|
+
if (causal === void 0) {
|
|
1438
|
+
causal = true;
|
|
1439
|
+
}
|
|
1440
|
+
if (width === void 0) {
|
|
1441
|
+
width = 3;
|
|
1442
|
+
}
|
|
1443
|
+
return this.algorithms.MaxFilter(signal, causal, width);
|
|
1444
|
+
};
|
|
1445
|
+
Essentia2.prototype.MaxMagFreq = function(spectrum, sampleRate) {
|
|
1446
|
+
if (sampleRate === void 0) {
|
|
1447
|
+
sampleRate = 44100;
|
|
1448
|
+
}
|
|
1449
|
+
return this.algorithms.MaxMagFreq(spectrum, sampleRate);
|
|
1450
|
+
};
|
|
1451
|
+
Essentia2.prototype.MaxToTotal = function(envelope) {
|
|
1452
|
+
return this.algorithms.MaxToTotal(envelope);
|
|
1453
|
+
};
|
|
1454
|
+
Essentia2.prototype.Mean = function(array) {
|
|
1455
|
+
return this.algorithms.Mean(array);
|
|
1456
|
+
};
|
|
1457
|
+
Essentia2.prototype.Median = function(array) {
|
|
1458
|
+
return this.algorithms.Median(array);
|
|
1459
|
+
};
|
|
1460
|
+
Essentia2.prototype.MedianFilter = function(array, kernelSize) {
|
|
1461
|
+
if (kernelSize === void 0) {
|
|
1462
|
+
kernelSize = 11;
|
|
1463
|
+
}
|
|
1464
|
+
return this.algorithms.MedianFilter(array, kernelSize);
|
|
1465
|
+
};
|
|
1466
|
+
Essentia2.prototype.MelBands = function(spectrum, highFrequencyBound, inputSize, log, lowFrequencyBound, normalize, numberBands, sampleRate, type, warpingFormula, weighting) {
|
|
1467
|
+
if (highFrequencyBound === void 0) {
|
|
1468
|
+
highFrequencyBound = 22050;
|
|
1469
|
+
}
|
|
1470
|
+
if (inputSize === void 0) {
|
|
1471
|
+
inputSize = 1025;
|
|
1472
|
+
}
|
|
1473
|
+
if (log === void 0) {
|
|
1474
|
+
log = false;
|
|
1475
|
+
}
|
|
1476
|
+
if (lowFrequencyBound === void 0) {
|
|
1477
|
+
lowFrequencyBound = 0;
|
|
1478
|
+
}
|
|
1479
|
+
if (normalize === void 0) {
|
|
1480
|
+
normalize = "unit_sum";
|
|
1481
|
+
}
|
|
1482
|
+
if (numberBands === void 0) {
|
|
1483
|
+
numberBands = 24;
|
|
1484
|
+
}
|
|
1485
|
+
if (sampleRate === void 0) {
|
|
1486
|
+
sampleRate = 44100;
|
|
1487
|
+
}
|
|
1488
|
+
if (type === void 0) {
|
|
1489
|
+
type = "power";
|
|
1490
|
+
}
|
|
1491
|
+
if (warpingFormula === void 0) {
|
|
1492
|
+
warpingFormula = "htkMel";
|
|
1493
|
+
}
|
|
1494
|
+
if (weighting === void 0) {
|
|
1495
|
+
weighting = "warping";
|
|
1496
|
+
}
|
|
1497
|
+
return this.algorithms.MelBands(spectrum, highFrequencyBound, inputSize, log, lowFrequencyBound, normalize, numberBands, sampleRate, type, warpingFormula, weighting);
|
|
1498
|
+
};
|
|
1499
|
+
Essentia2.prototype.Meter = function(beatogram) {
|
|
1500
|
+
return this.algorithms.Meter(beatogram);
|
|
1501
|
+
};
|
|
1502
|
+
Essentia2.prototype.MinMax = function(array, type) {
|
|
1503
|
+
if (type === void 0) {
|
|
1504
|
+
type = "min";
|
|
1505
|
+
}
|
|
1506
|
+
return this.algorithms.MinMax(array, type);
|
|
1507
|
+
};
|
|
1508
|
+
Essentia2.prototype.MinToTotal = function(envelope) {
|
|
1509
|
+
return this.algorithms.MinToTotal(envelope);
|
|
1510
|
+
};
|
|
1511
|
+
Essentia2.prototype.MovingAverage = function(signal, size) {
|
|
1512
|
+
if (size === void 0) {
|
|
1513
|
+
size = 6;
|
|
1514
|
+
}
|
|
1515
|
+
return this.algorithms.MovingAverage(signal, size);
|
|
1516
|
+
};
|
|
1517
|
+
Essentia2.prototype.MultiPitchKlapuri = function(signal, binResolution, frameSize, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minFrequency, numberHarmonics, referenceFrequency, sampleRate) {
|
|
1518
|
+
if (binResolution === void 0) {
|
|
1519
|
+
binResolution = 10;
|
|
1520
|
+
}
|
|
1521
|
+
if (frameSize === void 0) {
|
|
1522
|
+
frameSize = 2048;
|
|
1523
|
+
}
|
|
1524
|
+
if (harmonicWeight === void 0) {
|
|
1525
|
+
harmonicWeight = 0.8;
|
|
1526
|
+
}
|
|
1527
|
+
if (hopSize === void 0) {
|
|
1528
|
+
hopSize = 128;
|
|
1529
|
+
}
|
|
1530
|
+
if (magnitudeCompression === void 0) {
|
|
1531
|
+
magnitudeCompression = 1;
|
|
1532
|
+
}
|
|
1533
|
+
if (magnitudeThreshold === void 0) {
|
|
1534
|
+
magnitudeThreshold = 40;
|
|
1535
|
+
}
|
|
1536
|
+
if (maxFrequency === void 0) {
|
|
1537
|
+
maxFrequency = 1760;
|
|
1538
|
+
}
|
|
1539
|
+
if (minFrequency === void 0) {
|
|
1540
|
+
minFrequency = 80;
|
|
1541
|
+
}
|
|
1542
|
+
if (numberHarmonics === void 0) {
|
|
1543
|
+
numberHarmonics = 10;
|
|
1544
|
+
}
|
|
1545
|
+
if (referenceFrequency === void 0) {
|
|
1546
|
+
referenceFrequency = 55;
|
|
1547
|
+
}
|
|
1548
|
+
if (sampleRate === void 0) {
|
|
1549
|
+
sampleRate = 44100;
|
|
1550
|
+
}
|
|
1551
|
+
return this.algorithms.MultiPitchKlapuri(signal, binResolution, frameSize, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minFrequency, numberHarmonics, referenceFrequency, sampleRate);
|
|
1552
|
+
};
|
|
1553
|
+
Essentia2.prototype.MultiPitchMelodia = function(signal, binResolution, filterIterations, frameSize, guessUnvoiced, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minDuration, minFrequency, numberHarmonics, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, referenceFrequency, sampleRate, timeContinuity) {
|
|
1554
|
+
if (binResolution === void 0) {
|
|
1555
|
+
binResolution = 10;
|
|
1556
|
+
}
|
|
1557
|
+
if (filterIterations === void 0) {
|
|
1558
|
+
filterIterations = 3;
|
|
1559
|
+
}
|
|
1560
|
+
if (frameSize === void 0) {
|
|
1561
|
+
frameSize = 2048;
|
|
1562
|
+
}
|
|
1563
|
+
if (guessUnvoiced === void 0) {
|
|
1564
|
+
guessUnvoiced = false;
|
|
1565
|
+
}
|
|
1566
|
+
if (harmonicWeight === void 0) {
|
|
1567
|
+
harmonicWeight = 0.8;
|
|
1568
|
+
}
|
|
1569
|
+
if (hopSize === void 0) {
|
|
1570
|
+
hopSize = 128;
|
|
1571
|
+
}
|
|
1572
|
+
if (magnitudeCompression === void 0) {
|
|
1573
|
+
magnitudeCompression = 1;
|
|
1574
|
+
}
|
|
1575
|
+
if (magnitudeThreshold === void 0) {
|
|
1576
|
+
magnitudeThreshold = 40;
|
|
1577
|
+
}
|
|
1578
|
+
if (maxFrequency === void 0) {
|
|
1579
|
+
maxFrequency = 2e4;
|
|
1580
|
+
}
|
|
1581
|
+
if (minDuration === void 0) {
|
|
1582
|
+
minDuration = 100;
|
|
1583
|
+
}
|
|
1584
|
+
if (minFrequency === void 0) {
|
|
1585
|
+
minFrequency = 40;
|
|
1586
|
+
}
|
|
1587
|
+
if (numberHarmonics === void 0) {
|
|
1588
|
+
numberHarmonics = 20;
|
|
1589
|
+
}
|
|
1590
|
+
if (peakDistributionThreshold === void 0) {
|
|
1591
|
+
peakDistributionThreshold = 0.9;
|
|
1592
|
+
}
|
|
1593
|
+
if (peakFrameThreshold === void 0) {
|
|
1594
|
+
peakFrameThreshold = 0.9;
|
|
1595
|
+
}
|
|
1596
|
+
if (pitchContinuity === void 0) {
|
|
1597
|
+
pitchContinuity = 27.5625;
|
|
1598
|
+
}
|
|
1599
|
+
if (referenceFrequency === void 0) {
|
|
1600
|
+
referenceFrequency = 55;
|
|
1601
|
+
}
|
|
1602
|
+
if (sampleRate === void 0) {
|
|
1603
|
+
sampleRate = 44100;
|
|
1604
|
+
}
|
|
1605
|
+
if (timeContinuity === void 0) {
|
|
1606
|
+
timeContinuity = 100;
|
|
1607
|
+
}
|
|
1608
|
+
return this.algorithms.MultiPitchMelodia(signal, binResolution, filterIterations, frameSize, guessUnvoiced, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minDuration, minFrequency, numberHarmonics, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, referenceFrequency, sampleRate, timeContinuity);
|
|
1609
|
+
};
|
|
1610
|
+
Essentia2.prototype.Multiplexer = function(numberRealInputs, numberVectorRealInputs) {
|
|
1611
|
+
if (numberRealInputs === void 0) {
|
|
1612
|
+
numberRealInputs = 0;
|
|
1613
|
+
}
|
|
1614
|
+
if (numberVectorRealInputs === void 0) {
|
|
1615
|
+
numberVectorRealInputs = 0;
|
|
1616
|
+
}
|
|
1617
|
+
return this.algorithms.Multiplexer(numberRealInputs, numberVectorRealInputs);
|
|
1618
|
+
};
|
|
1619
|
+
Essentia2.prototype.NNLSChroma = function(logSpectrogram, meanTuning, localTuning, chromaNormalization, frameSize, sampleRate, spectralShape, spectralWhitening, tuningMode, useNNLS) {
|
|
1620
|
+
if (chromaNormalization === void 0) {
|
|
1621
|
+
chromaNormalization = "none";
|
|
1622
|
+
}
|
|
1623
|
+
if (frameSize === void 0) {
|
|
1624
|
+
frameSize = 1025;
|
|
1625
|
+
}
|
|
1626
|
+
if (sampleRate === void 0) {
|
|
1627
|
+
sampleRate = 44100;
|
|
1628
|
+
}
|
|
1629
|
+
if (spectralShape === void 0) {
|
|
1630
|
+
spectralShape = 0.7;
|
|
1631
|
+
}
|
|
1632
|
+
if (spectralWhitening === void 0) {
|
|
1633
|
+
spectralWhitening = 1;
|
|
1634
|
+
}
|
|
1635
|
+
if (tuningMode === void 0) {
|
|
1636
|
+
tuningMode = "global";
|
|
1637
|
+
}
|
|
1638
|
+
if (useNNLS === void 0) {
|
|
1639
|
+
useNNLS = true;
|
|
1640
|
+
}
|
|
1641
|
+
return this.algorithms.NNLSChroma(logSpectrogram, meanTuning, localTuning, chromaNormalization, frameSize, sampleRate, spectralShape, spectralWhitening, tuningMode, useNNLS);
|
|
1642
|
+
};
|
|
1643
|
+
Essentia2.prototype.NoiseAdder = function(signal, fixSeed, level) {
|
|
1644
|
+
if (fixSeed === void 0) {
|
|
1645
|
+
fixSeed = false;
|
|
1646
|
+
}
|
|
1647
|
+
if (level === void 0) {
|
|
1648
|
+
level = -100;
|
|
1649
|
+
}
|
|
1650
|
+
return this.algorithms.NoiseAdder(signal, fixSeed, level);
|
|
1651
|
+
};
|
|
1652
|
+
Essentia2.prototype.NoiseBurstDetector = function(frame, alpha, silenceThreshold, threshold) {
|
|
1653
|
+
if (alpha === void 0) {
|
|
1654
|
+
alpha = 0.9;
|
|
1655
|
+
}
|
|
1656
|
+
if (silenceThreshold === void 0) {
|
|
1657
|
+
silenceThreshold = -50;
|
|
1658
|
+
}
|
|
1659
|
+
if (threshold === void 0) {
|
|
1660
|
+
threshold = 8;
|
|
1661
|
+
}
|
|
1662
|
+
return this.algorithms.NoiseBurstDetector(frame, alpha, silenceThreshold, threshold);
|
|
1663
|
+
};
|
|
1664
|
+
Essentia2.prototype.NoveltyCurve = function(frequencyBands, frameRate, normalize, weightCurve, weightCurveType) {
|
|
1665
|
+
if (frameRate === void 0) {
|
|
1666
|
+
frameRate = 344.531;
|
|
1667
|
+
}
|
|
1668
|
+
if (normalize === void 0) {
|
|
1669
|
+
normalize = false;
|
|
1670
|
+
}
|
|
1671
|
+
if (weightCurve === void 0) {
|
|
1672
|
+
weightCurve = [];
|
|
1673
|
+
}
|
|
1674
|
+
if (weightCurveType === void 0) {
|
|
1675
|
+
weightCurveType = "hybrid";
|
|
1676
|
+
}
|
|
1677
|
+
var vecweightCurve = new this.module.VectorFloat();
|
|
1678
|
+
for (var i = 0; i < vecweightCurve.size(); i++) {
|
|
1679
|
+
vecweightCurve.push_back(weightCurve[i]);
|
|
1680
|
+
}
|
|
1681
|
+
return this.algorithms.NoveltyCurve(frequencyBands, frameRate, normalize, vecweightCurve, weightCurveType);
|
|
1682
|
+
};
|
|
1683
|
+
Essentia2.prototype.NoveltyCurveFixedBpmEstimator = function(novelty, hopSize, maxBpm, minBpm, sampleRate, tolerance) {
|
|
1684
|
+
if (hopSize === void 0) {
|
|
1685
|
+
hopSize = 512;
|
|
1686
|
+
}
|
|
1687
|
+
if (maxBpm === void 0) {
|
|
1688
|
+
maxBpm = 560;
|
|
1689
|
+
}
|
|
1690
|
+
if (minBpm === void 0) {
|
|
1691
|
+
minBpm = 30;
|
|
1692
|
+
}
|
|
1693
|
+
if (sampleRate === void 0) {
|
|
1694
|
+
sampleRate = 44100;
|
|
1695
|
+
}
|
|
1696
|
+
if (tolerance === void 0) {
|
|
1697
|
+
tolerance = 3;
|
|
1698
|
+
}
|
|
1699
|
+
return this.algorithms.NoveltyCurveFixedBpmEstimator(novelty, hopSize, maxBpm, minBpm, sampleRate, tolerance);
|
|
1700
|
+
};
|
|
1701
|
+
Essentia2.prototype.OddToEvenHarmonicEnergyRatio = function(frequencies, magnitudes) {
|
|
1702
|
+
return this.algorithms.OddToEvenHarmonicEnergyRatio(frequencies, magnitudes);
|
|
1703
|
+
};
|
|
1704
|
+
Essentia2.prototype.OnsetDetection = function(spectrum, phase, method, sampleRate) {
|
|
1705
|
+
if (method === void 0) {
|
|
1706
|
+
method = "hfc";
|
|
1707
|
+
}
|
|
1708
|
+
if (sampleRate === void 0) {
|
|
1709
|
+
sampleRate = 44100;
|
|
1710
|
+
}
|
|
1711
|
+
return this.algorithms.OnsetDetection(spectrum, phase, method, sampleRate);
|
|
1712
|
+
};
|
|
1713
|
+
Essentia2.prototype.OnsetDetectionGlobal = function(signal, frameSize, hopSize, method, sampleRate) {
|
|
1714
|
+
if (frameSize === void 0) {
|
|
1715
|
+
frameSize = 2048;
|
|
1716
|
+
}
|
|
1717
|
+
if (hopSize === void 0) {
|
|
1718
|
+
hopSize = 512;
|
|
1719
|
+
}
|
|
1720
|
+
if (method === void 0) {
|
|
1721
|
+
method = "infogain";
|
|
1722
|
+
}
|
|
1723
|
+
if (sampleRate === void 0) {
|
|
1724
|
+
sampleRate = 44100;
|
|
1725
|
+
}
|
|
1726
|
+
return this.algorithms.OnsetDetectionGlobal(signal, frameSize, hopSize, method, sampleRate);
|
|
1727
|
+
};
|
|
1728
|
+
Essentia2.prototype.OnsetRate = function(signal) {
|
|
1729
|
+
return this.algorithms.OnsetRate(signal);
|
|
1730
|
+
};
|
|
1731
|
+
Essentia2.prototype.OverlapAdd = function(signal, frameSize, gain, hopSize) {
|
|
1732
|
+
if (frameSize === void 0) {
|
|
1733
|
+
frameSize = 2048;
|
|
1734
|
+
}
|
|
1735
|
+
if (gain === void 0) {
|
|
1736
|
+
gain = 1;
|
|
1737
|
+
}
|
|
1738
|
+
if (hopSize === void 0) {
|
|
1739
|
+
hopSize = 128;
|
|
1740
|
+
}
|
|
1741
|
+
return this.algorithms.OverlapAdd(signal, frameSize, gain, hopSize);
|
|
1742
|
+
};
|
|
1743
|
+
Essentia2.prototype.PeakDetection = function(array, interpolate, maxPeaks, maxPosition, minPeakDistance, minPosition, orderBy, range, threshold) {
|
|
1744
|
+
if (interpolate === void 0) {
|
|
1745
|
+
interpolate = true;
|
|
1746
|
+
}
|
|
1747
|
+
if (maxPeaks === void 0) {
|
|
1748
|
+
maxPeaks = 100;
|
|
1749
|
+
}
|
|
1750
|
+
if (maxPosition === void 0) {
|
|
1751
|
+
maxPosition = 1;
|
|
1752
|
+
}
|
|
1753
|
+
if (minPeakDistance === void 0) {
|
|
1754
|
+
minPeakDistance = 0;
|
|
1755
|
+
}
|
|
1756
|
+
if (minPosition === void 0) {
|
|
1757
|
+
minPosition = 0;
|
|
1758
|
+
}
|
|
1759
|
+
if (orderBy === void 0) {
|
|
1760
|
+
orderBy = "position";
|
|
1761
|
+
}
|
|
1762
|
+
if (range === void 0) {
|
|
1763
|
+
range = 1;
|
|
1764
|
+
}
|
|
1765
|
+
if (threshold === void 0) {
|
|
1766
|
+
threshold = -1e6;
|
|
1767
|
+
}
|
|
1768
|
+
return this.algorithms.PeakDetection(array, interpolate, maxPeaks, maxPosition, minPeakDistance, minPosition, orderBy, range, threshold);
|
|
1769
|
+
};
|
|
1770
|
+
Essentia2.prototype.PercivalBpmEstimator = function(signal, frameSize, frameSizeOSS, hopSize, hopSizeOSS, maxBPM, minBPM, sampleRate) {
|
|
1771
|
+
if (frameSize === void 0) {
|
|
1772
|
+
frameSize = 1024;
|
|
1773
|
+
}
|
|
1774
|
+
if (frameSizeOSS === void 0) {
|
|
1775
|
+
frameSizeOSS = 2048;
|
|
1776
|
+
}
|
|
1777
|
+
if (hopSize === void 0) {
|
|
1778
|
+
hopSize = 128;
|
|
1779
|
+
}
|
|
1780
|
+
if (hopSizeOSS === void 0) {
|
|
1781
|
+
hopSizeOSS = 128;
|
|
1782
|
+
}
|
|
1783
|
+
if (maxBPM === void 0) {
|
|
1784
|
+
maxBPM = 210;
|
|
1785
|
+
}
|
|
1786
|
+
if (minBPM === void 0) {
|
|
1787
|
+
minBPM = 50;
|
|
1788
|
+
}
|
|
1789
|
+
if (sampleRate === void 0) {
|
|
1790
|
+
sampleRate = 44100;
|
|
1791
|
+
}
|
|
1792
|
+
return this.algorithms.PercivalBpmEstimator(signal, frameSize, frameSizeOSS, hopSize, hopSizeOSS, maxBPM, minBPM, sampleRate);
|
|
1793
|
+
};
|
|
1794
|
+
Essentia2.prototype.PercivalEnhanceHarmonics = function(array) {
|
|
1795
|
+
return this.algorithms.PercivalEnhanceHarmonics(array);
|
|
1796
|
+
};
|
|
1797
|
+
Essentia2.prototype.PercivalEvaluatePulseTrains = function(oss, positions) {
|
|
1798
|
+
return this.algorithms.PercivalEvaluatePulseTrains(oss, positions);
|
|
1799
|
+
};
|
|
1800
|
+
Essentia2.prototype.PitchContourSegmentation = function(pitch, signal, hopSize, minDuration, pitchDistanceThreshold, rmsThreshold, sampleRate, tuningFrequency) {
|
|
1801
|
+
if (hopSize === void 0) {
|
|
1802
|
+
hopSize = 128;
|
|
1803
|
+
}
|
|
1804
|
+
if (minDuration === void 0) {
|
|
1805
|
+
minDuration = 0.1;
|
|
1806
|
+
}
|
|
1807
|
+
if (pitchDistanceThreshold === void 0) {
|
|
1808
|
+
pitchDistanceThreshold = 60;
|
|
1809
|
+
}
|
|
1810
|
+
if (rmsThreshold === void 0) {
|
|
1811
|
+
rmsThreshold = -2;
|
|
1812
|
+
}
|
|
1813
|
+
if (sampleRate === void 0) {
|
|
1814
|
+
sampleRate = 44100;
|
|
1815
|
+
}
|
|
1816
|
+
if (tuningFrequency === void 0) {
|
|
1817
|
+
tuningFrequency = 440;
|
|
1818
|
+
}
|
|
1819
|
+
return this.algorithms.PitchContourSegmentation(pitch, signal, hopSize, minDuration, pitchDistanceThreshold, rmsThreshold, sampleRate, tuningFrequency);
|
|
1820
|
+
};
|
|
1821
|
+
Essentia2.prototype.PitchContours = function(peakBins, peakSaliences, binResolution, hopSize, minDuration, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, sampleRate, timeContinuity) {
|
|
1822
|
+
if (binResolution === void 0) {
|
|
1823
|
+
binResolution = 10;
|
|
1824
|
+
}
|
|
1825
|
+
if (hopSize === void 0) {
|
|
1826
|
+
hopSize = 128;
|
|
1827
|
+
}
|
|
1828
|
+
if (minDuration === void 0) {
|
|
1829
|
+
minDuration = 100;
|
|
1830
|
+
}
|
|
1831
|
+
if (peakDistributionThreshold === void 0) {
|
|
1832
|
+
peakDistributionThreshold = 0.9;
|
|
1833
|
+
}
|
|
1834
|
+
if (peakFrameThreshold === void 0) {
|
|
1835
|
+
peakFrameThreshold = 0.9;
|
|
1836
|
+
}
|
|
1837
|
+
if (pitchContinuity === void 0) {
|
|
1838
|
+
pitchContinuity = 27.5625;
|
|
1839
|
+
}
|
|
1840
|
+
if (sampleRate === void 0) {
|
|
1841
|
+
sampleRate = 44100;
|
|
1842
|
+
}
|
|
1843
|
+
if (timeContinuity === void 0) {
|
|
1844
|
+
timeContinuity = 100;
|
|
1845
|
+
}
|
|
1846
|
+
return this.algorithms.PitchContours(peakBins, peakSaliences, binResolution, hopSize, minDuration, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, sampleRate, timeContinuity);
|
|
1847
|
+
};
|
|
1848
|
+
Essentia2.prototype.PitchContoursMelody = function(contoursBins, contoursSaliences, contoursStartTimes, duration, binResolution, filterIterations, guessUnvoiced, hopSize, maxFrequency, minFrequency, referenceFrequency, sampleRate, voiceVibrato, voicingTolerance) {
|
|
1849
|
+
if (binResolution === void 0) {
|
|
1850
|
+
binResolution = 10;
|
|
1851
|
+
}
|
|
1852
|
+
if (filterIterations === void 0) {
|
|
1853
|
+
filterIterations = 3;
|
|
1854
|
+
}
|
|
1855
|
+
if (guessUnvoiced === void 0) {
|
|
1856
|
+
guessUnvoiced = false;
|
|
1857
|
+
}
|
|
1858
|
+
if (hopSize === void 0) {
|
|
1859
|
+
hopSize = 128;
|
|
1860
|
+
}
|
|
1861
|
+
if (maxFrequency === void 0) {
|
|
1862
|
+
maxFrequency = 2e4;
|
|
1863
|
+
}
|
|
1864
|
+
if (minFrequency === void 0) {
|
|
1865
|
+
minFrequency = 80;
|
|
1866
|
+
}
|
|
1867
|
+
if (referenceFrequency === void 0) {
|
|
1868
|
+
referenceFrequency = 55;
|
|
1869
|
+
}
|
|
1870
|
+
if (sampleRate === void 0) {
|
|
1871
|
+
sampleRate = 44100;
|
|
1872
|
+
}
|
|
1873
|
+
if (voiceVibrato === void 0) {
|
|
1874
|
+
voiceVibrato = false;
|
|
1875
|
+
}
|
|
1876
|
+
if (voicingTolerance === void 0) {
|
|
1877
|
+
voicingTolerance = 0.2;
|
|
1878
|
+
}
|
|
1879
|
+
return this.algorithms.PitchContoursMelody(contoursBins, contoursSaliences, contoursStartTimes, duration, binResolution, filterIterations, guessUnvoiced, hopSize, maxFrequency, minFrequency, referenceFrequency, sampleRate, voiceVibrato, voicingTolerance);
|
|
1880
|
+
};
|
|
1881
|
+
Essentia2.prototype.PitchContoursMonoMelody = function(contoursBins, contoursSaliences, contoursStartTimes, duration, binResolution, filterIterations, guessUnvoiced, hopSize, maxFrequency, minFrequency, referenceFrequency, sampleRate) {
|
|
1882
|
+
if (binResolution === void 0) {
|
|
1883
|
+
binResolution = 10;
|
|
1884
|
+
}
|
|
1885
|
+
if (filterIterations === void 0) {
|
|
1886
|
+
filterIterations = 3;
|
|
1887
|
+
}
|
|
1888
|
+
if (guessUnvoiced === void 0) {
|
|
1889
|
+
guessUnvoiced = false;
|
|
1890
|
+
}
|
|
1891
|
+
if (hopSize === void 0) {
|
|
1892
|
+
hopSize = 128;
|
|
1893
|
+
}
|
|
1894
|
+
if (maxFrequency === void 0) {
|
|
1895
|
+
maxFrequency = 2e4;
|
|
1896
|
+
}
|
|
1897
|
+
if (minFrequency === void 0) {
|
|
1898
|
+
minFrequency = 80;
|
|
1899
|
+
}
|
|
1900
|
+
if (referenceFrequency === void 0) {
|
|
1901
|
+
referenceFrequency = 55;
|
|
1902
|
+
}
|
|
1903
|
+
if (sampleRate === void 0) {
|
|
1904
|
+
sampleRate = 44100;
|
|
1905
|
+
}
|
|
1906
|
+
return this.algorithms.PitchContoursMonoMelody(contoursBins, contoursSaliences, contoursStartTimes, duration, binResolution, filterIterations, guessUnvoiced, hopSize, maxFrequency, minFrequency, referenceFrequency, sampleRate);
|
|
1907
|
+
};
|
|
1908
|
+
Essentia2.prototype.PitchContoursMultiMelody = function(contoursBins, contoursSaliences, contoursStartTimes, duration, binResolution, filterIterations, guessUnvoiced, hopSize, maxFrequency, minFrequency, referenceFrequency, sampleRate) {
|
|
1909
|
+
if (binResolution === void 0) {
|
|
1910
|
+
binResolution = 10;
|
|
1911
|
+
}
|
|
1912
|
+
if (filterIterations === void 0) {
|
|
1913
|
+
filterIterations = 3;
|
|
1914
|
+
}
|
|
1915
|
+
if (guessUnvoiced === void 0) {
|
|
1916
|
+
guessUnvoiced = false;
|
|
1917
|
+
}
|
|
1918
|
+
if (hopSize === void 0) {
|
|
1919
|
+
hopSize = 128;
|
|
1920
|
+
}
|
|
1921
|
+
if (maxFrequency === void 0) {
|
|
1922
|
+
maxFrequency = 2e4;
|
|
1923
|
+
}
|
|
1924
|
+
if (minFrequency === void 0) {
|
|
1925
|
+
minFrequency = 80;
|
|
1926
|
+
}
|
|
1927
|
+
if (referenceFrequency === void 0) {
|
|
1928
|
+
referenceFrequency = 55;
|
|
1929
|
+
}
|
|
1930
|
+
if (sampleRate === void 0) {
|
|
1931
|
+
sampleRate = 44100;
|
|
1932
|
+
}
|
|
1933
|
+
return this.algorithms.PitchContoursMultiMelody(contoursBins, contoursSaliences, contoursStartTimes, duration, binResolution, filterIterations, guessUnvoiced, hopSize, maxFrequency, minFrequency, referenceFrequency, sampleRate);
|
|
1934
|
+
};
|
|
1935
|
+
Essentia2.prototype.PitchFilter = function(pitch, pitchConfidence, confidenceThreshold, minChunkSize, useAbsolutePitchConfidence) {
|
|
1936
|
+
if (confidenceThreshold === void 0) {
|
|
1937
|
+
confidenceThreshold = 36;
|
|
1938
|
+
}
|
|
1939
|
+
if (minChunkSize === void 0) {
|
|
1940
|
+
minChunkSize = 30;
|
|
1941
|
+
}
|
|
1942
|
+
if (useAbsolutePitchConfidence === void 0) {
|
|
1943
|
+
useAbsolutePitchConfidence = false;
|
|
1944
|
+
}
|
|
1945
|
+
return this.algorithms.PitchFilter(pitch, pitchConfidence, confidenceThreshold, minChunkSize, useAbsolutePitchConfidence);
|
|
1946
|
+
};
|
|
1947
|
+
Essentia2.prototype.PitchMelodia = function(signal, binResolution, filterIterations, frameSize, guessUnvoiced, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minDuration, minFrequency, numberHarmonics, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, referenceFrequency, sampleRate, timeContinuity) {
|
|
1948
|
+
if (binResolution === void 0) {
|
|
1949
|
+
binResolution = 10;
|
|
1950
|
+
}
|
|
1951
|
+
if (filterIterations === void 0) {
|
|
1952
|
+
filterIterations = 3;
|
|
1953
|
+
}
|
|
1954
|
+
if (frameSize === void 0) {
|
|
1955
|
+
frameSize = 2048;
|
|
1956
|
+
}
|
|
1957
|
+
if (guessUnvoiced === void 0) {
|
|
1958
|
+
guessUnvoiced = false;
|
|
1959
|
+
}
|
|
1960
|
+
if (harmonicWeight === void 0) {
|
|
1961
|
+
harmonicWeight = 0.8;
|
|
1962
|
+
}
|
|
1963
|
+
if (hopSize === void 0) {
|
|
1964
|
+
hopSize = 128;
|
|
1965
|
+
}
|
|
1966
|
+
if (magnitudeCompression === void 0) {
|
|
1967
|
+
magnitudeCompression = 1;
|
|
1968
|
+
}
|
|
1969
|
+
if (magnitudeThreshold === void 0) {
|
|
1970
|
+
magnitudeThreshold = 40;
|
|
1971
|
+
}
|
|
1972
|
+
if (maxFrequency === void 0) {
|
|
1973
|
+
maxFrequency = 2e4;
|
|
1974
|
+
}
|
|
1975
|
+
if (minDuration === void 0) {
|
|
1976
|
+
minDuration = 100;
|
|
1977
|
+
}
|
|
1978
|
+
if (minFrequency === void 0) {
|
|
1979
|
+
minFrequency = 40;
|
|
1980
|
+
}
|
|
1981
|
+
if (numberHarmonics === void 0) {
|
|
1982
|
+
numberHarmonics = 20;
|
|
1983
|
+
}
|
|
1984
|
+
if (peakDistributionThreshold === void 0) {
|
|
1985
|
+
peakDistributionThreshold = 0.9;
|
|
1986
|
+
}
|
|
1987
|
+
if (peakFrameThreshold === void 0) {
|
|
1988
|
+
peakFrameThreshold = 0.9;
|
|
1989
|
+
}
|
|
1990
|
+
if (pitchContinuity === void 0) {
|
|
1991
|
+
pitchContinuity = 27.5625;
|
|
1992
|
+
}
|
|
1993
|
+
if (referenceFrequency === void 0) {
|
|
1994
|
+
referenceFrequency = 55;
|
|
1995
|
+
}
|
|
1996
|
+
if (sampleRate === void 0) {
|
|
1997
|
+
sampleRate = 44100;
|
|
1998
|
+
}
|
|
1999
|
+
if (timeContinuity === void 0) {
|
|
2000
|
+
timeContinuity = 100;
|
|
2001
|
+
}
|
|
2002
|
+
return this.algorithms.PitchMelodia(signal, binResolution, filterIterations, frameSize, guessUnvoiced, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minDuration, minFrequency, numberHarmonics, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, referenceFrequency, sampleRate, timeContinuity);
|
|
2003
|
+
};
|
|
2004
|
+
Essentia2.prototype.PitchSalience = function(spectrum, highBoundary, lowBoundary, sampleRate) {
|
|
2005
|
+
if (highBoundary === void 0) {
|
|
2006
|
+
highBoundary = 5e3;
|
|
2007
|
+
}
|
|
2008
|
+
if (lowBoundary === void 0) {
|
|
2009
|
+
lowBoundary = 100;
|
|
2010
|
+
}
|
|
2011
|
+
if (sampleRate === void 0) {
|
|
2012
|
+
sampleRate = 44100;
|
|
2013
|
+
}
|
|
2014
|
+
return this.algorithms.PitchSalience(spectrum, highBoundary, lowBoundary, sampleRate);
|
|
2015
|
+
};
|
|
2016
|
+
Essentia2.prototype.PitchSalienceFunction = function(frequencies, magnitudes, binResolution, harmonicWeight, magnitudeCompression, magnitudeThreshold, numberHarmonics, referenceFrequency) {
|
|
2017
|
+
if (binResolution === void 0) {
|
|
2018
|
+
binResolution = 10;
|
|
2019
|
+
}
|
|
2020
|
+
if (harmonicWeight === void 0) {
|
|
2021
|
+
harmonicWeight = 0.8;
|
|
2022
|
+
}
|
|
2023
|
+
if (magnitudeCompression === void 0) {
|
|
2024
|
+
magnitudeCompression = 1;
|
|
2025
|
+
}
|
|
2026
|
+
if (magnitudeThreshold === void 0) {
|
|
2027
|
+
magnitudeThreshold = 40;
|
|
2028
|
+
}
|
|
2029
|
+
if (numberHarmonics === void 0) {
|
|
2030
|
+
numberHarmonics = 20;
|
|
2031
|
+
}
|
|
2032
|
+
if (referenceFrequency === void 0) {
|
|
2033
|
+
referenceFrequency = 55;
|
|
2034
|
+
}
|
|
2035
|
+
return this.algorithms.PitchSalienceFunction(frequencies, magnitudes, binResolution, harmonicWeight, magnitudeCompression, magnitudeThreshold, numberHarmonics, referenceFrequency);
|
|
2036
|
+
};
|
|
2037
|
+
Essentia2.prototype.PitchSalienceFunctionPeaks = function(salienceFunction, binResolution, maxFrequency, minFrequency, referenceFrequency) {
|
|
2038
|
+
if (binResolution === void 0) {
|
|
2039
|
+
binResolution = 10;
|
|
2040
|
+
}
|
|
2041
|
+
if (maxFrequency === void 0) {
|
|
2042
|
+
maxFrequency = 1760;
|
|
2043
|
+
}
|
|
2044
|
+
if (minFrequency === void 0) {
|
|
2045
|
+
minFrequency = 55;
|
|
2046
|
+
}
|
|
2047
|
+
if (referenceFrequency === void 0) {
|
|
2048
|
+
referenceFrequency = 55;
|
|
2049
|
+
}
|
|
2050
|
+
return this.algorithms.PitchSalienceFunctionPeaks(salienceFunction, binResolution, maxFrequency, minFrequency, referenceFrequency);
|
|
2051
|
+
};
|
|
2052
|
+
Essentia2.prototype.PitchYin = function(signal, frameSize, interpolate, maxFrequency, minFrequency, sampleRate, tolerance) {
|
|
2053
|
+
if (frameSize === void 0) {
|
|
2054
|
+
frameSize = 2048;
|
|
2055
|
+
}
|
|
2056
|
+
if (interpolate === void 0) {
|
|
2057
|
+
interpolate = true;
|
|
2058
|
+
}
|
|
2059
|
+
if (maxFrequency === void 0) {
|
|
2060
|
+
maxFrequency = 22050;
|
|
2061
|
+
}
|
|
2062
|
+
if (minFrequency === void 0) {
|
|
2063
|
+
minFrequency = 20;
|
|
2064
|
+
}
|
|
2065
|
+
if (sampleRate === void 0) {
|
|
2066
|
+
sampleRate = 44100;
|
|
2067
|
+
}
|
|
2068
|
+
if (tolerance === void 0) {
|
|
2069
|
+
tolerance = 0.15;
|
|
2070
|
+
}
|
|
2071
|
+
return this.algorithms.PitchYin(signal, frameSize, interpolate, maxFrequency, minFrequency, sampleRate, tolerance);
|
|
2072
|
+
};
|
|
2073
|
+
Essentia2.prototype.PitchYinFFT = function(spectrum, frameSize, interpolate, maxFrequency, minFrequency, sampleRate, tolerance) {
|
|
2074
|
+
if (frameSize === void 0) {
|
|
2075
|
+
frameSize = 2048;
|
|
2076
|
+
}
|
|
2077
|
+
if (interpolate === void 0) {
|
|
2078
|
+
interpolate = true;
|
|
2079
|
+
}
|
|
2080
|
+
if (maxFrequency === void 0) {
|
|
2081
|
+
maxFrequency = 22050;
|
|
2082
|
+
}
|
|
2083
|
+
if (minFrequency === void 0) {
|
|
2084
|
+
minFrequency = 20;
|
|
2085
|
+
}
|
|
2086
|
+
if (sampleRate === void 0) {
|
|
2087
|
+
sampleRate = 44100;
|
|
2088
|
+
}
|
|
2089
|
+
if (tolerance === void 0) {
|
|
2090
|
+
tolerance = 1;
|
|
2091
|
+
}
|
|
2092
|
+
return this.algorithms.PitchYinFFT(spectrum, frameSize, interpolate, maxFrequency, minFrequency, sampleRate, tolerance);
|
|
2093
|
+
};
|
|
2094
|
+
Essentia2.prototype.PitchYinProbabilistic = function(signal, frameSize, hopSize, lowRMSThreshold, outputUnvoiced, preciseTime, sampleRate) {
|
|
2095
|
+
if (frameSize === void 0) {
|
|
2096
|
+
frameSize = 2048;
|
|
2097
|
+
}
|
|
2098
|
+
if (hopSize === void 0) {
|
|
2099
|
+
hopSize = 256;
|
|
2100
|
+
}
|
|
2101
|
+
if (lowRMSThreshold === void 0) {
|
|
2102
|
+
lowRMSThreshold = 0.1;
|
|
2103
|
+
}
|
|
2104
|
+
if (outputUnvoiced === void 0) {
|
|
2105
|
+
outputUnvoiced = "negative";
|
|
2106
|
+
}
|
|
2107
|
+
if (preciseTime === void 0) {
|
|
2108
|
+
preciseTime = false;
|
|
2109
|
+
}
|
|
2110
|
+
if (sampleRate === void 0) {
|
|
2111
|
+
sampleRate = 44100;
|
|
2112
|
+
}
|
|
2113
|
+
return this.algorithms.PitchYinProbabilistic(signal, frameSize, hopSize, lowRMSThreshold, outputUnvoiced, preciseTime, sampleRate);
|
|
2114
|
+
};
|
|
2115
|
+
Essentia2.prototype.PitchYinProbabilities = function(signal, frameSize, lowAmp, preciseTime, sampleRate) {
|
|
2116
|
+
if (frameSize === void 0) {
|
|
2117
|
+
frameSize = 2048;
|
|
2118
|
+
}
|
|
2119
|
+
if (lowAmp === void 0) {
|
|
2120
|
+
lowAmp = 0.1;
|
|
2121
|
+
}
|
|
2122
|
+
if (preciseTime === void 0) {
|
|
2123
|
+
preciseTime = false;
|
|
2124
|
+
}
|
|
2125
|
+
if (sampleRate === void 0) {
|
|
2126
|
+
sampleRate = 44100;
|
|
2127
|
+
}
|
|
2128
|
+
return this.algorithms.PitchYinProbabilities(signal, frameSize, lowAmp, preciseTime, sampleRate);
|
|
2129
|
+
};
|
|
2130
|
+
Essentia2.prototype.PitchYinProbabilitiesHMM = function(pitchCandidates, probabilities, minFrequency, numberBinsPerSemitone, selfTransition, yinTrust) {
|
|
2131
|
+
if (minFrequency === void 0) {
|
|
2132
|
+
minFrequency = 61.735;
|
|
2133
|
+
}
|
|
2134
|
+
if (numberBinsPerSemitone === void 0) {
|
|
2135
|
+
numberBinsPerSemitone = 5;
|
|
2136
|
+
}
|
|
2137
|
+
if (selfTransition === void 0) {
|
|
2138
|
+
selfTransition = 0.99;
|
|
2139
|
+
}
|
|
2140
|
+
if (yinTrust === void 0) {
|
|
2141
|
+
yinTrust = 0.5;
|
|
2142
|
+
}
|
|
2143
|
+
return this.algorithms.PitchYinProbabilitiesHMM(pitchCandidates, probabilities, minFrequency, numberBinsPerSemitone, selfTransition, yinTrust);
|
|
2144
|
+
};
|
|
2145
|
+
Essentia2.prototype.PowerMean = function(array, power) {
|
|
2146
|
+
if (power === void 0) {
|
|
2147
|
+
power = 1;
|
|
2148
|
+
}
|
|
2149
|
+
return this.algorithms.PowerMean(array, power);
|
|
2150
|
+
};
|
|
2151
|
+
Essentia2.prototype.PowerSpectrum = function(signal, size) {
|
|
2152
|
+
if (size === void 0) {
|
|
2153
|
+
size = 2048;
|
|
2154
|
+
}
|
|
2155
|
+
return this.algorithms.PowerSpectrum(signal, size);
|
|
2156
|
+
};
|
|
2157
|
+
Essentia2.prototype.PredominantPitchMelodia = function(signal, binResolution, filterIterations, frameSize, guessUnvoiced, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minDuration, minFrequency, numberHarmonics, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, referenceFrequency, sampleRate, timeContinuity, voiceVibrato, voicingTolerance) {
|
|
2158
|
+
if (binResolution === void 0) {
|
|
2159
|
+
binResolution = 10;
|
|
2160
|
+
}
|
|
2161
|
+
if (filterIterations === void 0) {
|
|
2162
|
+
filterIterations = 3;
|
|
2163
|
+
}
|
|
2164
|
+
if (frameSize === void 0) {
|
|
2165
|
+
frameSize = 2048;
|
|
2166
|
+
}
|
|
2167
|
+
if (guessUnvoiced === void 0) {
|
|
2168
|
+
guessUnvoiced = false;
|
|
2169
|
+
}
|
|
2170
|
+
if (harmonicWeight === void 0) {
|
|
2171
|
+
harmonicWeight = 0.8;
|
|
2172
|
+
}
|
|
2173
|
+
if (hopSize === void 0) {
|
|
2174
|
+
hopSize = 128;
|
|
2175
|
+
}
|
|
2176
|
+
if (magnitudeCompression === void 0) {
|
|
2177
|
+
magnitudeCompression = 1;
|
|
2178
|
+
}
|
|
2179
|
+
if (magnitudeThreshold === void 0) {
|
|
2180
|
+
magnitudeThreshold = 40;
|
|
2181
|
+
}
|
|
2182
|
+
if (maxFrequency === void 0) {
|
|
2183
|
+
maxFrequency = 2e4;
|
|
2184
|
+
}
|
|
2185
|
+
if (minDuration === void 0) {
|
|
2186
|
+
minDuration = 100;
|
|
2187
|
+
}
|
|
2188
|
+
if (minFrequency === void 0) {
|
|
2189
|
+
minFrequency = 80;
|
|
2190
|
+
}
|
|
2191
|
+
if (numberHarmonics === void 0) {
|
|
2192
|
+
numberHarmonics = 20;
|
|
2193
|
+
}
|
|
2194
|
+
if (peakDistributionThreshold === void 0) {
|
|
2195
|
+
peakDistributionThreshold = 0.9;
|
|
2196
|
+
}
|
|
2197
|
+
if (peakFrameThreshold === void 0) {
|
|
2198
|
+
peakFrameThreshold = 0.9;
|
|
2199
|
+
}
|
|
2200
|
+
if (pitchContinuity === void 0) {
|
|
2201
|
+
pitchContinuity = 27.5625;
|
|
2202
|
+
}
|
|
2203
|
+
if (referenceFrequency === void 0) {
|
|
2204
|
+
referenceFrequency = 55;
|
|
2205
|
+
}
|
|
2206
|
+
if (sampleRate === void 0) {
|
|
2207
|
+
sampleRate = 44100;
|
|
2208
|
+
}
|
|
2209
|
+
if (timeContinuity === void 0) {
|
|
2210
|
+
timeContinuity = 100;
|
|
2211
|
+
}
|
|
2212
|
+
if (voiceVibrato === void 0) {
|
|
2213
|
+
voiceVibrato = false;
|
|
2214
|
+
}
|
|
2215
|
+
if (voicingTolerance === void 0) {
|
|
2216
|
+
voicingTolerance = 0.2;
|
|
2217
|
+
}
|
|
2218
|
+
return this.algorithms.PredominantPitchMelodia(signal, binResolution, filterIterations, frameSize, guessUnvoiced, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxFrequency, minDuration, minFrequency, numberHarmonics, peakDistributionThreshold, peakFrameThreshold, pitchContinuity, referenceFrequency, sampleRate, timeContinuity, voiceVibrato, voicingTolerance);
|
|
2219
|
+
};
|
|
2220
|
+
Essentia2.prototype.RMS = function(array) {
|
|
2221
|
+
return this.algorithms.RMS(array);
|
|
2222
|
+
};
|
|
2223
|
+
Essentia2.prototype.RawMoments = function(array, range) {
|
|
2224
|
+
if (range === void 0) {
|
|
2225
|
+
range = 22050;
|
|
2226
|
+
}
|
|
2227
|
+
return this.algorithms.RawMoments(array, range);
|
|
2228
|
+
};
|
|
2229
|
+
Essentia2.prototype.ReplayGain = function(signal, sampleRate) {
|
|
2230
|
+
if (sampleRate === void 0) {
|
|
2231
|
+
sampleRate = 44100;
|
|
2232
|
+
}
|
|
2233
|
+
return this.algorithms.ReplayGain(signal, sampleRate);
|
|
2234
|
+
};
|
|
2235
|
+
Essentia2.prototype.Resample = function(signal, inputSampleRate, outputSampleRate, quality) {
|
|
2236
|
+
if (inputSampleRate === void 0) {
|
|
2237
|
+
inputSampleRate = 44100;
|
|
2238
|
+
}
|
|
2239
|
+
if (outputSampleRate === void 0) {
|
|
2240
|
+
outputSampleRate = 44100;
|
|
2241
|
+
}
|
|
2242
|
+
if (quality === void 0) {
|
|
2243
|
+
quality = 1;
|
|
2244
|
+
}
|
|
2245
|
+
return this.algorithms.Resample(signal, inputSampleRate, outputSampleRate, quality);
|
|
2246
|
+
};
|
|
2247
|
+
Essentia2.prototype.ResampleFFT = function(input, inSize, outSize) {
|
|
2248
|
+
if (inSize === void 0) {
|
|
2249
|
+
inSize = 128;
|
|
2250
|
+
}
|
|
2251
|
+
if (outSize === void 0) {
|
|
2252
|
+
outSize = 128;
|
|
2253
|
+
}
|
|
2254
|
+
return this.algorithms.ResampleFFT(input, inSize, outSize);
|
|
2255
|
+
};
|
|
2256
|
+
Essentia2.prototype.RhythmDescriptors = function(signal) {
|
|
2257
|
+
return this.algorithms.RhythmDescriptors(signal);
|
|
2258
|
+
};
|
|
2259
|
+
Essentia2.prototype.RhythmExtractor = function(signal, frameHop, frameSize, hopSize, lastBeatInterval, maxTempo, minTempo, numberFrames, sampleRate, tempoHints, tolerance, useBands, useOnset) {
|
|
2260
|
+
if (frameHop === void 0) {
|
|
2261
|
+
frameHop = 1024;
|
|
2262
|
+
}
|
|
2263
|
+
if (frameSize === void 0) {
|
|
2264
|
+
frameSize = 1024;
|
|
2265
|
+
}
|
|
2266
|
+
if (hopSize === void 0) {
|
|
2267
|
+
hopSize = 256;
|
|
2268
|
+
}
|
|
2269
|
+
if (lastBeatInterval === void 0) {
|
|
2270
|
+
lastBeatInterval = 0.1;
|
|
2271
|
+
}
|
|
2272
|
+
if (maxTempo === void 0) {
|
|
2273
|
+
maxTempo = 208;
|
|
2274
|
+
}
|
|
2275
|
+
if (minTempo === void 0) {
|
|
2276
|
+
minTempo = 40;
|
|
2277
|
+
}
|
|
2278
|
+
if (numberFrames === void 0) {
|
|
2279
|
+
numberFrames = 1024;
|
|
2280
|
+
}
|
|
2281
|
+
if (sampleRate === void 0) {
|
|
2282
|
+
sampleRate = 44100;
|
|
2283
|
+
}
|
|
2284
|
+
if (tempoHints === void 0) {
|
|
2285
|
+
tempoHints = [];
|
|
2286
|
+
}
|
|
2287
|
+
if (tolerance === void 0) {
|
|
2288
|
+
tolerance = 0.24;
|
|
2289
|
+
}
|
|
2290
|
+
if (useBands === void 0) {
|
|
2291
|
+
useBands = true;
|
|
2292
|
+
}
|
|
2293
|
+
if (useOnset === void 0) {
|
|
2294
|
+
useOnset = true;
|
|
2295
|
+
}
|
|
2296
|
+
var vectempoHints = new this.module.VectorFloat();
|
|
2297
|
+
for (var i = 0; i < vectempoHints.size(); i++) {
|
|
2298
|
+
vectempoHints.push_back(tempoHints[i]);
|
|
2299
|
+
}
|
|
2300
|
+
return this.algorithms.RhythmExtractor(signal, frameHop, frameSize, hopSize, lastBeatInterval, maxTempo, minTempo, numberFrames, sampleRate, vectempoHints, tolerance, useBands, useOnset);
|
|
2301
|
+
};
|
|
2302
|
+
Essentia2.prototype.RhythmExtractor2013 = function(signal, maxTempo, method, minTempo) {
|
|
2303
|
+
if (maxTempo === void 0) {
|
|
2304
|
+
maxTempo = 208;
|
|
2305
|
+
}
|
|
2306
|
+
if (method === void 0) {
|
|
2307
|
+
method = "multifeature";
|
|
2308
|
+
}
|
|
2309
|
+
if (minTempo === void 0) {
|
|
2310
|
+
minTempo = 40;
|
|
2311
|
+
}
|
|
2312
|
+
return this.algorithms.RhythmExtractor2013(signal, maxTempo, method, minTempo);
|
|
2313
|
+
};
|
|
2314
|
+
Essentia2.prototype.RhythmTransform = function(melBands, frameSize, hopSize) {
|
|
2315
|
+
if (frameSize === void 0) {
|
|
2316
|
+
frameSize = 256;
|
|
2317
|
+
}
|
|
2318
|
+
if (hopSize === void 0) {
|
|
2319
|
+
hopSize = 32;
|
|
2320
|
+
}
|
|
2321
|
+
return this.algorithms.RhythmTransform(melBands, frameSize, hopSize);
|
|
2322
|
+
};
|
|
2323
|
+
Essentia2.prototype.RollOff = function(spectrum, cutoff, sampleRate) {
|
|
2324
|
+
if (cutoff === void 0) {
|
|
2325
|
+
cutoff = 0.85;
|
|
2326
|
+
}
|
|
2327
|
+
if (sampleRate === void 0) {
|
|
2328
|
+
sampleRate = 44100;
|
|
2329
|
+
}
|
|
2330
|
+
return this.algorithms.RollOff(spectrum, cutoff, sampleRate);
|
|
2331
|
+
};
|
|
2332
|
+
Essentia2.prototype.SNR = function(frame, MAAlpha, MMSEAlpha, NoiseAlpha, frameSize, noiseThreshold, sampleRate, useBroadbadNoiseCorrection) {
|
|
2333
|
+
if (MAAlpha === void 0) {
|
|
2334
|
+
MAAlpha = 0.95;
|
|
2335
|
+
}
|
|
2336
|
+
if (MMSEAlpha === void 0) {
|
|
2337
|
+
MMSEAlpha = 0.98;
|
|
2338
|
+
}
|
|
2339
|
+
if (NoiseAlpha === void 0) {
|
|
2340
|
+
NoiseAlpha = 0.9;
|
|
2341
|
+
}
|
|
2342
|
+
if (frameSize === void 0) {
|
|
2343
|
+
frameSize = 512;
|
|
2344
|
+
}
|
|
2345
|
+
if (noiseThreshold === void 0) {
|
|
2346
|
+
noiseThreshold = -40;
|
|
2347
|
+
}
|
|
2348
|
+
if (sampleRate === void 0) {
|
|
2349
|
+
sampleRate = 44100;
|
|
2350
|
+
}
|
|
2351
|
+
if (useBroadbadNoiseCorrection === void 0) {
|
|
2352
|
+
useBroadbadNoiseCorrection = true;
|
|
2353
|
+
}
|
|
2354
|
+
return this.algorithms.SNR(frame, MAAlpha, MMSEAlpha, NoiseAlpha, frameSize, noiseThreshold, sampleRate, useBroadbadNoiseCorrection);
|
|
2355
|
+
};
|
|
2356
|
+
Essentia2.prototype.SaturationDetector = function(frame, differentialThreshold, energyThreshold, frameSize, hopSize, minimumDuration, sampleRate) {
|
|
2357
|
+
if (differentialThreshold === void 0) {
|
|
2358
|
+
differentialThreshold = 1e-3;
|
|
2359
|
+
}
|
|
2360
|
+
if (energyThreshold === void 0) {
|
|
2361
|
+
energyThreshold = -1;
|
|
2362
|
+
}
|
|
2363
|
+
if (frameSize === void 0) {
|
|
2364
|
+
frameSize = 512;
|
|
2365
|
+
}
|
|
2366
|
+
if (hopSize === void 0) {
|
|
2367
|
+
hopSize = 256;
|
|
2368
|
+
}
|
|
2369
|
+
if (minimumDuration === void 0) {
|
|
2370
|
+
minimumDuration = 5e-3;
|
|
2371
|
+
}
|
|
2372
|
+
if (sampleRate === void 0) {
|
|
2373
|
+
sampleRate = 44100;
|
|
2374
|
+
}
|
|
2375
|
+
return this.algorithms.SaturationDetector(frame, differentialThreshold, energyThreshold, frameSize, hopSize, minimumDuration, sampleRate);
|
|
2376
|
+
};
|
|
2377
|
+
Essentia2.prototype.Scale = function(signal, clipping, factor, maxAbsValue) {
|
|
2378
|
+
if (clipping === void 0) {
|
|
2379
|
+
clipping = true;
|
|
2380
|
+
}
|
|
2381
|
+
if (factor === void 0) {
|
|
2382
|
+
factor = 10;
|
|
2383
|
+
}
|
|
2384
|
+
if (maxAbsValue === void 0) {
|
|
2385
|
+
maxAbsValue = 1;
|
|
2386
|
+
}
|
|
2387
|
+
return this.algorithms.Scale(signal, clipping, factor, maxAbsValue);
|
|
2388
|
+
};
|
|
2389
|
+
Essentia2.prototype.SineSubtraction = function(frame, magnitudes, frequencies, phases, fftSize, hopSize, sampleRate) {
|
|
2390
|
+
if (fftSize === void 0) {
|
|
2391
|
+
fftSize = 512;
|
|
2392
|
+
}
|
|
2393
|
+
if (hopSize === void 0) {
|
|
2394
|
+
hopSize = 128;
|
|
2395
|
+
}
|
|
2396
|
+
if (sampleRate === void 0) {
|
|
2397
|
+
sampleRate = 44100;
|
|
2398
|
+
}
|
|
2399
|
+
return this.algorithms.SineSubtraction(frame, magnitudes, frequencies, phases, fftSize, hopSize, sampleRate);
|
|
2400
|
+
};
|
|
2401
|
+
Essentia2.prototype.SingleBeatLoudness = function(beat, beatDuration, beatWindowDuration, frequencyBands, onsetStart, sampleRate) {
|
|
2402
|
+
if (beatDuration === void 0) {
|
|
2403
|
+
beatDuration = 0.05;
|
|
2404
|
+
}
|
|
2405
|
+
if (beatWindowDuration === void 0) {
|
|
2406
|
+
beatWindowDuration = 0.1;
|
|
2407
|
+
}
|
|
2408
|
+
if (frequencyBands === void 0) {
|
|
2409
|
+
frequencyBands = [0, 200, 400, 800, 1600, 3200, 22e3];
|
|
2410
|
+
}
|
|
2411
|
+
if (onsetStart === void 0) {
|
|
2412
|
+
onsetStart = "sumEnergy";
|
|
2413
|
+
}
|
|
2414
|
+
if (sampleRate === void 0) {
|
|
2415
|
+
sampleRate = 44100;
|
|
2416
|
+
}
|
|
2417
|
+
var vecfrequencyBands = new this.module.VectorFloat();
|
|
2418
|
+
for (var i = 0; i < vecfrequencyBands.size(); i++) {
|
|
2419
|
+
vecfrequencyBands.push_back(frequencyBands[i]);
|
|
2420
|
+
}
|
|
2421
|
+
return this.algorithms.SingleBeatLoudness(beat, beatDuration, beatWindowDuration, vecfrequencyBands, onsetStart, sampleRate);
|
|
2422
|
+
};
|
|
2423
|
+
Essentia2.prototype.Slicer = function(audio, endTimes, sampleRate, startTimes, timeUnits) {
|
|
2424
|
+
if (endTimes === void 0) {
|
|
2425
|
+
endTimes = [];
|
|
2426
|
+
}
|
|
2427
|
+
if (sampleRate === void 0) {
|
|
2428
|
+
sampleRate = 44100;
|
|
2429
|
+
}
|
|
2430
|
+
if (startTimes === void 0) {
|
|
2431
|
+
startTimes = [];
|
|
2432
|
+
}
|
|
2433
|
+
if (timeUnits === void 0) {
|
|
2434
|
+
timeUnits = "seconds";
|
|
2435
|
+
}
|
|
2436
|
+
var vecendTimes = new this.module.VectorFloat();
|
|
2437
|
+
for (var i = 0; i < vecendTimes.size(); i++) {
|
|
2438
|
+
vecendTimes.push_back(endTimes[i]);
|
|
2439
|
+
}
|
|
2440
|
+
var vecstartTimes = new this.module.VectorFloat();
|
|
2441
|
+
for (var i = 0; i < vecstartTimes.size(); i++) {
|
|
2442
|
+
vecstartTimes.push_back(startTimes[i]);
|
|
2443
|
+
}
|
|
2444
|
+
return this.algorithms.Slicer(audio, vecendTimes, sampleRate, vecstartTimes, timeUnits);
|
|
2445
|
+
};
|
|
2446
|
+
Essentia2.prototype.SpectralCentroidTime = function(array, sampleRate) {
|
|
2447
|
+
if (sampleRate === void 0) {
|
|
2448
|
+
sampleRate = 44100;
|
|
2449
|
+
}
|
|
2450
|
+
return this.algorithms.SpectralCentroidTime(array, sampleRate);
|
|
2451
|
+
};
|
|
2452
|
+
Essentia2.prototype.SpectralComplexity = function(spectrum, magnitudeThreshold, sampleRate) {
|
|
2453
|
+
if (magnitudeThreshold === void 0) {
|
|
2454
|
+
magnitudeThreshold = 5e-3;
|
|
2455
|
+
}
|
|
2456
|
+
if (sampleRate === void 0) {
|
|
2457
|
+
sampleRate = 44100;
|
|
2458
|
+
}
|
|
2459
|
+
return this.algorithms.SpectralComplexity(spectrum, magnitudeThreshold, sampleRate);
|
|
2460
|
+
};
|
|
2461
|
+
Essentia2.prototype.SpectralContrast = function(spectrum, frameSize, highFrequencyBound, lowFrequencyBound, neighbourRatio, numberBands, sampleRate, staticDistribution) {
|
|
2462
|
+
if (frameSize === void 0) {
|
|
2463
|
+
frameSize = 2048;
|
|
2464
|
+
}
|
|
2465
|
+
if (highFrequencyBound === void 0) {
|
|
2466
|
+
highFrequencyBound = 11e3;
|
|
2467
|
+
}
|
|
2468
|
+
if (lowFrequencyBound === void 0) {
|
|
2469
|
+
lowFrequencyBound = 20;
|
|
2470
|
+
}
|
|
2471
|
+
if (neighbourRatio === void 0) {
|
|
2472
|
+
neighbourRatio = 0.4;
|
|
2473
|
+
}
|
|
2474
|
+
if (numberBands === void 0) {
|
|
2475
|
+
numberBands = 6;
|
|
2476
|
+
}
|
|
2477
|
+
if (sampleRate === void 0) {
|
|
2478
|
+
sampleRate = 22050;
|
|
2479
|
+
}
|
|
2480
|
+
if (staticDistribution === void 0) {
|
|
2481
|
+
staticDistribution = 0.15;
|
|
2482
|
+
}
|
|
2483
|
+
return this.algorithms.SpectralContrast(spectrum, frameSize, highFrequencyBound, lowFrequencyBound, neighbourRatio, numberBands, sampleRate, staticDistribution);
|
|
2484
|
+
};
|
|
2485
|
+
Essentia2.prototype.SpectralPeaks = function(spectrum, magnitudeThreshold, maxFrequency, maxPeaks, minFrequency, orderBy, sampleRate) {
|
|
2486
|
+
if (magnitudeThreshold === void 0) {
|
|
2487
|
+
magnitudeThreshold = 0;
|
|
2488
|
+
}
|
|
2489
|
+
if (maxFrequency === void 0) {
|
|
2490
|
+
maxFrequency = 5e3;
|
|
2491
|
+
}
|
|
2492
|
+
if (maxPeaks === void 0) {
|
|
2493
|
+
maxPeaks = 100;
|
|
2494
|
+
}
|
|
2495
|
+
if (minFrequency === void 0) {
|
|
2496
|
+
minFrequency = 0;
|
|
2497
|
+
}
|
|
2498
|
+
if (orderBy === void 0) {
|
|
2499
|
+
orderBy = "frequency";
|
|
2500
|
+
}
|
|
2501
|
+
if (sampleRate === void 0) {
|
|
2502
|
+
sampleRate = 44100;
|
|
2503
|
+
}
|
|
2504
|
+
return this.algorithms.SpectralPeaks(spectrum, magnitudeThreshold, maxFrequency, maxPeaks, minFrequency, orderBy, sampleRate);
|
|
2505
|
+
};
|
|
2506
|
+
Essentia2.prototype.SpectralWhitening = function(spectrum, frequencies, magnitudes, maxFrequency, sampleRate) {
|
|
2507
|
+
if (maxFrequency === void 0) {
|
|
2508
|
+
maxFrequency = 5e3;
|
|
2509
|
+
}
|
|
2510
|
+
if (sampleRate === void 0) {
|
|
2511
|
+
sampleRate = 44100;
|
|
2512
|
+
}
|
|
2513
|
+
return this.algorithms.SpectralWhitening(spectrum, frequencies, magnitudes, maxFrequency, sampleRate);
|
|
2514
|
+
};
|
|
2515
|
+
Essentia2.prototype.Spectrum = function(frame, size) {
|
|
2516
|
+
if (size === void 0) {
|
|
2517
|
+
size = 2048;
|
|
2518
|
+
}
|
|
2519
|
+
return this.algorithms.Spectrum(frame, size);
|
|
2520
|
+
};
|
|
2521
|
+
Essentia2.prototype.SpectrumCQ = function(frame, binsPerOctave, minFrequency, minimumKernelSize, numberBins, sampleRate, scale, threshold, windowType, zeroPhase) {
|
|
2522
|
+
if (binsPerOctave === void 0) {
|
|
2523
|
+
binsPerOctave = 12;
|
|
2524
|
+
}
|
|
2525
|
+
if (minFrequency === void 0) {
|
|
2526
|
+
minFrequency = 32.7;
|
|
2527
|
+
}
|
|
2528
|
+
if (minimumKernelSize === void 0) {
|
|
2529
|
+
minimumKernelSize = 4;
|
|
2530
|
+
}
|
|
2531
|
+
if (numberBins === void 0) {
|
|
2532
|
+
numberBins = 84;
|
|
2533
|
+
}
|
|
2534
|
+
if (sampleRate === void 0) {
|
|
2535
|
+
sampleRate = 44100;
|
|
2536
|
+
}
|
|
2537
|
+
if (scale === void 0) {
|
|
2538
|
+
scale = 1;
|
|
2539
|
+
}
|
|
2540
|
+
if (threshold === void 0) {
|
|
2541
|
+
threshold = 0.01;
|
|
2542
|
+
}
|
|
2543
|
+
if (windowType === void 0) {
|
|
2544
|
+
windowType = "hann";
|
|
2545
|
+
}
|
|
2546
|
+
if (zeroPhase === void 0) {
|
|
2547
|
+
zeroPhase = true;
|
|
2548
|
+
}
|
|
2549
|
+
return this.algorithms.SpectrumCQ(frame, binsPerOctave, minFrequency, minimumKernelSize, numberBins, sampleRate, scale, threshold, windowType, zeroPhase);
|
|
2550
|
+
};
|
|
2551
|
+
Essentia2.prototype.SpectrumToCent = function(spectrum, bands, centBinResolution, inputSize, log, minimumFrequency, normalize, sampleRate, type) {
|
|
2552
|
+
if (bands === void 0) {
|
|
2553
|
+
bands = 720;
|
|
2554
|
+
}
|
|
2555
|
+
if (centBinResolution === void 0) {
|
|
2556
|
+
centBinResolution = 10;
|
|
2557
|
+
}
|
|
2558
|
+
if (inputSize === void 0) {
|
|
2559
|
+
inputSize = 32768;
|
|
2560
|
+
}
|
|
2561
|
+
if (log === void 0) {
|
|
2562
|
+
log = true;
|
|
2563
|
+
}
|
|
2564
|
+
if (minimumFrequency === void 0) {
|
|
2565
|
+
minimumFrequency = 164;
|
|
2566
|
+
}
|
|
2567
|
+
if (normalize === void 0) {
|
|
2568
|
+
normalize = "unit_sum";
|
|
2569
|
+
}
|
|
2570
|
+
if (sampleRate === void 0) {
|
|
2571
|
+
sampleRate = 44100;
|
|
2572
|
+
}
|
|
2573
|
+
if (type === void 0) {
|
|
2574
|
+
type = "power";
|
|
2575
|
+
}
|
|
2576
|
+
return this.algorithms.SpectrumToCent(spectrum, bands, centBinResolution, inputSize, log, minimumFrequency, normalize, sampleRate, type);
|
|
2577
|
+
};
|
|
2578
|
+
Essentia2.prototype.Spline = function(x, beta1, beta2, type, xPoints, yPoints) {
|
|
2579
|
+
if (beta1 === void 0) {
|
|
2580
|
+
beta1 = 1;
|
|
2581
|
+
}
|
|
2582
|
+
if (beta2 === void 0) {
|
|
2583
|
+
beta2 = 0;
|
|
2584
|
+
}
|
|
2585
|
+
if (type === void 0) {
|
|
2586
|
+
type = "b";
|
|
2587
|
+
}
|
|
2588
|
+
if (xPoints === void 0) {
|
|
2589
|
+
xPoints = [0, 1];
|
|
2590
|
+
}
|
|
2591
|
+
if (yPoints === void 0) {
|
|
2592
|
+
yPoints = [0, 1];
|
|
2593
|
+
}
|
|
2594
|
+
var vecxPoints = new this.module.VectorFloat();
|
|
2595
|
+
for (var i = 0; i < vecxPoints.size(); i++) {
|
|
2596
|
+
vecxPoints.push_back(xPoints[i]);
|
|
2597
|
+
}
|
|
2598
|
+
var vecyPoints = new this.module.VectorFloat();
|
|
2599
|
+
for (var i = 0; i < vecyPoints.size(); i++) {
|
|
2600
|
+
vecyPoints.push_back(yPoints[i]);
|
|
2601
|
+
}
|
|
2602
|
+
return this.algorithms.Spline(x, beta1, beta2, type, vecxPoints, vecyPoints);
|
|
2603
|
+
};
|
|
2604
|
+
Essentia2.prototype.SprModelAnal = function(frame, fftSize, freqDevOffset, freqDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, orderBy, sampleRate) {
|
|
2605
|
+
if (fftSize === void 0) {
|
|
2606
|
+
fftSize = 2048;
|
|
2607
|
+
}
|
|
2608
|
+
if (freqDevOffset === void 0) {
|
|
2609
|
+
freqDevOffset = 20;
|
|
2610
|
+
}
|
|
2611
|
+
if (freqDevSlope === void 0) {
|
|
2612
|
+
freqDevSlope = 0.01;
|
|
2613
|
+
}
|
|
2614
|
+
if (hopSize === void 0) {
|
|
2615
|
+
hopSize = 512;
|
|
2616
|
+
}
|
|
2617
|
+
if (magnitudeThreshold === void 0) {
|
|
2618
|
+
magnitudeThreshold = 0;
|
|
2619
|
+
}
|
|
2620
|
+
if (maxFrequency === void 0) {
|
|
2621
|
+
maxFrequency = 5e3;
|
|
2622
|
+
}
|
|
2623
|
+
if (maxPeaks === void 0) {
|
|
2624
|
+
maxPeaks = 100;
|
|
2625
|
+
}
|
|
2626
|
+
if (maxnSines === void 0) {
|
|
2627
|
+
maxnSines = 100;
|
|
2628
|
+
}
|
|
2629
|
+
if (minFrequency === void 0) {
|
|
2630
|
+
minFrequency = 0;
|
|
2631
|
+
}
|
|
2632
|
+
if (orderBy === void 0) {
|
|
2633
|
+
orderBy = "frequency";
|
|
2634
|
+
}
|
|
2635
|
+
if (sampleRate === void 0) {
|
|
2636
|
+
sampleRate = 44100;
|
|
2637
|
+
}
|
|
2638
|
+
return this.algorithms.SprModelAnal(frame, fftSize, freqDevOffset, freqDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, orderBy, sampleRate);
|
|
2639
|
+
};
|
|
2640
|
+
Essentia2.prototype.SprModelSynth = function(magnitudes, frequencies, phases, res, fftSize, hopSize, sampleRate) {
|
|
2641
|
+
if (fftSize === void 0) {
|
|
2642
|
+
fftSize = 2048;
|
|
2643
|
+
}
|
|
2644
|
+
if (hopSize === void 0) {
|
|
2645
|
+
hopSize = 512;
|
|
2646
|
+
}
|
|
2647
|
+
if (sampleRate === void 0) {
|
|
2648
|
+
sampleRate = 44100;
|
|
2649
|
+
}
|
|
2650
|
+
return this.algorithms.SprModelSynth(magnitudes, frequencies, phases, res, fftSize, hopSize, sampleRate);
|
|
2651
|
+
};
|
|
2652
|
+
Essentia2.prototype.SpsModelAnal = function(frame, fftSize, freqDevOffset, freqDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, orderBy, sampleRate, stocf) {
|
|
2653
|
+
if (fftSize === void 0) {
|
|
2654
|
+
fftSize = 2048;
|
|
2655
|
+
}
|
|
2656
|
+
if (freqDevOffset === void 0) {
|
|
2657
|
+
freqDevOffset = 20;
|
|
2658
|
+
}
|
|
2659
|
+
if (freqDevSlope === void 0) {
|
|
2660
|
+
freqDevSlope = 0.01;
|
|
2661
|
+
}
|
|
2662
|
+
if (hopSize === void 0) {
|
|
2663
|
+
hopSize = 512;
|
|
2664
|
+
}
|
|
2665
|
+
if (magnitudeThreshold === void 0) {
|
|
2666
|
+
magnitudeThreshold = 0;
|
|
2667
|
+
}
|
|
2668
|
+
if (maxFrequency === void 0) {
|
|
2669
|
+
maxFrequency = 5e3;
|
|
2670
|
+
}
|
|
2671
|
+
if (maxPeaks === void 0) {
|
|
2672
|
+
maxPeaks = 100;
|
|
2673
|
+
}
|
|
2674
|
+
if (maxnSines === void 0) {
|
|
2675
|
+
maxnSines = 100;
|
|
2676
|
+
}
|
|
2677
|
+
if (minFrequency === void 0) {
|
|
2678
|
+
minFrequency = 0;
|
|
2679
|
+
}
|
|
2680
|
+
if (orderBy === void 0) {
|
|
2681
|
+
orderBy = "frequency";
|
|
2682
|
+
}
|
|
2683
|
+
if (sampleRate === void 0) {
|
|
2684
|
+
sampleRate = 44100;
|
|
2685
|
+
}
|
|
2686
|
+
if (stocf === void 0) {
|
|
2687
|
+
stocf = 0.2;
|
|
2688
|
+
}
|
|
2689
|
+
return this.algorithms.SpsModelAnal(frame, fftSize, freqDevOffset, freqDevSlope, hopSize, magnitudeThreshold, maxFrequency, maxPeaks, maxnSines, minFrequency, orderBy, sampleRate, stocf);
|
|
2690
|
+
};
|
|
2691
|
+
Essentia2.prototype.SpsModelSynth = function(magnitudes, frequencies, phases, stocenv, fftSize, hopSize, sampleRate, stocf) {
|
|
2692
|
+
if (fftSize === void 0) {
|
|
2693
|
+
fftSize = 2048;
|
|
2694
|
+
}
|
|
2695
|
+
if (hopSize === void 0) {
|
|
2696
|
+
hopSize = 512;
|
|
2697
|
+
}
|
|
2698
|
+
if (sampleRate === void 0) {
|
|
2699
|
+
sampleRate = 44100;
|
|
2700
|
+
}
|
|
2701
|
+
if (stocf === void 0) {
|
|
2702
|
+
stocf = 0.2;
|
|
2703
|
+
}
|
|
2704
|
+
return this.algorithms.SpsModelSynth(magnitudes, frequencies, phases, stocenv, fftSize, hopSize, sampleRate, stocf);
|
|
2705
|
+
};
|
|
2706
|
+
Essentia2.prototype.StartStopCut = function(audio, frameSize, hopSize, maximumStartTime, maximumStopTime, sampleRate, threshold) {
|
|
2707
|
+
if (frameSize === void 0) {
|
|
2708
|
+
frameSize = 256;
|
|
2709
|
+
}
|
|
2710
|
+
if (hopSize === void 0) {
|
|
2711
|
+
hopSize = 256;
|
|
2712
|
+
}
|
|
2713
|
+
if (maximumStartTime === void 0) {
|
|
2714
|
+
maximumStartTime = 10;
|
|
2715
|
+
}
|
|
2716
|
+
if (maximumStopTime === void 0) {
|
|
2717
|
+
maximumStopTime = 10;
|
|
2718
|
+
}
|
|
2719
|
+
if (sampleRate === void 0) {
|
|
2720
|
+
sampleRate = 44100;
|
|
2721
|
+
}
|
|
2722
|
+
if (threshold === void 0) {
|
|
2723
|
+
threshold = -60;
|
|
2724
|
+
}
|
|
2725
|
+
return this.algorithms.StartStopCut(audio, frameSize, hopSize, maximumStartTime, maximumStopTime, sampleRate, threshold);
|
|
2726
|
+
};
|
|
2727
|
+
Essentia2.prototype.StartStopSilence = function(frame, threshold) {
|
|
2728
|
+
if (threshold === void 0) {
|
|
2729
|
+
threshold = -60;
|
|
2730
|
+
}
|
|
2731
|
+
return this.algorithms.StartStopSilence(frame, threshold);
|
|
2732
|
+
};
|
|
2733
|
+
Essentia2.prototype.StochasticModelAnal = function(frame, fftSize, hopSize, sampleRate, stocf) {
|
|
2734
|
+
if (fftSize === void 0) {
|
|
2735
|
+
fftSize = 2048;
|
|
2736
|
+
}
|
|
2737
|
+
if (hopSize === void 0) {
|
|
2738
|
+
hopSize = 512;
|
|
2739
|
+
}
|
|
2740
|
+
if (sampleRate === void 0) {
|
|
2741
|
+
sampleRate = 44100;
|
|
2742
|
+
}
|
|
2743
|
+
if (stocf === void 0) {
|
|
2744
|
+
stocf = 0.2;
|
|
2745
|
+
}
|
|
2746
|
+
return this.algorithms.StochasticModelAnal(frame, fftSize, hopSize, sampleRate, stocf);
|
|
2747
|
+
};
|
|
2748
|
+
Essentia2.prototype.StochasticModelSynth = function(stocenv, fftSize, hopSize, sampleRate, stocf) {
|
|
2749
|
+
if (fftSize === void 0) {
|
|
2750
|
+
fftSize = 2048;
|
|
2751
|
+
}
|
|
2752
|
+
if (hopSize === void 0) {
|
|
2753
|
+
hopSize = 512;
|
|
2754
|
+
}
|
|
2755
|
+
if (sampleRate === void 0) {
|
|
2756
|
+
sampleRate = 44100;
|
|
2757
|
+
}
|
|
2758
|
+
if (stocf === void 0) {
|
|
2759
|
+
stocf = 0.2;
|
|
2760
|
+
}
|
|
2761
|
+
return this.algorithms.StochasticModelSynth(stocenv, fftSize, hopSize, sampleRate, stocf);
|
|
2762
|
+
};
|
|
2763
|
+
Essentia2.prototype.StrongDecay = function(signal, sampleRate) {
|
|
2764
|
+
if (sampleRate === void 0) {
|
|
2765
|
+
sampleRate = 44100;
|
|
2766
|
+
}
|
|
2767
|
+
return this.algorithms.StrongDecay(signal, sampleRate);
|
|
2768
|
+
};
|
|
2769
|
+
Essentia2.prototype.StrongPeak = function(spectrum) {
|
|
2770
|
+
return this.algorithms.StrongPeak(spectrum);
|
|
2771
|
+
};
|
|
2772
|
+
Essentia2.prototype.SuperFluxExtractor = function(signal, combine, frameSize, hopSize, ratioThreshold, sampleRate, threshold) {
|
|
2773
|
+
if (combine === void 0) {
|
|
2774
|
+
combine = 20;
|
|
2775
|
+
}
|
|
2776
|
+
if (frameSize === void 0) {
|
|
2777
|
+
frameSize = 2048;
|
|
2778
|
+
}
|
|
2779
|
+
if (hopSize === void 0) {
|
|
2780
|
+
hopSize = 256;
|
|
2781
|
+
}
|
|
2782
|
+
if (ratioThreshold === void 0) {
|
|
2783
|
+
ratioThreshold = 16;
|
|
2784
|
+
}
|
|
2785
|
+
if (sampleRate === void 0) {
|
|
2786
|
+
sampleRate = 44100;
|
|
2787
|
+
}
|
|
2788
|
+
if (threshold === void 0) {
|
|
2789
|
+
threshold = 0.05;
|
|
2790
|
+
}
|
|
2791
|
+
return this.algorithms.SuperFluxExtractor(signal, combine, frameSize, hopSize, ratioThreshold, sampleRate, threshold);
|
|
2792
|
+
};
|
|
2793
|
+
Essentia2.prototype.SuperFluxNovelty = function(bands, binWidth, frameWidth) {
|
|
2794
|
+
if (binWidth === void 0) {
|
|
2795
|
+
binWidth = 3;
|
|
2796
|
+
}
|
|
2797
|
+
if (frameWidth === void 0) {
|
|
2798
|
+
frameWidth = 2;
|
|
2799
|
+
}
|
|
2800
|
+
return this.algorithms.SuperFluxNovelty(bands, binWidth, frameWidth);
|
|
2801
|
+
};
|
|
2802
|
+
Essentia2.prototype.SuperFluxPeaks = function(novelty, combine, frameRate, pre_avg, pre_max, ratioThreshold, threshold) {
|
|
2803
|
+
if (combine === void 0) {
|
|
2804
|
+
combine = 30;
|
|
2805
|
+
}
|
|
2806
|
+
if (frameRate === void 0) {
|
|
2807
|
+
frameRate = 172;
|
|
2808
|
+
}
|
|
2809
|
+
if (pre_avg === void 0) {
|
|
2810
|
+
pre_avg = 100;
|
|
2811
|
+
}
|
|
2812
|
+
if (pre_max === void 0) {
|
|
2813
|
+
pre_max = 30;
|
|
2814
|
+
}
|
|
2815
|
+
if (ratioThreshold === void 0) {
|
|
2816
|
+
ratioThreshold = 16;
|
|
2817
|
+
}
|
|
2818
|
+
if (threshold === void 0) {
|
|
2819
|
+
threshold = 0.05;
|
|
2820
|
+
}
|
|
2821
|
+
return this.algorithms.SuperFluxPeaks(novelty, combine, frameRate, pre_avg, pre_max, ratioThreshold, threshold);
|
|
2822
|
+
};
|
|
2823
|
+
Essentia2.prototype.TCToTotal = function(envelope) {
|
|
2824
|
+
return this.algorithms.TCToTotal(envelope);
|
|
2825
|
+
};
|
|
2826
|
+
Essentia2.prototype.TempoScaleBands = function(bands, bandsGain, frameTime) {
|
|
2827
|
+
if (bandsGain === void 0) {
|
|
2828
|
+
bandsGain = [2, 3, 2, 1, 1.20000004768, 2, 3, 2.5];
|
|
2829
|
+
}
|
|
2830
|
+
if (frameTime === void 0) {
|
|
2831
|
+
frameTime = 512;
|
|
2832
|
+
}
|
|
2833
|
+
var vecbandsGain = new this.module.VectorFloat();
|
|
2834
|
+
for (var i = 0; i < vecbandsGain.size(); i++) {
|
|
2835
|
+
vecbandsGain.push_back(bandsGain[i]);
|
|
2836
|
+
}
|
|
2837
|
+
return this.algorithms.TempoScaleBands(bands, vecbandsGain, frameTime);
|
|
2838
|
+
};
|
|
2839
|
+
Essentia2.prototype.TempoTap = function(featuresFrame, frameHop, frameSize, maxTempo, minTempo, numberFrames, sampleRate, tempoHints) {
|
|
2840
|
+
if (frameHop === void 0) {
|
|
2841
|
+
frameHop = 1024;
|
|
2842
|
+
}
|
|
2843
|
+
if (frameSize === void 0) {
|
|
2844
|
+
frameSize = 256;
|
|
2845
|
+
}
|
|
2846
|
+
if (maxTempo === void 0) {
|
|
2847
|
+
maxTempo = 208;
|
|
2848
|
+
}
|
|
2849
|
+
if (minTempo === void 0) {
|
|
2850
|
+
minTempo = 40;
|
|
2851
|
+
}
|
|
2852
|
+
if (numberFrames === void 0) {
|
|
2853
|
+
numberFrames = 1024;
|
|
2854
|
+
}
|
|
2855
|
+
if (sampleRate === void 0) {
|
|
2856
|
+
sampleRate = 44100;
|
|
2857
|
+
}
|
|
2858
|
+
if (tempoHints === void 0) {
|
|
2859
|
+
tempoHints = [];
|
|
2860
|
+
}
|
|
2861
|
+
var vectempoHints = new this.module.VectorFloat();
|
|
2862
|
+
for (var i = 0; i < vectempoHints.size(); i++) {
|
|
2863
|
+
vectempoHints.push_back(tempoHints[i]);
|
|
2864
|
+
}
|
|
2865
|
+
return this.algorithms.TempoTap(featuresFrame, frameHop, frameSize, maxTempo, minTempo, numberFrames, sampleRate, vectempoHints);
|
|
2866
|
+
};
|
|
2867
|
+
Essentia2.prototype.TempoTapDegara = function(onsetDetections, maxTempo, minTempo, resample, sampleRateODF) {
|
|
2868
|
+
if (maxTempo === void 0) {
|
|
2869
|
+
maxTempo = 208;
|
|
2870
|
+
}
|
|
2871
|
+
if (minTempo === void 0) {
|
|
2872
|
+
minTempo = 40;
|
|
2873
|
+
}
|
|
2874
|
+
if (resample === void 0) {
|
|
2875
|
+
resample = "none";
|
|
2876
|
+
}
|
|
2877
|
+
if (sampleRateODF === void 0) {
|
|
2878
|
+
sampleRateODF = 86.1328;
|
|
2879
|
+
}
|
|
2880
|
+
return this.algorithms.TempoTapDegara(onsetDetections, maxTempo, minTempo, resample, sampleRateODF);
|
|
2881
|
+
};
|
|
2882
|
+
Essentia2.prototype.TempoTapMaxAgreement = function(tickCandidates) {
|
|
2883
|
+
return this.algorithms.TempoTapMaxAgreement(tickCandidates);
|
|
2884
|
+
};
|
|
2885
|
+
Essentia2.prototype.TempoTapTicks = function(periods, phases, frameHop, hopSize, sampleRate) {
|
|
2886
|
+
if (frameHop === void 0) {
|
|
2887
|
+
frameHop = 512;
|
|
2888
|
+
}
|
|
2889
|
+
if (hopSize === void 0) {
|
|
2890
|
+
hopSize = 256;
|
|
2891
|
+
}
|
|
2892
|
+
if (sampleRate === void 0) {
|
|
2893
|
+
sampleRate = 44100;
|
|
2894
|
+
}
|
|
2895
|
+
return this.algorithms.TempoTapTicks(periods, phases, frameHop, hopSize, sampleRate);
|
|
2896
|
+
};
|
|
2897
|
+
Essentia2.prototype.TensorflowInputMusiCNN = function(frame) {
|
|
2898
|
+
return this.algorithms.TensorflowInputMusiCNN(frame);
|
|
2899
|
+
};
|
|
2900
|
+
Essentia2.prototype.TensorflowInputVGGish = function(frame) {
|
|
2901
|
+
return this.algorithms.TensorflowInputVGGish(frame);
|
|
2902
|
+
};
|
|
2903
|
+
Essentia2.prototype.TonalExtractor = function(signal, frameSize, hopSize, tuningFrequency) {
|
|
2904
|
+
if (frameSize === void 0) {
|
|
2905
|
+
frameSize = 4096;
|
|
2906
|
+
}
|
|
2907
|
+
if (hopSize === void 0) {
|
|
2908
|
+
hopSize = 2048;
|
|
2909
|
+
}
|
|
2910
|
+
if (tuningFrequency === void 0) {
|
|
2911
|
+
tuningFrequency = 440;
|
|
2912
|
+
}
|
|
2913
|
+
return this.algorithms.TonalExtractor(signal, frameSize, hopSize, tuningFrequency);
|
|
2914
|
+
};
|
|
2915
|
+
Essentia2.prototype.TonicIndianArtMusic = function(signal, binResolution, frameSize, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxTonicFrequency, minTonicFrequency, numberHarmonics, numberSaliencePeaks, referenceFrequency, sampleRate) {
|
|
2916
|
+
if (binResolution === void 0) {
|
|
2917
|
+
binResolution = 10;
|
|
2918
|
+
}
|
|
2919
|
+
if (frameSize === void 0) {
|
|
2920
|
+
frameSize = 2048;
|
|
2921
|
+
}
|
|
2922
|
+
if (harmonicWeight === void 0) {
|
|
2923
|
+
harmonicWeight = 0.85;
|
|
2924
|
+
}
|
|
2925
|
+
if (hopSize === void 0) {
|
|
2926
|
+
hopSize = 512;
|
|
2927
|
+
}
|
|
2928
|
+
if (magnitudeCompression === void 0) {
|
|
2929
|
+
magnitudeCompression = 1;
|
|
2930
|
+
}
|
|
2931
|
+
if (magnitudeThreshold === void 0) {
|
|
2932
|
+
magnitudeThreshold = 40;
|
|
2933
|
+
}
|
|
2934
|
+
if (maxTonicFrequency === void 0) {
|
|
2935
|
+
maxTonicFrequency = 375;
|
|
2936
|
+
}
|
|
2937
|
+
if (minTonicFrequency === void 0) {
|
|
2938
|
+
minTonicFrequency = 100;
|
|
2939
|
+
}
|
|
2940
|
+
if (numberHarmonics === void 0) {
|
|
2941
|
+
numberHarmonics = 20;
|
|
2942
|
+
}
|
|
2943
|
+
if (numberSaliencePeaks === void 0) {
|
|
2944
|
+
numberSaliencePeaks = 5;
|
|
2945
|
+
}
|
|
2946
|
+
if (referenceFrequency === void 0) {
|
|
2947
|
+
referenceFrequency = 55;
|
|
2948
|
+
}
|
|
2949
|
+
if (sampleRate === void 0) {
|
|
2950
|
+
sampleRate = 44100;
|
|
2951
|
+
}
|
|
2952
|
+
return this.algorithms.TonicIndianArtMusic(signal, binResolution, frameSize, harmonicWeight, hopSize, magnitudeCompression, magnitudeThreshold, maxTonicFrequency, minTonicFrequency, numberHarmonics, numberSaliencePeaks, referenceFrequency, sampleRate);
|
|
2953
|
+
};
|
|
2954
|
+
Essentia2.prototype.TriangularBands = function(spectrum, frequencyBands, inputSize, log, normalize, sampleRate, type, weighting) {
|
|
2955
|
+
if (frequencyBands === void 0) {
|
|
2956
|
+
frequencyBands = [21.533203125, 43.06640625, 64.599609375, 86.1328125, 107.666015625, 129.19921875, 150.732421875, 172.265625, 193.798828125, 215.33203125, 236.865234375, 258.3984375, 279.931640625, 301.46484375, 322.998046875, 344.53125, 366.064453125, 387.59765625, 409.130859375, 430.6640625, 452.197265625, 473.73046875, 495.263671875, 516.796875, 538.330078125, 559.86328125, 581.396484375, 602.9296875, 624.462890625, 645.99609375, 667.529296875, 689.0625, 710.595703125, 732.12890625, 753.662109375, 775.1953125, 796.728515625, 839.794921875, 861.328125, 882.861328125, 904.39453125, 925.927734375, 968.994140625, 990.52734375, 1012.06054688, 1055.12695312, 1076.66015625, 1098.19335938, 1141.25976562, 1184.32617188, 1205.859375, 1248.92578125, 1270.45898438, 1313.52539062, 1356.59179688, 1399.65820312, 1442.72460938, 1485.79101562, 1528.85742188, 1571.92382812, 1614.99023438, 1658.05664062, 1701.12304688, 1765.72265625, 1808.7890625, 1873.38867188, 1916.45507812, 1981.0546875, 2024.12109375, 2088.72070312, 2153.3203125, 2217.91992188, 2282.51953125, 2347.11914062, 2411.71875, 2497.8515625, 2562.45117188, 2627.05078125, 2713.18359375, 2799.31640625, 2885.44921875, 2950.04882812, 3036.18164062, 3143.84765625, 3229.98046875, 3316.11328125, 3423.77929688, 3509.91210938, 3617.578125, 3725.24414062, 3832.91015625, 3940.57617188, 4069.77539062, 4177.44140625, 4306.640625, 4435.83984375, 4565.0390625, 4694.23828125, 4844.97070312, 4974.16992188, 5124.90234375, 5275.63476562, 5426.3671875, 5577.09960938, 5749.36523438, 5921.63085938, 6093.89648438, 6266.16210938, 6459.9609375, 6653.75976562, 6847.55859375, 7041.35742188, 7256.68945312, 7450.48828125, 7687.35351562, 7902.68554688, 8139.55078125, 8376.41601562, 8613.28125, 8871.6796875, 9130.078125, 9388.4765625, 9668.40820312, 9948.33984375, 10249.8046875, 10551.2695312, 10852.734375, 11175.7324219, 11498.7304688, 11843.2617188, 12187.7929688, 12553.8574219, 12919.921875, 13285.9863281, 13673.5839844, 14082.7148438, 14491.8457031, 14922.5097656, 15353.1738281, 15805.3710938, 16257.5683594];
|
|
2957
|
+
}
|
|
2958
|
+
if (inputSize === void 0) {
|
|
2959
|
+
inputSize = 1025;
|
|
2960
|
+
}
|
|
2961
|
+
if (log === void 0) {
|
|
2962
|
+
log = true;
|
|
2963
|
+
}
|
|
2964
|
+
if (normalize === void 0) {
|
|
2965
|
+
normalize = "unit_sum";
|
|
2966
|
+
}
|
|
2967
|
+
if (sampleRate === void 0) {
|
|
2968
|
+
sampleRate = 44100;
|
|
2969
|
+
}
|
|
2970
|
+
if (type === void 0) {
|
|
2971
|
+
type = "power";
|
|
2972
|
+
}
|
|
2973
|
+
if (weighting === void 0) {
|
|
2974
|
+
weighting = "linear";
|
|
2975
|
+
}
|
|
2976
|
+
var vecfrequencyBands = new this.module.VectorFloat();
|
|
2977
|
+
for (var i = 0; i < vecfrequencyBands.size(); i++) {
|
|
2978
|
+
vecfrequencyBands.push_back(frequencyBands[i]);
|
|
2979
|
+
}
|
|
2980
|
+
return this.algorithms.TriangularBands(spectrum, vecfrequencyBands, inputSize, log, normalize, sampleRate, type, weighting);
|
|
2981
|
+
};
|
|
2982
|
+
Essentia2.prototype.TriangularBarkBands = function(spectrum, highFrequencyBound, inputSize, log, lowFrequencyBound, normalize, numberBands, sampleRate, type, weighting) {
|
|
2983
|
+
if (highFrequencyBound === void 0) {
|
|
2984
|
+
highFrequencyBound = 22050;
|
|
2985
|
+
}
|
|
2986
|
+
if (inputSize === void 0) {
|
|
2987
|
+
inputSize = 1025;
|
|
2988
|
+
}
|
|
2989
|
+
if (log === void 0) {
|
|
2990
|
+
log = false;
|
|
2991
|
+
}
|
|
2992
|
+
if (lowFrequencyBound === void 0) {
|
|
2993
|
+
lowFrequencyBound = 0;
|
|
2994
|
+
}
|
|
2995
|
+
if (normalize === void 0) {
|
|
2996
|
+
normalize = "unit_sum";
|
|
2997
|
+
}
|
|
2998
|
+
if (numberBands === void 0) {
|
|
2999
|
+
numberBands = 24;
|
|
3000
|
+
}
|
|
3001
|
+
if (sampleRate === void 0) {
|
|
3002
|
+
sampleRate = 44100;
|
|
3003
|
+
}
|
|
3004
|
+
if (type === void 0) {
|
|
3005
|
+
type = "power";
|
|
3006
|
+
}
|
|
3007
|
+
if (weighting === void 0) {
|
|
3008
|
+
weighting = "warping";
|
|
3009
|
+
}
|
|
3010
|
+
return this.algorithms.TriangularBarkBands(spectrum, highFrequencyBound, inputSize, log, lowFrequencyBound, normalize, numberBands, sampleRate, type, weighting);
|
|
3011
|
+
};
|
|
3012
|
+
Essentia2.prototype.Trimmer = function(signal, checkRange, endTime, sampleRate, startTime) {
|
|
3013
|
+
if (checkRange === void 0) {
|
|
3014
|
+
checkRange = false;
|
|
3015
|
+
}
|
|
3016
|
+
if (endTime === void 0) {
|
|
3017
|
+
endTime = 1e6;
|
|
3018
|
+
}
|
|
3019
|
+
if (sampleRate === void 0) {
|
|
3020
|
+
sampleRate = 44100;
|
|
3021
|
+
}
|
|
3022
|
+
if (startTime === void 0) {
|
|
3023
|
+
startTime = 0;
|
|
3024
|
+
}
|
|
3025
|
+
return this.algorithms.Trimmer(signal, checkRange, endTime, sampleRate, startTime);
|
|
3026
|
+
};
|
|
3027
|
+
Essentia2.prototype.Tristimulus = function(frequencies, magnitudes) {
|
|
3028
|
+
return this.algorithms.Tristimulus(frequencies, magnitudes);
|
|
3029
|
+
};
|
|
3030
|
+
Essentia2.prototype.TruePeakDetector = function(signal, blockDC, emphasise, oversamplingFactor, quality, sampleRate, threshold, version) {
|
|
3031
|
+
if (blockDC === void 0) {
|
|
3032
|
+
blockDC = false;
|
|
3033
|
+
}
|
|
3034
|
+
if (emphasise === void 0) {
|
|
3035
|
+
emphasise = false;
|
|
3036
|
+
}
|
|
3037
|
+
if (oversamplingFactor === void 0) {
|
|
3038
|
+
oversamplingFactor = 4;
|
|
3039
|
+
}
|
|
3040
|
+
if (quality === void 0) {
|
|
3041
|
+
quality = 1;
|
|
3042
|
+
}
|
|
3043
|
+
if (sampleRate === void 0) {
|
|
3044
|
+
sampleRate = 44100;
|
|
3045
|
+
}
|
|
3046
|
+
if (threshold === void 0) {
|
|
3047
|
+
threshold = -2e-4;
|
|
3048
|
+
}
|
|
3049
|
+
if (version === void 0) {
|
|
3050
|
+
version = 4;
|
|
3051
|
+
}
|
|
3052
|
+
return this.algorithms.TruePeakDetector(signal, blockDC, emphasise, oversamplingFactor, quality, sampleRate, threshold, version);
|
|
3053
|
+
};
|
|
3054
|
+
Essentia2.prototype.TuningFrequency = function(frequencies, magnitudes, resolution) {
|
|
3055
|
+
if (resolution === void 0) {
|
|
3056
|
+
resolution = 1;
|
|
3057
|
+
}
|
|
3058
|
+
return this.algorithms.TuningFrequency(frequencies, magnitudes, resolution);
|
|
3059
|
+
};
|
|
3060
|
+
Essentia2.prototype.TuningFrequencyExtractor = function(signal, frameSize, hopSize) {
|
|
3061
|
+
if (frameSize === void 0) {
|
|
3062
|
+
frameSize = 4096;
|
|
3063
|
+
}
|
|
3064
|
+
if (hopSize === void 0) {
|
|
3065
|
+
hopSize = 2048;
|
|
3066
|
+
}
|
|
3067
|
+
return this.algorithms.TuningFrequencyExtractor(signal, frameSize, hopSize);
|
|
3068
|
+
};
|
|
3069
|
+
Essentia2.prototype.UnaryOperator = function(array, scale, shift, type) {
|
|
3070
|
+
if (scale === void 0) {
|
|
3071
|
+
scale = 1;
|
|
3072
|
+
}
|
|
3073
|
+
if (shift === void 0) {
|
|
3074
|
+
shift = 0;
|
|
3075
|
+
}
|
|
3076
|
+
if (type === void 0) {
|
|
3077
|
+
type = "identity";
|
|
3078
|
+
}
|
|
3079
|
+
return this.algorithms.UnaryOperator(array, scale, shift, type);
|
|
3080
|
+
};
|
|
3081
|
+
Essentia2.prototype.UnaryOperatorStream = function(array, scale, shift, type) {
|
|
3082
|
+
if (scale === void 0) {
|
|
3083
|
+
scale = 1;
|
|
3084
|
+
}
|
|
3085
|
+
if (shift === void 0) {
|
|
3086
|
+
shift = 0;
|
|
3087
|
+
}
|
|
3088
|
+
if (type === void 0) {
|
|
3089
|
+
type = "identity";
|
|
3090
|
+
}
|
|
3091
|
+
return this.algorithms.UnaryOperatorStream(array, scale, shift, type);
|
|
3092
|
+
};
|
|
3093
|
+
Essentia2.prototype.Variance = function(array) {
|
|
3094
|
+
return this.algorithms.Variance(array);
|
|
3095
|
+
};
|
|
3096
|
+
Essentia2.prototype.Vibrato = function(pitch, maxExtend, maxFrequency, minExtend, minFrequency, sampleRate) {
|
|
3097
|
+
if (maxExtend === void 0) {
|
|
3098
|
+
maxExtend = 250;
|
|
3099
|
+
}
|
|
3100
|
+
if (maxFrequency === void 0) {
|
|
3101
|
+
maxFrequency = 8;
|
|
3102
|
+
}
|
|
3103
|
+
if (minExtend === void 0) {
|
|
3104
|
+
minExtend = 50;
|
|
3105
|
+
}
|
|
3106
|
+
if (minFrequency === void 0) {
|
|
3107
|
+
minFrequency = 4;
|
|
3108
|
+
}
|
|
3109
|
+
if (sampleRate === void 0) {
|
|
3110
|
+
sampleRate = 344.531;
|
|
3111
|
+
}
|
|
3112
|
+
return this.algorithms.Vibrato(pitch, maxExtend, maxFrequency, minExtend, minFrequency, sampleRate);
|
|
3113
|
+
};
|
|
3114
|
+
Essentia2.prototype.WarpedAutoCorrelation = function(array, maxLag, sampleRate) {
|
|
3115
|
+
if (maxLag === void 0) {
|
|
3116
|
+
maxLag = 1;
|
|
3117
|
+
}
|
|
3118
|
+
if (sampleRate === void 0) {
|
|
3119
|
+
sampleRate = 44100;
|
|
3120
|
+
}
|
|
3121
|
+
return this.algorithms.WarpedAutoCorrelation(array, maxLag, sampleRate);
|
|
3122
|
+
};
|
|
3123
|
+
Essentia2.prototype.Welch = function(frame, averagingFrames, fftSize, frameSize, sampleRate, scaling, windowType) {
|
|
3124
|
+
if (averagingFrames === void 0) {
|
|
3125
|
+
averagingFrames = 10;
|
|
3126
|
+
}
|
|
3127
|
+
if (fftSize === void 0) {
|
|
3128
|
+
fftSize = 1024;
|
|
3129
|
+
}
|
|
3130
|
+
if (frameSize === void 0) {
|
|
3131
|
+
frameSize = 512;
|
|
3132
|
+
}
|
|
3133
|
+
if (sampleRate === void 0) {
|
|
3134
|
+
sampleRate = 44100;
|
|
3135
|
+
}
|
|
3136
|
+
if (scaling === void 0) {
|
|
3137
|
+
scaling = "density";
|
|
3138
|
+
}
|
|
3139
|
+
if (windowType === void 0) {
|
|
3140
|
+
windowType = "hann";
|
|
3141
|
+
}
|
|
3142
|
+
return this.algorithms.Welch(frame, averagingFrames, fftSize, frameSize, sampleRate, scaling, windowType);
|
|
3143
|
+
};
|
|
3144
|
+
Essentia2.prototype.Windowing = function(frame, normalized, size, type, zeroPadding, zeroPhase) {
|
|
3145
|
+
if (normalized === void 0) {
|
|
3146
|
+
normalized = true;
|
|
3147
|
+
}
|
|
3148
|
+
if (size === void 0) {
|
|
3149
|
+
size = 1024;
|
|
3150
|
+
}
|
|
3151
|
+
if (type === void 0) {
|
|
3152
|
+
type = "hann";
|
|
3153
|
+
}
|
|
3154
|
+
if (zeroPadding === void 0) {
|
|
3155
|
+
zeroPadding = 0;
|
|
3156
|
+
}
|
|
3157
|
+
if (zeroPhase === void 0) {
|
|
3158
|
+
zeroPhase = true;
|
|
3159
|
+
}
|
|
3160
|
+
return this.algorithms.Windowing(frame, normalized, size, type, zeroPadding, zeroPhase);
|
|
3161
|
+
};
|
|
3162
|
+
Essentia2.prototype.ZeroCrossingRate = function(signal, threshold) {
|
|
3163
|
+
if (threshold === void 0) {
|
|
3164
|
+
threshold = 0;
|
|
3165
|
+
}
|
|
3166
|
+
return this.algorithms.ZeroCrossingRate(signal, threshold);
|
|
3167
|
+
};
|
|
3168
|
+
return Essentia2;
|
|
3169
|
+
}()
|
|
3170
|
+
);
|
|
3171
|
+
export {
|
|
3172
|
+
Essentia as default
|
|
3173
|
+
};
|
|
3174
|
+
//# sourceMappingURL=essentia.js-core.es-DnrJE0uR.js.map
|