-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathindex.d.ts
283 lines (250 loc) · 6.62 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
export type InputBuffer = Float32Array | number[];
/**
* default : use the default method
*
* Currently, the default method is set to yinfft .
*
* schmitt : Schmitt trigger
*
* This pitch extraction method implements a Schmitt trigger to estimate the
* period of a signal.
*
* This file was derived from the tuneit project, written by Mario Lang to
* detect the fundamental frequency of a sound.
*
* See http://delysid.org/tuneit.html
*
* fcomb : a fast harmonic comb filter
*
* This pitch extraction method implements a fast harmonic comb filter to
* determine the fundamental frequency of a harmonic sound.
*
* This file was derived from the tuneit project, written by Mario Lang to
* detect the fundamental frequency of a sound.
*
* See http://delysid.org/tuneit.html
*
* mcomb : multiple-comb filter
*
* This fundamental frequency estimation algorithm implements spectral
* flattening, multi-comb filtering and peak histogramming.
*
* This method was designed by Juan P. Bello and described in:
*
* Juan-Pablo Bello. ``Towards the Automated Analysis of Simple Polyphonic
* Music''. PhD thesis, Centre for Digital Music, Queen Mary University of
* London, London, UK, 2003.
*
* yin : YIN algorithm
*
* This algorithm was developed by A. de Cheveigne and H. Kawahara and
* published in:
*
* De Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency
* estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930.
*
* see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html
*
* yinfast : Yinfast algorithm
*
* This algorithm is equivalent to the YIN algorithm, but computed in the
* spectral domain for efficiency. See also `python/demos/demo_yin_compare.py`.
*
* yinfft : Yinfft algorithm
*
* This algorithm was derived from the YIN algorithm. In this implementation, a
* Fourier transform is used to compute a tapered square difference function,
* which allows spectral weighting. Because the difference function is tapered,
* the selection of the period is simplified.
*
* Paul Brossier, [Automatic annotation of musical audio for interactive
* systems](http://aubio.org/phd/), Chapter 3, Pitch Analysis, PhD thesis,
* Centre for Digital music, Queen Mary University of London, London, UK, 2006.
*/
export declare type PitchMethod =
| "default"
| "yin"
| "mcomb"
| "schmitt"
| "fcomb"
| "yinfft"
| "yinfast"
| "specacf";
export declare class Pitch {
/**
* execute pitch detection on an input signal frame
*/
do(buffer: InputBuffer): number;
}
export declare class Tempo {
/**
* execute tempo detection
*/
do(buffer: InputBuffer): number;
/**
* get current tempo
*/
getBpm(): number;
/**
* get current tempo confidence
*/
getConfidence(): number;
}
export declare class Onset {
/**
* execute onset detection
*/
do(buffer: InputBuffer): number;
/**
* get the time of the latest onset detected, in samples
*/
getLast(): number;
/**
* get the time of the latest onset detected, in seconds
*/
getLastS(): number;
/**
* get the time of the latest onset detected, in milliseconds
*/
getLastMs(): number;
/**
* set onset detection adaptive whitening
*/
setAwhitening(enable: boolean):number;
/**
* get onset detection adaptive whitening
*/
getAwhitening():number;
/**
* set or disable log compression
*/
setCompression(enable: boolean):number;
/**
* get onset detection log compression
*/
getCompression(): number;
/**
* set onset detection silence threshold
*/
setSilence(silence: number):number;
/**
* get onset detection silence threshold
*/
getSilence(): number;
/**
* get onset detection function
*/
getDescriptor(): number;
/**
* get thresholded onset detection function
*/
getThresholdedDescriptor(): number;
/**
* set onset detection peak picking threshold
*/
setThreshold(threshold: number):number;
/**
* get onset peak picking threshold
*/
getThreshold(): number;
/**
* set minimum inter onset interval in samples
*/
getMinioi(): number;
/**
* set minimum inter onset interval in seconds
*/
getMinioiS(): number;
/**
* set minimum inter onset interval in milliseconds
*/
getMinioiMs(): number;
/**
* set delay in samples
*/
setDelay(delay: number): number;
/**
* set delay in seconds
*/
setDelayS(delay: number): number;
/**
* set delay in milliseconds
*/
setDelayMs(delay: number): number;
/**
* get delay in samples
*/
getDelay(): number;
/**
* get delay in seconds
*/
getDelayS(): number;
/**
* get delay in milliseconds
*/
getDelayMs(): number;
/**
* set default parameters
*/
setDefaultParameters(): number;
/**
* reset onset detection
*/
reset(): void;
}
export declare type Aubio = {
Pitch: {
/**
* Pitch detection
*
* @param method - pitch detection algorithm
* @param bufferSize - size of the input buffer to analyse
* @param hopSize - step size between two consecutive analysis instant
* @param sampleRate - sampling rate of the signal
*/
new (
method: PitchMethod,
bufferSize: number,
hopSize: number,
sampleRate: number
): Pitch;
};
Tempo: {
/**
* Tempo detection
*
* @param method - pitch detection algorithm
* @param bufferSize - length of FFT
* @param hopSize - number of frames between two consecutive runs
* @param sampleRate - sampling rate of the signal to analyze
*/
new (bufferSize: number, hopSize: number, sampleRate: number): Tempo;
};
Onset: {
/**
* Onset detection
*
* @param method - pitch detection algorithm
* @param bufferSize - length of FFT
* @param hopSize - number of frames between two consecutive runs
* @param sampleRate - sampling rate of the signal to analyze
*/
new (bufferSize: number, hopSize: number, sampleRate: number): Onset;
};
};
/**
* aubio is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aubio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aubio. If not, see <http://www.gnu.org/licenses/>.
*/
declare function aubio(): Promise<Aubio>;
export default aubio;