@libraz/libsonare 1.4.1 → 1.5.1
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 +51 -20
- package/dist/index.d.ts +5416 -1
- package/dist/index.js +938 -583
- package/dist/index.js.map +1 -1
- package/dist/sonare.js +2 -2
- package/dist/sonare.wasm +0 -0
- package/dist/worklet.d.ts +1083 -5227
- package/dist/worklet.js +2683 -2451
- package/dist/worklet.js.map +1 -1
- package/package.json +4 -9
- package/src/clip_page_streamer.ts +298 -0
- package/src/effects_mastering.ts +85 -1089
- package/src/effects_transform.ts +286 -0
- package/src/effects_voice_change.ts +118 -0
- package/src/feature_music.ts +5 -2
- package/src/feature_spectrogram.ts +42 -2
- package/src/features.ts +1 -0
- package/src/index.ts +23 -0
- package/src/mastering_chain.ts +200 -0
- package/src/mastering_core.ts +248 -0
- package/src/mastering_dynamics.ts +105 -0
- package/src/mastering_repair.ts +161 -0
- package/src/mixer.ts +8 -0
- package/src/mixing_oneshot.ts +54 -0
- package/src/module_state.ts +1 -2
- package/src/project.ts +71 -1712
- package/src/project_class.ts +871 -0
- package/src/project_internal.ts +333 -0
- package/src/project_synth.ts +43 -0
- package/src/project_types.ts +570 -0
- package/src/public_types.ts +6 -1221
- package/src/public_types_acoustic.ts +115 -0
- package/src/public_types_mastering.ts +333 -0
- package/src/public_types_mixing.ts +97 -0
- package/src/public_types_music.ts +352 -0
- package/src/public_types_realtime.ts +163 -0
- package/src/public_types_spectral.ts +194 -0
- package/src/realtime_engine.ts +94 -0
- package/src/sonare.js.d.ts +117 -38
- package/src/stream_analyzer.ts +3 -0
- package/src/stream_types.ts +4 -0
- package/src/worklet/engine-automation.ts +73 -0
- package/src/worklet/engine-capture-facade.ts +80 -0
- package/src/worklet/engine-clips.ts +71 -0
- package/src/worklet/engine-markers.ts +93 -0
- package/src/worklet/engine-mixer-facade.ts +186 -0
- package/src/worklet/engine-node.ts +451 -0
- package/src/worklet/engine-offline.ts +162 -0
- package/src/worklet/engine-options.ts +13 -0
- package/src/worklet/engine-parameter-facade.ts +172 -0
- package/src/worklet/engine-processor.ts +764 -0
- package/src/worklet/engine-register.ts +136 -0
- package/src/worklet/engine-strips.ts +315 -0
- package/src/worklet/engine-sync.ts +94 -0
- package/src/worklet/engine-tempo-facade.ts +141 -0
- package/src/worklet/engine.ts +998 -0
- package/src/worklet/guards.ts +14 -1
- package/src/worklet/messages.ts +60 -20
- package/src/worklet/mixer-processor.ts +368 -0
- package/src/worklet/protocol.ts +3 -0
- package/src/worklet/voice-changer-processor.ts +246 -0
- package/src/worklet.ts +20 -3549
- package/dist/sonare-rt-module.js +0 -2
- package/dist/sonare-rt.js +0 -2
- package/dist/sonare-rt.wasm +0 -0
- package/src/sonare-rt.d.ts +0 -93
package/src/public_types.ts
CHANGED
|
@@ -1,1221 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
C: 0,
|
|
8
|
-
Cs: 1,
|
|
9
|
-
D: 2,
|
|
10
|
-
Ds: 3,
|
|
11
|
-
E: 4,
|
|
12
|
-
F: 5,
|
|
13
|
-
Fs: 6,
|
|
14
|
-
G: 7,
|
|
15
|
-
Gs: 8,
|
|
16
|
-
A: 9,
|
|
17
|
-
As: 10,
|
|
18
|
-
B: 11,
|
|
19
|
-
} as const;
|
|
20
|
-
|
|
21
|
-
export type PitchClass = (typeof PitchClass)[keyof typeof PitchClass];
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Musical mode
|
|
25
|
-
*/
|
|
26
|
-
export const Mode = {
|
|
27
|
-
Major: 0,
|
|
28
|
-
Minor: 1,
|
|
29
|
-
Dorian: 2,
|
|
30
|
-
Phrygian: 3,
|
|
31
|
-
Lydian: 4,
|
|
32
|
-
Mixolydian: 5,
|
|
33
|
-
Locrian: 6,
|
|
34
|
-
} as const;
|
|
35
|
-
|
|
36
|
-
export type Mode = (typeof Mode)[keyof typeof Mode];
|
|
37
|
-
|
|
38
|
-
export type TempogramMode = 'autocorrelation' | 'auto' | 'ac' | 'cosine' | 0 | 1;
|
|
39
|
-
|
|
40
|
-
export const KeyProfile = {
|
|
41
|
-
KrumhanslSchmuckler: 0,
|
|
42
|
-
Temperley: 1,
|
|
43
|
-
Shaath: 2,
|
|
44
|
-
FaraldoEDMT: 3,
|
|
45
|
-
FaraldoEDMA: 4,
|
|
46
|
-
FaraldoEDMM: 5,
|
|
47
|
-
BellmanBudge: 6,
|
|
48
|
-
} as const;
|
|
49
|
-
|
|
50
|
-
export type KeyProfile = (typeof KeyProfile)[keyof typeof KeyProfile];
|
|
51
|
-
|
|
52
|
-
export type KeyProfileName =
|
|
53
|
-
| 'ks'
|
|
54
|
-
| 'krumhansl'
|
|
55
|
-
| 'temperley'
|
|
56
|
-
| 'shaath'
|
|
57
|
-
| 'keyfinder'
|
|
58
|
-
| 'faraldo-edmt'
|
|
59
|
-
| 'edmt'
|
|
60
|
-
| 'faraldo-edma'
|
|
61
|
-
| 'edma'
|
|
62
|
-
| 'faraldo-edmm'
|
|
63
|
-
| 'edmm'
|
|
64
|
-
| 'bellman-budge'
|
|
65
|
-
| 'bellman';
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Chord quality
|
|
69
|
-
*/
|
|
70
|
-
export const ChordQuality = {
|
|
71
|
-
Major: 0,
|
|
72
|
-
Minor: 1,
|
|
73
|
-
Diminished: 2,
|
|
74
|
-
Augmented: 3,
|
|
75
|
-
Dominant7: 4,
|
|
76
|
-
Major7: 5,
|
|
77
|
-
Minor7: 6,
|
|
78
|
-
Sus2: 7,
|
|
79
|
-
Sus4: 8,
|
|
80
|
-
Unknown: 9,
|
|
81
|
-
Add9: 10,
|
|
82
|
-
MinorAdd9: 11,
|
|
83
|
-
Dim7: 12,
|
|
84
|
-
HalfDim7: 13,
|
|
85
|
-
Major9: 14,
|
|
86
|
-
Dominant9: 15,
|
|
87
|
-
Sus2Add4: 16,
|
|
88
|
-
} as const;
|
|
89
|
-
|
|
90
|
-
export type ChordQuality = (typeof ChordQuality)[keyof typeof ChordQuality];
|
|
91
|
-
|
|
92
|
-
export type MasteringPreset =
|
|
93
|
-
| 'pop'
|
|
94
|
-
| 'edm'
|
|
95
|
-
| 'acoustic'
|
|
96
|
-
| 'hipHop'
|
|
97
|
-
| 'aiMusic'
|
|
98
|
-
| 'speech'
|
|
99
|
-
| 'streaming'
|
|
100
|
-
| 'youtube'
|
|
101
|
-
| 'broadcast'
|
|
102
|
-
| 'podcast'
|
|
103
|
-
| 'audiobook'
|
|
104
|
-
| 'cinema'
|
|
105
|
-
| 'jpop'
|
|
106
|
-
| 'ambient'
|
|
107
|
-
| 'lofi'
|
|
108
|
-
| 'classical'
|
|
109
|
-
| 'drumAndBass'
|
|
110
|
-
| 'techno'
|
|
111
|
-
| 'metal'
|
|
112
|
-
| 'trap'
|
|
113
|
-
| 'rnb'
|
|
114
|
-
| 'jazz'
|
|
115
|
-
| 'kpop'
|
|
116
|
-
| 'trance'
|
|
117
|
-
| 'gameOst';
|
|
118
|
-
|
|
119
|
-
export interface StreamingPlatform {
|
|
120
|
-
name: string;
|
|
121
|
-
targetLufs: number;
|
|
122
|
-
ceilingDb: number;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export type SoloProcessor =
|
|
126
|
-
| 'dynamics.brickwallLimiter'
|
|
127
|
-
| 'dynamics.compressor'
|
|
128
|
-
| 'dynamics.deesser'
|
|
129
|
-
| 'dynamics.expander'
|
|
130
|
-
| 'dynamics.gate'
|
|
131
|
-
| 'dynamics.limiter'
|
|
132
|
-
| 'dynamics.parallelComp'
|
|
133
|
-
| 'dynamics.sidechainRouter'
|
|
134
|
-
| 'dynamics.duckingProcessor'
|
|
135
|
-
| 'dynamics.transientShaper'
|
|
136
|
-
| 'dynamics.upwardCompressor'
|
|
137
|
-
| 'dynamics.upwardExpander'
|
|
138
|
-
| 'dynamics.vocalRider'
|
|
139
|
-
| 'eq.apiStyle'
|
|
140
|
-
| 'eq.bandPass'
|
|
141
|
-
| 'eq.cutFilter'
|
|
142
|
-
| 'eq.dynamic'
|
|
143
|
-
| 'eq.equalizer'
|
|
144
|
-
| 'eq.graphic'
|
|
145
|
-
| 'eq.linearPhase'
|
|
146
|
-
| 'eq.midSide'
|
|
147
|
-
| 'eq.minimumPhase'
|
|
148
|
-
| 'eq.parametric'
|
|
149
|
-
| 'eq.pultec'
|
|
150
|
-
| 'eq.shelving'
|
|
151
|
-
| 'eq.tilt'
|
|
152
|
-
| 'final.bitDepth'
|
|
153
|
-
| 'final.dither'
|
|
154
|
-
| 'final.outputChain'
|
|
155
|
-
| 'maximizer.adaptiveRelease'
|
|
156
|
-
| 'maximizer.loudnessOptimize'
|
|
157
|
-
| 'maximizer.maximizer'
|
|
158
|
-
| 'maximizer.softKneeMax'
|
|
159
|
-
| 'maximizer.truePeakLimiter'
|
|
160
|
-
| 'multiband.compressor'
|
|
161
|
-
| 'multiband.dynamicEq'
|
|
162
|
-
| 'multiband.expander'
|
|
163
|
-
| 'multiband.imager'
|
|
164
|
-
| 'multiband.limiter'
|
|
165
|
-
| 'multiband.saturation'
|
|
166
|
-
| 'repair.declick'
|
|
167
|
-
| 'repair.declip'
|
|
168
|
-
| 'repair.decrackle'
|
|
169
|
-
| 'repair.dehum'
|
|
170
|
-
| 'repair.denoiseClassical'
|
|
171
|
-
| 'repair.dereverbClassical'
|
|
172
|
-
| 'repair.trimSilence'
|
|
173
|
-
| 'saturation.bitcrusher'
|
|
174
|
-
| 'saturation.exciter'
|
|
175
|
-
| 'saturation.hardClipper'
|
|
176
|
-
| 'saturation.multibandExciter'
|
|
177
|
-
| 'saturation.ampSim'
|
|
178
|
-
| 'saturation.softClipper'
|
|
179
|
-
| 'saturation.tape'
|
|
180
|
-
| 'saturation.transformer'
|
|
181
|
-
| 'saturation.tube'
|
|
182
|
-
| 'saturation.waveshaper'
|
|
183
|
-
| 'spectral.airBand'
|
|
184
|
-
| 'spectral.lowEndFocus'
|
|
185
|
-
| 'spectral.presenceEnhancer'
|
|
186
|
-
| 'spectral.spectralShaper'
|
|
187
|
-
| 'stereo.autoPan'
|
|
188
|
-
| 'stereo.haasEnhancer'
|
|
189
|
-
| 'stereo.imager'
|
|
190
|
-
| 'stereo.monoMaker'
|
|
191
|
-
| 'stereo.phaseAlign'
|
|
192
|
-
| 'stereo.stereoBalance';
|
|
193
|
-
|
|
194
|
-
export type PairProcessor =
|
|
195
|
-
| 'match.applyMatchEq'
|
|
196
|
-
| 'match.alignReferenceToSource'
|
|
197
|
-
| 'match.abSwitch'
|
|
198
|
-
| 'match.abCrossfade';
|
|
199
|
-
|
|
200
|
-
export type PairAnalysis =
|
|
201
|
-
| 'match.referenceLoudness'
|
|
202
|
-
| 'match.tonalBalance'
|
|
203
|
-
| 'match.tonalBalanceLogBands'
|
|
204
|
-
| 'match.matchEqCurve'
|
|
205
|
-
| 'match.estimateReferenceDelaySamples';
|
|
206
|
-
|
|
207
|
-
export type StereoAnalysis = 'stereo.monoCompatCheck' | 'stereo.monoCompatCheckLogBands';
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Section type
|
|
211
|
-
*/
|
|
212
|
-
export const SectionType = {
|
|
213
|
-
Intro: 0,
|
|
214
|
-
Verse: 1,
|
|
215
|
-
PreChorus: 2,
|
|
216
|
-
Chorus: 3,
|
|
217
|
-
Bridge: 4,
|
|
218
|
-
Instrumental: 5,
|
|
219
|
-
Outro: 6,
|
|
220
|
-
Unknown: 7,
|
|
221
|
-
} as const;
|
|
222
|
-
|
|
223
|
-
export type SectionType = (typeof SectionType)[keyof typeof SectionType];
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Detected musical key
|
|
227
|
-
*/
|
|
228
|
-
export interface Key {
|
|
229
|
-
root: PitchClass;
|
|
230
|
-
mode: Mode;
|
|
231
|
-
confidence: number;
|
|
232
|
-
name: string;
|
|
233
|
-
shortName: string;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export interface KeyDetectionOptions extends ValidateOptions {
|
|
237
|
-
nFft?: number;
|
|
238
|
-
hopLength?: number;
|
|
239
|
-
useHpss?: boolean;
|
|
240
|
-
loudnessWeighted?: boolean;
|
|
241
|
-
highPassHz?: number;
|
|
242
|
-
modes?:
|
|
243
|
-
| Mode[]
|
|
244
|
-
| ('major' | 'minor' | 'dorian' | 'phrygian' | 'lydian' | 'mixolydian' | 'locrian')[]
|
|
245
|
-
| 'major-minor'
|
|
246
|
-
| 'all'
|
|
247
|
-
| 'modal';
|
|
248
|
-
profile?: KeyProfile | KeyProfileName;
|
|
249
|
-
genreHint?: 'auto' | 'edm' | 'electronic' | 'dance' | 'pop' | 'classical' | 'jazz' | string;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export interface KeyCandidate {
|
|
253
|
-
key: Key;
|
|
254
|
-
correlation: number;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export interface ChordDetectionOptions extends ValidateOptions {
|
|
258
|
-
minDuration?: number;
|
|
259
|
-
smoothingWindow?: number;
|
|
260
|
-
threshold?: number;
|
|
261
|
-
useTriadsOnly?: boolean;
|
|
262
|
-
nFft?: number;
|
|
263
|
-
hopLength?: number;
|
|
264
|
-
useBeatSync?: boolean;
|
|
265
|
-
useHmm?: boolean;
|
|
266
|
-
hmmBeamWidth?: number;
|
|
267
|
-
useKeyContext?: boolean;
|
|
268
|
-
keyRoot?: PitchClass;
|
|
269
|
-
keyMode?: Mode;
|
|
270
|
-
detectInversions?: boolean;
|
|
271
|
-
chromaMethod?: 'stft' | 'nnls';
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/** Options for `detectAcoustic`. All fields are optional. */
|
|
275
|
-
export interface AcousticOptions extends ValidateOptions {
|
|
276
|
-
/** Number of octave bands. Default 6. */
|
|
277
|
-
nOctaveBands?: number;
|
|
278
|
-
/** Number of 1/3-octave sub-bands. Default 24. */
|
|
279
|
-
nThirdOctaveSubbands?: number;
|
|
280
|
-
/** Minimum decay range (dB) for a valid RT60 fit. Default 30. */
|
|
281
|
-
minDecayDb?: number;
|
|
282
|
-
/** Margin (dB) above the noise floor for the decay fit. Default 10. */
|
|
283
|
-
noiseFloorMarginDb?: number;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/** Options for `analyzeBpm`. All fields are optional. */
|
|
287
|
-
export interface AnalyzeBpmOptions extends ValidateOptions {
|
|
288
|
-
/** Lowest BPM to consider. Default 30. */
|
|
289
|
-
bpmMin?: number;
|
|
290
|
-
/** Highest BPM to consider. Default 300. */
|
|
291
|
-
bpmMax?: number;
|
|
292
|
-
/** Tempo prior the tracker is biased toward. Default 120. */
|
|
293
|
-
startBpm?: number;
|
|
294
|
-
/** FFT size for the onset envelope. Default 2048. */
|
|
295
|
-
nFft?: number;
|
|
296
|
-
/** Hop length for the onset envelope. Default 512. */
|
|
297
|
-
hopLength?: number;
|
|
298
|
-
/** Number of tempo candidates to return. Default 5. */
|
|
299
|
-
maxCandidates?: number;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/** Options for `analyzeRhythm`. All fields are optional. */
|
|
303
|
-
export interface AnalyzeRhythmOptions extends ValidateOptions {
|
|
304
|
-
/** Lowest BPM to consider. Default 60. */
|
|
305
|
-
bpmMin?: number;
|
|
306
|
-
/** Highest BPM to consider. Default 200. */
|
|
307
|
-
bpmMax?: number;
|
|
308
|
-
/** Tempo prior the tracker is biased toward. Default 120. */
|
|
309
|
-
startBpm?: number;
|
|
310
|
-
/** FFT size for the onset envelope. Default 2048. */
|
|
311
|
-
nFft?: number;
|
|
312
|
-
/** Hop length for the onset envelope. Default 512. */
|
|
313
|
-
hopLength?: number;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/** Options for `analyzeDynamics`. All fields are optional. */
|
|
317
|
-
export interface AnalyzeDynamicsOptions extends ValidateOptions {
|
|
318
|
-
/** Loudness-curve window length in seconds. Default 0.4. */
|
|
319
|
-
windowSec?: number;
|
|
320
|
-
/** Hop length for the loudness curve. Default 512. */
|
|
321
|
-
hopLength?: number;
|
|
322
|
-
/** Crest-factor (dB) below which the signal is flagged as compressed. Default 6. */
|
|
323
|
-
compressionThreshold?: number;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/** Options for `analyzeTimbre`. All fields are optional. */
|
|
327
|
-
export interface AnalyzeTimbreOptions extends ValidateOptions {
|
|
328
|
-
/** FFT size. Default 2048. */
|
|
329
|
-
nFft?: number;
|
|
330
|
-
/** Hop length. Default 512. */
|
|
331
|
-
hopLength?: number;
|
|
332
|
-
/** Number of Mel bands. Default 128. */
|
|
333
|
-
nMels?: number;
|
|
334
|
-
/** Number of MFCCs. Default 13. */
|
|
335
|
-
nMfcc?: number;
|
|
336
|
-
/** Per-window analysis length in seconds. Default 0.5. */
|
|
337
|
-
windowSec?: number;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/** Options for `analyzeSections`. All fields are optional. */
|
|
341
|
-
export interface AnalyzeSectionsOptions {
|
|
342
|
-
/** FFT size. Default 2048. */
|
|
343
|
-
nFft?: number;
|
|
344
|
-
/** Hop length. Default 512. */
|
|
345
|
-
hopLength?: number;
|
|
346
|
-
/** Minimum section duration in seconds. Default 4. */
|
|
347
|
-
minSectionSec?: number;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/** Options for `mastering`. All fields are optional. */
|
|
351
|
-
export interface MasteringOptions {
|
|
352
|
-
/** Target integrated LUFS. Default -14. */
|
|
353
|
-
targetLufs?: number;
|
|
354
|
-
/** True/sample peak ceiling in dBFS. Default -1. */
|
|
355
|
-
ceilingDb?: number;
|
|
356
|
-
/** Oversampling factor used for peak estimation. Default 4. */
|
|
357
|
-
truePeakOversample?: number;
|
|
358
|
-
/** Post true-peak limiter release in ms. Default 0 => library default (50 ms). */
|
|
359
|
-
releaseMs?: number;
|
|
360
|
-
/** Apply the static loudness gain at the input (pre-oversample) rate. Default false. */
|
|
361
|
-
applyGainAtInputRate?: boolean;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/** Options for `noteStretch`. All fields are optional. */
|
|
365
|
-
export interface NoteStretchOptions {
|
|
366
|
-
/** Note onset position in samples (selects the region). Default 0. */
|
|
367
|
-
onsetSample?: number;
|
|
368
|
-
/** Note offset position in samples (selects the region). Default 0. */
|
|
369
|
-
offsetSample?: number;
|
|
370
|
-
/** Stretch ratio (0.5 = double duration, 2.0 = half duration). Default 1. */
|
|
371
|
-
stretchRatio?: number;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/** How a `spectralEdit` region op modifies the masked bins. */
|
|
375
|
-
export type SpectralEditMode = 'gain' | 'attenuate' | 'mute' | 'heal';
|
|
376
|
-
|
|
377
|
-
/** Analysis/synthesis window used by `spectralEdit`. */
|
|
378
|
-
export type SpectralEditWindow = 'hann' | 'hamming' | 'blackman' | 'rectangular';
|
|
379
|
-
|
|
380
|
-
/** One time x frequency rectangle edit op for `spectralEdit`. */
|
|
381
|
-
export interface SpectralRegionOp {
|
|
382
|
-
/** Region time start (input samples); clamped to [0, length]. Default 0. */
|
|
383
|
-
startSample?: number;
|
|
384
|
-
/** Region time end, exclusive (input samples); clamped to [0, length]. Default = signal length. */
|
|
385
|
-
endSample?: number;
|
|
386
|
-
/** Region frequency low edge in Hz; clamped to [0, nyquist]. Default 0. */
|
|
387
|
-
lowHz?: number;
|
|
388
|
-
/** Region frequency high edge in Hz; <=0 or >= nyquist means nyquist. Default 0. */
|
|
389
|
-
highHz?: number;
|
|
390
|
-
/** Linear gain in dB for 'gain'/'attenuate'; ignored by 'mute'/'heal'. Default 0. */
|
|
391
|
-
gainDb?: number;
|
|
392
|
-
/** Edit mode. Default 'gain'. */
|
|
393
|
-
mode?: SpectralEditMode;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/** STFT + heal parameters for `spectralEdit`. All fields are optional. */
|
|
397
|
-
export interface SpectralEditOptions {
|
|
398
|
-
/** FFT size; must be a power of two (>= 2). Default 2048. */
|
|
399
|
-
nFft?: number;
|
|
400
|
-
/** Hop length; must satisfy 0 < hop <= nFft/2. Default 512. */
|
|
401
|
-
hopLength?: number;
|
|
402
|
-
/** Analysis + synthesis window. Default 'hann'. */
|
|
403
|
-
window?: SpectralEditWindow;
|
|
404
|
-
/** Neighbour frames each side used by 'heal' (>= 1). Default 2. */
|
|
405
|
-
healRadiusFrames?: number;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Detected beat
|
|
410
|
-
*/
|
|
411
|
-
export interface Beat {
|
|
412
|
-
time: number;
|
|
413
|
-
strength: number;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* Detected chord
|
|
418
|
-
*/
|
|
419
|
-
export interface Chord {
|
|
420
|
-
root: PitchClass;
|
|
421
|
-
bass: PitchClass;
|
|
422
|
-
quality: ChordQuality;
|
|
423
|
-
start: number;
|
|
424
|
-
end: number;
|
|
425
|
-
confidence: number;
|
|
426
|
-
name: string;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
export interface ChordAnalysisResult {
|
|
430
|
-
chords: Chord[];
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Detected section
|
|
435
|
-
*/
|
|
436
|
-
export interface Section {
|
|
437
|
-
type: SectionType;
|
|
438
|
-
start: number;
|
|
439
|
-
end: number;
|
|
440
|
-
energyLevel: number;
|
|
441
|
-
confidence: number;
|
|
442
|
-
name: string;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* A single melody contour point (mirrors the C `SonareMelodyPoint`).
|
|
447
|
-
*/
|
|
448
|
-
export interface MelodyPoint {
|
|
449
|
-
/** Frame time in seconds. */
|
|
450
|
-
time: number;
|
|
451
|
-
/** Estimated fundamental frequency in Hz (0 when unvoiced). */
|
|
452
|
-
frequency: number;
|
|
453
|
-
/** Voicing confidence in `[0, 1]`. */
|
|
454
|
-
confidence: number;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* Melody analysis result (mirrors the C `SonareMelodyResult`).
|
|
459
|
-
*/
|
|
460
|
-
export interface MelodyResult {
|
|
461
|
-
points: MelodyPoint[];
|
|
462
|
-
pitchRangeOctaves: number;
|
|
463
|
-
pitchStability: number;
|
|
464
|
-
meanFrequency: number;
|
|
465
|
-
vibratoRate: number;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* Constant-Q / Variable-Q transform magnitude result (mirrors the C
|
|
470
|
-
* `SonareCqtResult`).
|
|
471
|
-
*/
|
|
472
|
-
export interface CqtResult {
|
|
473
|
-
/** Number of frequency bins. */
|
|
474
|
-
nBins: number;
|
|
475
|
-
/** Number of time frames. */
|
|
476
|
-
nFrames: number;
|
|
477
|
-
/** Hop length in samples. */
|
|
478
|
-
hopLength: number;
|
|
479
|
-
/** Sample rate in Hz. */
|
|
480
|
-
sampleRate: number;
|
|
481
|
-
/** Row-major `[nBins x nFrames]` magnitude matrix. */
|
|
482
|
-
magnitude: Float32Array;
|
|
483
|
-
/** Center frequency (Hz) of each of the `nBins` bins. */
|
|
484
|
-
frequencies: Float32Array;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Multi-band onset strength matrix result.
|
|
489
|
-
*/
|
|
490
|
-
export interface OnsetStrengthMultiResult {
|
|
491
|
-
nBands: number;
|
|
492
|
-
nFrames: number;
|
|
493
|
-
data: Float32Array;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Timbre characteristics
|
|
498
|
-
*/
|
|
499
|
-
export interface Timbre {
|
|
500
|
-
brightness: number;
|
|
501
|
-
warmth: number;
|
|
502
|
-
density: number;
|
|
503
|
-
roughness: number;
|
|
504
|
-
complexity: number;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Dynamics characteristics
|
|
509
|
-
*/
|
|
510
|
-
export interface Dynamics {
|
|
511
|
-
dynamicRangeDb: number;
|
|
512
|
-
peakDb: number;
|
|
513
|
-
rmsDb: number;
|
|
514
|
-
loudnessRangeDb: number;
|
|
515
|
-
crestFactor: number;
|
|
516
|
-
isCompressed: boolean;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Time signature
|
|
521
|
-
*/
|
|
522
|
-
export interface TimeSignature {
|
|
523
|
-
numerator: number;
|
|
524
|
-
denominator: number;
|
|
525
|
-
confidence: number;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* Rhythm features
|
|
530
|
-
*/
|
|
531
|
-
export interface RhythmFeatures {
|
|
532
|
-
syncopation: number;
|
|
533
|
-
grooveType: string;
|
|
534
|
-
patternRegularity: number;
|
|
535
|
-
tempoStability: number;
|
|
536
|
-
timeSignature: TimeSignature;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Melody contour from the unified analysis (pitch trajectory + summary stats).
|
|
541
|
-
*/
|
|
542
|
-
export interface MelodyContour {
|
|
543
|
-
pitchRangeOctaves: number;
|
|
544
|
-
pitchStability: number;
|
|
545
|
-
meanFrequency: number;
|
|
546
|
-
vibratoRate: number;
|
|
547
|
-
pitches: MelodyPoint[];
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Complete analysis result
|
|
552
|
-
*/
|
|
553
|
-
export interface AnalysisResult {
|
|
554
|
-
bpm: number;
|
|
555
|
-
bpmConfidence: number;
|
|
556
|
-
key: Key;
|
|
557
|
-
timeSignature: TimeSignature;
|
|
558
|
-
beatTimes: Float32Array;
|
|
559
|
-
beats: Beat[];
|
|
560
|
-
chords: Chord[];
|
|
561
|
-
sections: Section[];
|
|
562
|
-
timbre: Timbre;
|
|
563
|
-
dynamics: Dynamics;
|
|
564
|
-
rhythm: RhythmFeatures;
|
|
565
|
-
melody: MelodyContour;
|
|
566
|
-
form: string;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Room acoustic parameters from an impulse response
|
|
571
|
-
*/
|
|
572
|
-
export interface AcousticResult {
|
|
573
|
-
rt60: number;
|
|
574
|
-
edt: number;
|
|
575
|
-
c50: number;
|
|
576
|
-
c80: number;
|
|
577
|
-
d50: number;
|
|
578
|
-
rt60Bands: Float32Array;
|
|
579
|
-
edtBands: Float32Array;
|
|
580
|
-
c50Bands: Float32Array;
|
|
581
|
-
c80Bands: Float32Array;
|
|
582
|
-
confidence: number;
|
|
583
|
-
isBlind: boolean;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
/** Shoebox geometry + placement shared by RIR synthesis and the room morph. */
|
|
587
|
-
export interface RoomGeometryOptions {
|
|
588
|
-
lengthM?: number;
|
|
589
|
-
widthM?: number;
|
|
590
|
-
heightM?: number;
|
|
591
|
-
/** Uniform wall absorption, clamped to [0, 0.999] (the back-compat scalar). */
|
|
592
|
-
absorption?: number;
|
|
593
|
-
/**
|
|
594
|
-
* Optional per-octave-band wall absorption (125/250/500/1k/2k/4k.. Hz). When
|
|
595
|
-
* provided it overrides `absorption` unless `materialPreset` is set.
|
|
596
|
-
*/
|
|
597
|
-
bandAbsorption?: Float32Array | number[];
|
|
598
|
-
/** Optional per-band wall scattering; missing bands default to 0. */
|
|
599
|
-
bandScattering?: Float32Array | number[];
|
|
600
|
-
/**
|
|
601
|
-
* Named wall-material preset (0 none; 1 concrete, 2 wood, 3 curtain,
|
|
602
|
-
* 4 carpet, 5 glass). A non-zero preset wins over `bandAbsorption`/`absorption`.
|
|
603
|
-
*/
|
|
604
|
-
materialPreset?: number;
|
|
605
|
-
sourceX?: number;
|
|
606
|
-
sourceY?: number;
|
|
607
|
-
sourceZ?: number;
|
|
608
|
-
listenerX?: number;
|
|
609
|
-
listenerY?: number;
|
|
610
|
-
listenerZ?: number;
|
|
611
|
-
ismOrder?: number;
|
|
612
|
-
seed?: number;
|
|
613
|
-
maxSeconds?: number;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
export interface RirSynthOptions extends RoomGeometryOptions {
|
|
617
|
-
sampleRate?: number;
|
|
618
|
-
/** Use the Eyring statistical late-tail model (default true); false = Sabine. */
|
|
619
|
-
preferEyring?: boolean;
|
|
620
|
-
/** Early/late crossover in ms (0 = auto, ~sqrt(V) ms). */
|
|
621
|
-
mixingTimeMs?: number;
|
|
622
|
-
/** Equal-power crossfade width around the mixing time in ms (0 = default). */
|
|
623
|
-
crossfadeMs?: number;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
export interface RirResult {
|
|
627
|
-
rir: Float32Array;
|
|
628
|
-
sampleRate: number;
|
|
629
|
-
hasError: boolean;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
export interface RoomEstimateOptions {
|
|
633
|
-
aspectHintLw?: number;
|
|
634
|
-
aspectHintLh?: number;
|
|
635
|
-
referenceAbsorption?: number;
|
|
636
|
-
preferEyring?: boolean;
|
|
637
|
-
nOctaveBands?: number;
|
|
638
|
-
/** Analyzer routing: 0 = auto, 1 = blind, 2 = impulse-response. */
|
|
639
|
-
mode?: number;
|
|
640
|
-
/** Analyzer decay-fit span in dB (0 = library default). */
|
|
641
|
-
minDecayDb?: number;
|
|
642
|
-
/** Analyzer noise-floor margin in dB (0 = library default). */
|
|
643
|
-
noiseFloorMarginDb?: number;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
export interface RoomEstimateResult {
|
|
647
|
-
volume: number;
|
|
648
|
-
length: number;
|
|
649
|
-
width: number;
|
|
650
|
-
height: number;
|
|
651
|
-
drrDb: number;
|
|
652
|
-
confidence: number;
|
|
653
|
-
absorptionBands: Float32Array;
|
|
654
|
-
rt60Bands: Float32Array;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
export interface RoomMorphOptions extends RoomGeometryOptions {
|
|
658
|
-
wet?: number;
|
|
659
|
-
sourceTailSuppression?: number;
|
|
660
|
-
/**
|
|
661
|
-
* Use the Eyring statistical late-tail model for the target room (default
|
|
662
|
-
* true); false = Sabine. Matches {@link RirSynthOptions.preferEyring}.
|
|
663
|
-
*/
|
|
664
|
-
preferEyring?: boolean;
|
|
665
|
-
/** Early/late crossover in ms (0 = auto, ~sqrt(V) ms). */
|
|
666
|
-
mixingTimeMs?: number;
|
|
667
|
-
/** Equal-power crossfade width around the mixing time in ms (0 = default). */
|
|
668
|
-
crossfadeMs?: number;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
/**
|
|
672
|
-
* HPSS (Harmonic-Percussive Source Separation) result
|
|
673
|
-
*/
|
|
674
|
-
export interface HpssResult {
|
|
675
|
-
harmonic: Float32Array;
|
|
676
|
-
percussive: Float32Array;
|
|
677
|
-
sampleRate: number;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Mastering loudness/true-peak processing result
|
|
682
|
-
*/
|
|
683
|
-
export interface MasteringResult {
|
|
684
|
-
samples: Float32Array;
|
|
685
|
-
sampleRate: number;
|
|
686
|
-
inputLufs: number;
|
|
687
|
-
outputLufs: number;
|
|
688
|
-
appliedGainDb: number;
|
|
689
|
-
latencySamples?: number;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
export type MasteringProcessorParams = Record<string, number | boolean>;
|
|
693
|
-
|
|
694
|
-
export type PanMode = 'balance' | 'stereoPan' | 'stereo-pan' | 'dualPan' | 'dual-pan' | number;
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* Surround pan position for a strip feeding a >2-channel bus. Phase 1 honors
|
|
698
|
-
* `azimuth`/`divergence`/`lfe`; `elevation`/`distance` are reserved. All fields
|
|
699
|
-
* are optional and default to a centered point source.
|
|
700
|
-
*/
|
|
701
|
-
export interface SurroundPan {
|
|
702
|
-
/** -180..180 deg, 0 = front-center, positive = right. */
|
|
703
|
-
azimuth?: number;
|
|
704
|
-
/** Reserved (no height beds in phase 1). */
|
|
705
|
-
elevation?: number;
|
|
706
|
-
/** 0 = point source, 1 = spread across the front. */
|
|
707
|
-
divergence?: number;
|
|
708
|
-
/** 0..1 scalar send into the LFE plane. */
|
|
709
|
-
lfe?: number;
|
|
710
|
-
/** Reserved (focus/spread), defaults to 1. */
|
|
711
|
-
distance?: number;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
export interface MixOptions {
|
|
715
|
-
inputTrimDb?: number | number[];
|
|
716
|
-
faderDb?: number | number[];
|
|
717
|
-
pan?: number | number[];
|
|
718
|
-
panMode?: PanMode | PanMode[];
|
|
719
|
-
width?: number | number[];
|
|
720
|
-
muted?: boolean | boolean[];
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
export interface MixMeterSnapshot {
|
|
724
|
-
peakDbL: number;
|
|
725
|
-
peakDbR: number;
|
|
726
|
-
rmsDbL: number;
|
|
727
|
-
rmsDbR: number;
|
|
728
|
-
correlation: number;
|
|
729
|
-
monoCompatWidth: number;
|
|
730
|
-
monoCompatPeak: number;
|
|
731
|
-
monoCompatSideRms: number;
|
|
732
|
-
likelyMonoCompatible: boolean;
|
|
733
|
-
momentaryLufs: number;
|
|
734
|
-
shortTermLufs: number;
|
|
735
|
-
integratedLufs: number;
|
|
736
|
-
gainReductionDb: number;
|
|
737
|
-
truePeakDbL: number;
|
|
738
|
-
truePeakDbR: number;
|
|
739
|
-
maxTruePeakDb: number;
|
|
740
|
-
seq: number;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
export interface MixResult {
|
|
744
|
-
left: Float32Array;
|
|
745
|
-
right: Float32Array;
|
|
746
|
-
sampleRate: number;
|
|
747
|
-
meters: MixMeterSnapshot[];
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
/** Mixed stereo master returned by {@link Mixer.processStereo}. */
|
|
751
|
-
export interface MixerProcessResult {
|
|
752
|
-
left: Float32Array;
|
|
753
|
-
right: Float32Array;
|
|
754
|
-
sampleRate: number;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
/**
|
|
758
|
-
* Interpolation curve for scheduled automation events
|
|
759
|
-
* (see {@link Mixer.scheduleInsertAutomation}).
|
|
760
|
-
*/
|
|
761
|
-
export type AutomationCurve = 'linear' | 'exponential' | 'hold' | 's-curve';
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Pan law applied when computing left/right gains from a pan position
|
|
765
|
-
* (see {@link Mixer.setPanLaw}). Maps to the underlying integer code.
|
|
766
|
-
*/
|
|
767
|
-
export type PanLaw = 'const3dB' | 'const4.5dB' | 'const6dB' | 'linear0dB';
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* Meter tap point for reading a strip's meter snapshot
|
|
771
|
-
* (see {@link Mixer.meterTap} and {@link Mixer.stripMeter}).
|
|
772
|
-
*/
|
|
773
|
-
export type MeterTap = 'preFader' | 'postFader';
|
|
774
|
-
|
|
775
|
-
/** Pre/post-fader send timing (see {@link Mixer.addSend}). */
|
|
776
|
-
export type SendTiming = 'preFader' | 'postFader';
|
|
777
|
-
|
|
778
|
-
/** A single goniometer (left/right) sample returned by {@link Mixer.readGoniometerLatest}. */
|
|
779
|
-
export interface GoniometerPoint {
|
|
780
|
-
left: number;
|
|
781
|
-
right: number;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
export interface MasteringChainConfig {
|
|
785
|
-
repair?: {
|
|
786
|
-
denoise?: boolean;
|
|
787
|
-
nFft?: number;
|
|
788
|
-
hopLength?: number;
|
|
789
|
-
ddAlpha?: number;
|
|
790
|
-
gainFloor?: number;
|
|
791
|
-
declick?: {
|
|
792
|
-
threshold?: number;
|
|
793
|
-
neighborRatio?: number;
|
|
794
|
-
maxClickSamples?: number;
|
|
795
|
-
lpcOrder?: number;
|
|
796
|
-
residualRatio?: number;
|
|
797
|
-
};
|
|
798
|
-
dereverb?: {
|
|
799
|
-
threshold?: number;
|
|
800
|
-
attenuation?: number;
|
|
801
|
-
nFft?: number;
|
|
802
|
-
hopLength?: number;
|
|
803
|
-
t60Sec?: number;
|
|
804
|
-
lateDelayMs?: number;
|
|
805
|
-
overSubtraction?: number;
|
|
806
|
-
spectralFloor?: number;
|
|
807
|
-
wpeEnabled?: boolean;
|
|
808
|
-
wpeIterations?: number;
|
|
809
|
-
wpeTaps?: number;
|
|
810
|
-
wpeStrength?: number;
|
|
811
|
-
};
|
|
812
|
-
};
|
|
813
|
-
eq?: {
|
|
814
|
-
tiltDb?: number;
|
|
815
|
-
pivotHz?: number;
|
|
816
|
-
};
|
|
817
|
-
dynamics?: {
|
|
818
|
-
compressor?: {
|
|
819
|
-
thresholdDb?: number;
|
|
820
|
-
ratio?: number;
|
|
821
|
-
attackMs?: number;
|
|
822
|
-
releaseMs?: number;
|
|
823
|
-
kneeDb?: number;
|
|
824
|
-
makeupGainDb?: number;
|
|
825
|
-
autoMakeup?: boolean;
|
|
826
|
-
};
|
|
827
|
-
deesser?: {
|
|
828
|
-
frequencyHz?: number;
|
|
829
|
-
thresholdDb?: number;
|
|
830
|
-
ratio?: number;
|
|
831
|
-
attackMs?: number;
|
|
832
|
-
releaseMs?: number;
|
|
833
|
-
rangeDb?: number;
|
|
834
|
-
bandpassQ?: number;
|
|
835
|
-
};
|
|
836
|
-
transientShaper?: {
|
|
837
|
-
attackGainDb?: number;
|
|
838
|
-
sustainGainDb?: number;
|
|
839
|
-
fastAttackMs?: number;
|
|
840
|
-
fastReleaseMs?: number;
|
|
841
|
-
slowAttackMs?: number;
|
|
842
|
-
slowReleaseMs?: number;
|
|
843
|
-
sensitivity?: number;
|
|
844
|
-
maxGainDb?: number;
|
|
845
|
-
gainSmoothingMs?: number;
|
|
846
|
-
lookaheadMs?: number;
|
|
847
|
-
};
|
|
848
|
-
multibandComp?: {
|
|
849
|
-
lowCutoffHz?: number;
|
|
850
|
-
highCutoffHz?: number;
|
|
851
|
-
lowThresholdDb?: number;
|
|
852
|
-
lowRatio?: number;
|
|
853
|
-
lowAttackMs?: number;
|
|
854
|
-
lowReleaseMs?: number;
|
|
855
|
-
midThresholdDb?: number;
|
|
856
|
-
midRatio?: number;
|
|
857
|
-
midAttackMs?: number;
|
|
858
|
-
midReleaseMs?: number;
|
|
859
|
-
highThresholdDb?: number;
|
|
860
|
-
highRatio?: number;
|
|
861
|
-
highAttackMs?: number;
|
|
862
|
-
highReleaseMs?: number;
|
|
863
|
-
};
|
|
864
|
-
};
|
|
865
|
-
saturation?: {
|
|
866
|
-
tape?: {
|
|
867
|
-
driveDb?: number;
|
|
868
|
-
saturation?: number;
|
|
869
|
-
hysteresis?: number;
|
|
870
|
-
outputGainDb?: number;
|
|
871
|
-
speedIps?: number;
|
|
872
|
-
headBumpDb?: number;
|
|
873
|
-
bias?: number;
|
|
874
|
-
gapLoss?: number;
|
|
875
|
-
};
|
|
876
|
-
exciter?: {
|
|
877
|
-
frequencyHz?: number;
|
|
878
|
-
driveDb?: number;
|
|
879
|
-
amount?: number;
|
|
880
|
-
q?: number;
|
|
881
|
-
evenOddMix?: number;
|
|
882
|
-
};
|
|
883
|
-
};
|
|
884
|
-
spectral?: {
|
|
885
|
-
airBand?: {
|
|
886
|
-
amount?: number;
|
|
887
|
-
shelfFrequencyHz?: number;
|
|
888
|
-
dynamicThresholdDb?: number;
|
|
889
|
-
dynamicRangeDb?: number;
|
|
890
|
-
};
|
|
891
|
-
};
|
|
892
|
-
stereo?: {
|
|
893
|
-
imager?: {
|
|
894
|
-
width?: number;
|
|
895
|
-
outputGainDb?: number;
|
|
896
|
-
decorrelationAmount?: number;
|
|
897
|
-
preserveEnergy?: boolean;
|
|
898
|
-
};
|
|
899
|
-
monoMaker?: {
|
|
900
|
-
amount?: number;
|
|
901
|
-
};
|
|
902
|
-
};
|
|
903
|
-
maximizer?: {
|
|
904
|
-
truePeakLimiter?: {
|
|
905
|
-
ceilingDb?: number;
|
|
906
|
-
lookaheadMs?: number;
|
|
907
|
-
releaseMs?: number;
|
|
908
|
-
oversampleFactor?: number;
|
|
909
|
-
applyGainAtInputRate?: boolean;
|
|
910
|
-
};
|
|
911
|
-
};
|
|
912
|
-
loudness?: {
|
|
913
|
-
targetLufs?: number;
|
|
914
|
-
ceilingDb?: number;
|
|
915
|
-
truePeakOversample?: number;
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Configuration for the block-by-block {@link StreamingMasteringChain}.
|
|
921
|
-
*
|
|
922
|
-
* Extends {@link MasteringChainConfig} with optional precomputed loudness
|
|
923
|
-
* parameters. The streaming chain cannot measure whole-signal integrated LUFS,
|
|
924
|
-
* so an enabled `loudness` stage normally throws at construction. To let a
|
|
925
|
-
* preset's streaming preview match its offline render, the caller may
|
|
926
|
-
* precompute the loudness normalization gain offline (e.g.
|
|
927
|
-
* `targetLufs - measuredIntegratedLufs`) and supply it here.
|
|
928
|
-
*/
|
|
929
|
-
export interface StreamingMasteringChainConfig extends MasteringChainConfig {
|
|
930
|
-
/**
|
|
931
|
-
* Precomputed static loudness gain in dB. When omitted (the default), an
|
|
932
|
-
* enabled `loudness` stage still throws. When provided and `loudness.enabled`
|
|
933
|
-
* is set, the chain applies this fixed gain per block before the loudness
|
|
934
|
-
* stage's true-peak limiter instead of throwing.
|
|
935
|
-
*/
|
|
936
|
-
loudnessStaticGainDb?: number;
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
* Offline-measured true-peak (dBFS) of the source the static gain was
|
|
940
|
-
* computed for. When provided, the static gain is clamped to
|
|
941
|
-
* `loudness.ceilingDb - loudnessStaticGainPeakDb` so the streaming preview
|
|
942
|
-
* does not drive the loudness limiter harder than the offline chain. When
|
|
943
|
-
* omitted (the default) the static gain is applied verbatim.
|
|
944
|
-
*/
|
|
945
|
-
loudnessStaticGainPeakDb?: number;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
export interface MasteringChainResult extends MasteringResult {
|
|
949
|
-
stages: string[];
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
export interface MasteringStereoChainResult {
|
|
953
|
-
left: Float32Array;
|
|
954
|
-
right: Float32Array;
|
|
955
|
-
sampleRate: number;
|
|
956
|
-
inputLufs: number;
|
|
957
|
-
outputLufs: number;
|
|
958
|
-
appliedGainDb: number;
|
|
959
|
-
stages: string[];
|
|
960
|
-
latencySamples?: number;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
export interface MasteringStereoResult {
|
|
964
|
-
left: Float32Array;
|
|
965
|
-
right: Float32Array;
|
|
966
|
-
sampleRate: number;
|
|
967
|
-
inputLufs: number;
|
|
968
|
-
outputLufs: number;
|
|
969
|
-
appliedGainDb: number;
|
|
970
|
-
latencySamples: number;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
/**
|
|
974
|
-
* STFT (Short-Time Fourier Transform) result
|
|
975
|
-
*/
|
|
976
|
-
export interface StftResult {
|
|
977
|
-
nBins: number;
|
|
978
|
-
nFrames: number;
|
|
979
|
-
nFft: number;
|
|
980
|
-
hopLength: number;
|
|
981
|
-
sampleRate: number;
|
|
982
|
-
magnitude: Float32Array;
|
|
983
|
-
power: Float32Array;
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
/**
|
|
987
|
-
* Mel spectrogram result
|
|
988
|
-
*/
|
|
989
|
-
export interface MelSpectrogramResult {
|
|
990
|
-
nMels: number;
|
|
991
|
-
nFrames: number;
|
|
992
|
-
sampleRate: number;
|
|
993
|
-
hopLength: number;
|
|
994
|
-
power: Float32Array;
|
|
995
|
-
db: Float32Array;
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
/**
|
|
999
|
-
* MFCC result
|
|
1000
|
-
*/
|
|
1001
|
-
export interface MfccResult {
|
|
1002
|
-
nMfcc: number;
|
|
1003
|
-
nFrames: number;
|
|
1004
|
-
coefficients: Float32Array;
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
/**
|
|
1008
|
-
* STFT power spectrogram result (from inverse Mel reconstruction)
|
|
1009
|
-
*/
|
|
1010
|
-
export interface StftPowerResult {
|
|
1011
|
-
nBins: number;
|
|
1012
|
-
nFrames: number;
|
|
1013
|
-
power: Float32Array;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Mel power spectrogram result (from inverse MFCC reconstruction)
|
|
1018
|
-
*/
|
|
1019
|
-
export interface MelPowerResult {
|
|
1020
|
-
nMels: number;
|
|
1021
|
-
nFrames: number;
|
|
1022
|
-
power: Float32Array;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
/**
|
|
1026
|
-
* Chroma features result
|
|
1027
|
-
*/
|
|
1028
|
-
export interface ChromaResult {
|
|
1029
|
-
nChroma: number;
|
|
1030
|
-
nFrames: number;
|
|
1031
|
-
sampleRate: number;
|
|
1032
|
-
hopLength: number;
|
|
1033
|
-
features: Float32Array;
|
|
1034
|
-
meanEnergy: number[];
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
/**
|
|
1038
|
-
* Pitch detection result
|
|
1039
|
-
*/
|
|
1040
|
-
export interface PitchResult {
|
|
1041
|
-
f0: Float32Array;
|
|
1042
|
-
voicedProb: Float32Array;
|
|
1043
|
-
voicedFlag: boolean[];
|
|
1044
|
-
nFrames: number;
|
|
1045
|
-
medianF0: number;
|
|
1046
|
-
meanF0: number;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
/**
|
|
1050
|
-
* Loudness measurement result (EBU R128 / ITU-R BS.1770)
|
|
1051
|
-
*/
|
|
1052
|
-
export interface LufsResult {
|
|
1053
|
-
integratedLufs: number;
|
|
1054
|
-
momentaryLufs: number;
|
|
1055
|
-
shortTermLufs: number;
|
|
1056
|
-
loudnessRange: number;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* Realtime equalizer spectrum snapshot.
|
|
1061
|
-
*
|
|
1062
|
-
* Mirrors the C++ `EqualizerSpectrumSnapshot`: `preLeft`/`preRight` and
|
|
1063
|
-
* `postLeft`/`postRight` are the pre- and post-EQ spectrum streams (trimmed to
|
|
1064
|
-
* their valid count). `bandGainDb` holds per-band applied gain (24 entries),
|
|
1065
|
-
* `profileDb` the smoothed magnitude profile (16 entries), `lastAutoGainDb`
|
|
1066
|
-
* the latest auto-gain compensation, and `seq` increments each time a new
|
|
1067
|
-
* snapshot is published.
|
|
1068
|
-
*/
|
|
1069
|
-
export interface EqSpectrumSnapshot {
|
|
1070
|
-
preLeft: Float32Array;
|
|
1071
|
-
preRight: Float32Array;
|
|
1072
|
-
postLeft: Float32Array;
|
|
1073
|
-
postRight: Float32Array;
|
|
1074
|
-
bandGainDb: Float32Array;
|
|
1075
|
-
profileDb: Float32Array;
|
|
1076
|
-
lastAutoGainDb: number;
|
|
1077
|
-
seq: number;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
/**
|
|
1081
|
-
* Equalizer band type (string union mirroring `sonare::mastering::eq::EqBandType`).
|
|
1082
|
-
*/
|
|
1083
|
-
export type EqBandType =
|
|
1084
|
-
| 'Peak'
|
|
1085
|
-
| 'LowShelf'
|
|
1086
|
-
| 'HighShelf'
|
|
1087
|
-
| 'LowPass'
|
|
1088
|
-
| 'HighPass'
|
|
1089
|
-
| 'BandPass'
|
|
1090
|
-
| 'Notch'
|
|
1091
|
-
| 'TiltShelf'
|
|
1092
|
-
| 'FlatTilt';
|
|
1093
|
-
|
|
1094
|
-
/** Biquad coefficient design mode. */
|
|
1095
|
-
export type EqCoeffMode = 'Rbj' | 'Vicanek';
|
|
1096
|
-
|
|
1097
|
-
/** Stereo placement for an EQ band. */
|
|
1098
|
-
export type EqStereoPlacement = 'Stereo' | 'Left' | 'Right' | 'Mid' | 'Side';
|
|
1099
|
-
|
|
1100
|
-
/** Per-band phase behaviour. */
|
|
1101
|
-
export type EqBandPhase = 'Inherit' | 'ZeroLatency' | 'NaturalPhase' | 'LinearPhase';
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Equalizer band configuration accepted by {@link StreamingEqualizer.setBand}.
|
|
1105
|
-
*
|
|
1106
|
-
* All fields are optional; omitted values fall back to the C++ band defaults
|
|
1107
|
-
* (Peak, 1000 Hz, 0 dB gain, Butterworth Q, disabled).
|
|
1108
|
-
*/
|
|
1109
|
-
export interface EqBand {
|
|
1110
|
-
type?: EqBandType;
|
|
1111
|
-
frequencyHz?: number;
|
|
1112
|
-
gainDb?: number;
|
|
1113
|
-
q?: number;
|
|
1114
|
-
enabled?: boolean;
|
|
1115
|
-
coeffMode?: EqCoeffMode;
|
|
1116
|
-
slopeDbOct?: number;
|
|
1117
|
-
placement?: EqStereoPlacement;
|
|
1118
|
-
phase?: EqBandPhase;
|
|
1119
|
-
soloed?: boolean;
|
|
1120
|
-
bypassed?: boolean;
|
|
1121
|
-
proportionalQ?: boolean;
|
|
1122
|
-
proportionalQStrength?: number;
|
|
1123
|
-
dynamic?: boolean;
|
|
1124
|
-
thresholdDb?: number;
|
|
1125
|
-
autoThreshold?: boolean;
|
|
1126
|
-
ratio?: number;
|
|
1127
|
-
rangeDb?: number;
|
|
1128
|
-
attackMs?: number;
|
|
1129
|
-
releaseMs?: number;
|
|
1130
|
-
lookaheadMs?: number;
|
|
1131
|
-
externalSidechain?: boolean;
|
|
1132
|
-
sidechainFreqHz?: number;
|
|
1133
|
-
sidechainQ?: number;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
/** Construction options for {@link StreamingEqualizer}. */
|
|
1137
|
-
export interface StreamingEqualizerConfig {
|
|
1138
|
-
sampleRate?: number;
|
|
1139
|
-
maxBlockSize?: number;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
/** Configuration for {@link StreamingRetune}. */
|
|
1143
|
-
export interface StreamingRetuneConfig {
|
|
1144
|
-
/** Pitch shift in semitones, clamped by the native processor to +/-24. */
|
|
1145
|
-
semitones?: number;
|
|
1146
|
-
/** Wet/dry mix, clamped by the native processor to 0..1. */
|
|
1147
|
-
mix?: number;
|
|
1148
|
-
/** Grain size in samples. Use 0/omit to derive it from the sample rate. */
|
|
1149
|
-
grainSize?: number;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
export type VoicePresetId =
|
|
1153
|
-
| 'neutral-monitor'
|
|
1154
|
-
| 'bright-idol'
|
|
1155
|
-
| 'soft-whisper'
|
|
1156
|
-
| 'deep-narrator'
|
|
1157
|
-
| 'robot-mascot'
|
|
1158
|
-
| 'dark-villain';
|
|
1159
|
-
|
|
1160
|
-
export interface RealtimeVoiceChangerPreset {
|
|
1161
|
-
schemaVersion: 1;
|
|
1162
|
-
id?: string;
|
|
1163
|
-
name?: string;
|
|
1164
|
-
description?: string;
|
|
1165
|
-
macros?: Record<string, number>;
|
|
1166
|
-
dsp?: Record<string, unknown>;
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
export type RealtimeVoiceChangerConfigInput = VoicePresetId | RealtimeVoiceChangerPreset;
|
|
1170
|
-
|
|
1171
|
-
/**
|
|
1172
|
-
* Flat (POD) realtime voice-changer configuration. Field names mirror the
|
|
1173
|
-
* C ABI `SonareRealtimeVoiceChangerConfig` / Python POD exactly (snake_case),
|
|
1174
|
-
* so a config can be round-tripped across bindings without renaming.
|
|
1175
|
-
*/
|
|
1176
|
-
export interface RealtimeVoiceChangerPodConfig {
|
|
1177
|
-
input_gain_db: number;
|
|
1178
|
-
output_gain_db: number;
|
|
1179
|
-
wet_mix: number;
|
|
1180
|
-
retune_semitones: number;
|
|
1181
|
-
retune_mix: number;
|
|
1182
|
-
retune_grain_size: number;
|
|
1183
|
-
formant_factor: number;
|
|
1184
|
-
formant_amount: number;
|
|
1185
|
-
formant_body: number;
|
|
1186
|
-
formant_brightness: number;
|
|
1187
|
-
formant_nasal: number;
|
|
1188
|
-
eq_highpass_hz: number;
|
|
1189
|
-
eq_body_db: number;
|
|
1190
|
-
eq_presence_db: number;
|
|
1191
|
-
eq_air_db: number;
|
|
1192
|
-
gate_threshold_db: number;
|
|
1193
|
-
gate_attack_ms: number;
|
|
1194
|
-
gate_release_ms: number;
|
|
1195
|
-
gate_range_db: number;
|
|
1196
|
-
compressor_threshold_db: number;
|
|
1197
|
-
compressor_ratio: number;
|
|
1198
|
-
compressor_attack_ms: number;
|
|
1199
|
-
compressor_release_ms: number;
|
|
1200
|
-
compressor_makeup_gain_db: number;
|
|
1201
|
-
deesser_frequency_hz: number;
|
|
1202
|
-
deesser_threshold_db: number;
|
|
1203
|
-
deesser_ratio: number;
|
|
1204
|
-
deesser_range_db: number;
|
|
1205
|
-
reverb_mix: number;
|
|
1206
|
-
reverb_time_ms: number;
|
|
1207
|
-
reverb_damping: number;
|
|
1208
|
-
reverb_seed: number;
|
|
1209
|
-
limiter_ceiling_db: number;
|
|
1210
|
-
limiter_release_ms: number;
|
|
1211
|
-
/** Non-zero enables the 4x-oversampled inter-sample-peak limiter (default enabled). */
|
|
1212
|
-
limiter_enable_isp_limiter: boolean;
|
|
1213
|
-
/** True-peak ceiling in dBTP applied by the ISP limiter (default -1.0). */
|
|
1214
|
-
limiter_isp_ceiling_dbtp: number;
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
/** Options for {@link StreamingEqualizer.match}. */
|
|
1218
|
-
export interface EqMatchOptions {
|
|
1219
|
-
sampleRate?: number;
|
|
1220
|
-
maxBands?: number;
|
|
1221
|
-
}
|
|
1
|
+
export * from './public_types_acoustic';
|
|
2
|
+
export * from './public_types_mastering';
|
|
3
|
+
export * from './public_types_mixing';
|
|
4
|
+
export * from './public_types_music';
|
|
5
|
+
export * from './public_types_realtime';
|
|
6
|
+
export * from './public_types_spectral';
|