@libraz/libsonare 1.7.0 → 1.7.2
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 +33 -0
- package/dist/analysis.d.ts +55 -3
- package/dist/analysis.js +10 -0
- package/dist/analysis.js.map +1 -1
- package/dist/index.d.ts +368 -199
- package/dist/index.js +111 -6
- package/dist/index.js.map +1 -1
- package/dist/sonare-analysis.js +1 -1
- package/dist/sonare-analysis.wasm +0 -0
- package/dist/sonare.js +1 -1
- package/dist/sonare.wasm +0 -0
- package/dist/worker.js.map +1 -1
- package/dist/worklet.d.ts +379 -9
- package/dist/worklet.js +174 -13
- package/dist/worklet.js.map +1 -1
- package/package.json +1 -1
- package/src/_chain_config.ts +6 -1
- package/src/effects_mastering.ts +5 -0
- package/src/effects_transform.ts +23 -12
- package/src/index.ts +10 -0
- package/src/mastering_core.ts +70 -0
- package/src/metering.ts +18 -0
- package/src/project.ts +3 -0
- package/src/project_class.ts +52 -2
- package/src/project_internal.ts +2 -0
- package/src/project_types.ts +39 -8
- package/src/public_types_mastering.ts +9 -0
- package/src/public_types_spectral.ts +16 -2
- package/src/realtime_engine.ts +39 -0
- package/src/sonare.js.d.ts +26 -0
- package/src/streaming_processors.ts +18 -0
- package/src/worklet/engine-node.ts +7 -2
- package/src/worklet/engine-processor.ts +59 -12
- package/src/worklet/messages.ts +12 -0
- package/src/worklet.ts +5 -0
package/dist/worklet.d.ts
CHANGED
|
@@ -34,12 +34,11 @@ interface SynthModRouting {
|
|
|
34
34
|
*
|
|
35
35
|
* The patch starts from a BASE — the named `preset` (see
|
|
36
36
|
* {@link synthPresetNames}; a `"va:"` routing prefix is accepted) or, when
|
|
37
|
-
* `preset` is omitted, the default subtractive patch.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* base value. A non-empty `modRoutings` REPLACES the base mod matrix.
|
|
37
|
+
* `preset` is omitted, the default subtractive patch. Omitting a numeric field
|
|
38
|
+
* keeps the base value; supplying one overrides it (clamped to its audible
|
|
39
|
+
* range), including an explicit `0` such as `stereoSpread: 0`. The enum fields
|
|
40
|
+
* reserve `'default'` as keep. A `modRoutings` array REPLACES the base mod
|
|
41
|
+
* matrix, and an empty array clears it, while omitting the key keeps it.
|
|
43
42
|
*
|
|
44
43
|
* Mode-specific deep parameters (FM operator stacks, modal mode tables,
|
|
45
44
|
* drawbar registrations, kit pieces, piano strings) travel inside the named
|
|
@@ -75,12 +74,10 @@ interface SynthPatch {
|
|
|
75
74
|
velToCutoffCents?: number;
|
|
76
75
|
ampAttackMs?: number;
|
|
77
76
|
ampDecayMs?: number;
|
|
78
|
-
/** 0 / omit keeps the base value; explicit zero sustain is not representable. */
|
|
79
77
|
ampSustain?: number;
|
|
80
78
|
ampReleaseMs?: number;
|
|
81
79
|
filterAttackMs?: number;
|
|
82
80
|
filterDecayMs?: number;
|
|
83
|
-
/** 0 / omit keeps the base value; explicit zero sustain is not representable. */
|
|
84
81
|
filterSustain?: number;
|
|
85
82
|
filterReleaseMs?: number;
|
|
86
83
|
lfoRateHz?: number;
|
|
@@ -117,6 +114,249 @@ interface ProjectMidiCcBinding {
|
|
|
117
114
|
maxValue: number;
|
|
118
115
|
}
|
|
119
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Nested mastering-chain configuration. A boolean toggles a module/processor's
|
|
119
|
+
* `enabled` flag; setting any field implicitly enables its module unless
|
|
120
|
+
* `enabled: false` is also given.
|
|
121
|
+
*
|
|
122
|
+
* Exception — color stages as `masterAudio` overrides: the `saturation.tape`
|
|
123
|
+
* and `saturation.exciter` stages are engaged from an override only when you
|
|
124
|
+
* pass `enabled: true` explicitly. On a preset where they are off, adjusting a
|
|
125
|
+
* parameter alone (e.g. `saturation: { tape: { driveDb: 6 } }`) has no audible
|
|
126
|
+
* effect; use `saturation: { tape: { enabled: true, driveDb: 6 } }`.
|
|
127
|
+
*/
|
|
128
|
+
interface MasteringChainConfig {
|
|
129
|
+
repair?: {
|
|
130
|
+
/** `boolean` is retained as a deprecated shorthand for `{ enabled }`. */
|
|
131
|
+
denoise?: boolean | {
|
|
132
|
+
enabled?: boolean;
|
|
133
|
+
nFft?: number;
|
|
134
|
+
hopLength?: number;
|
|
135
|
+
ddAlpha?: number;
|
|
136
|
+
gainFloor?: number;
|
|
137
|
+
overSubtraction?: number;
|
|
138
|
+
spectralFloor?: number;
|
|
139
|
+
noiseEstimationQuantile?: number;
|
|
140
|
+
speechPresenceGain?: boolean;
|
|
141
|
+
gainSmoothing?: boolean;
|
|
142
|
+
};
|
|
143
|
+
nFft?: number;
|
|
144
|
+
hopLength?: number;
|
|
145
|
+
ddAlpha?: number;
|
|
146
|
+
gainFloor?: number;
|
|
147
|
+
declip?: {
|
|
148
|
+
enabled?: boolean;
|
|
149
|
+
clipThreshold?: number;
|
|
150
|
+
lpcOrder?: number;
|
|
151
|
+
iterations?: number;
|
|
152
|
+
lpcBlend?: number;
|
|
153
|
+
};
|
|
154
|
+
decrackle?: {
|
|
155
|
+
enabled?: boolean;
|
|
156
|
+
threshold?: number;
|
|
157
|
+
/** 0 = median, 1 = wavelet shrinkage. */
|
|
158
|
+
mode?: number;
|
|
159
|
+
levels?: number;
|
|
160
|
+
};
|
|
161
|
+
dehum?: {
|
|
162
|
+
enabled?: boolean;
|
|
163
|
+
fundamentalHz?: number;
|
|
164
|
+
harmonics?: number;
|
|
165
|
+
q?: number;
|
|
166
|
+
adaptive?: boolean;
|
|
167
|
+
searchRangeHz?: number;
|
|
168
|
+
adaptation?: number;
|
|
169
|
+
frameSize?: number;
|
|
170
|
+
pllBandwidth?: number;
|
|
171
|
+
};
|
|
172
|
+
declick?: {
|
|
173
|
+
enabled?: boolean;
|
|
174
|
+
threshold?: number;
|
|
175
|
+
neighborRatio?: number;
|
|
176
|
+
maxClickSamples?: number;
|
|
177
|
+
lpcOrder?: number;
|
|
178
|
+
residualRatio?: number;
|
|
179
|
+
};
|
|
180
|
+
dereverb?: {
|
|
181
|
+
enabled?: boolean;
|
|
182
|
+
threshold?: number;
|
|
183
|
+
attenuation?: number;
|
|
184
|
+
nFft?: number;
|
|
185
|
+
hopLength?: number;
|
|
186
|
+
t60Sec?: number;
|
|
187
|
+
lateDelayMs?: number;
|
|
188
|
+
overSubtraction?: number;
|
|
189
|
+
spectralFloor?: number;
|
|
190
|
+
wpeEnabled?: boolean;
|
|
191
|
+
wpeIterations?: number;
|
|
192
|
+
wpeTaps?: number;
|
|
193
|
+
wpeStrength?: number;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
eq?: {
|
|
197
|
+
/** Canonical nested tilt stage. */
|
|
198
|
+
tilt?: {
|
|
199
|
+
enabled?: boolean;
|
|
200
|
+
tiltDb?: number;
|
|
201
|
+
pivotHz?: number;
|
|
202
|
+
};
|
|
203
|
+
/** @deprecated Use `eq.tilt.tiltDb`. */
|
|
204
|
+
tiltDb?: number;
|
|
205
|
+
/** @deprecated Use `eq.tilt.pivotHz`. */
|
|
206
|
+
pivotHz?: number;
|
|
207
|
+
};
|
|
208
|
+
dynamics?: {
|
|
209
|
+
compressor?: {
|
|
210
|
+
enabled?: boolean;
|
|
211
|
+
thresholdDb?: number;
|
|
212
|
+
ratio?: number;
|
|
213
|
+
attackMs?: number;
|
|
214
|
+
releaseMs?: number;
|
|
215
|
+
kneeDb?: number;
|
|
216
|
+
makeupGainDb?: number;
|
|
217
|
+
autoMakeup?: boolean;
|
|
218
|
+
};
|
|
219
|
+
deesser?: {
|
|
220
|
+
enabled?: boolean;
|
|
221
|
+
frequencyHz?: number;
|
|
222
|
+
thresholdDb?: number;
|
|
223
|
+
ratio?: number;
|
|
224
|
+
attackMs?: number;
|
|
225
|
+
releaseMs?: number;
|
|
226
|
+
rangeDb?: number;
|
|
227
|
+
bandpassQ?: number;
|
|
228
|
+
};
|
|
229
|
+
transientShaper?: {
|
|
230
|
+
enabled?: boolean;
|
|
231
|
+
attackGainDb?: number;
|
|
232
|
+
sustainGainDb?: number;
|
|
233
|
+
fastAttackMs?: number;
|
|
234
|
+
fastReleaseMs?: number;
|
|
235
|
+
slowAttackMs?: number;
|
|
236
|
+
slowReleaseMs?: number;
|
|
237
|
+
sensitivity?: number;
|
|
238
|
+
maxGainDb?: number;
|
|
239
|
+
gainSmoothingMs?: number;
|
|
240
|
+
lookaheadMs?: number;
|
|
241
|
+
};
|
|
242
|
+
multibandComp?: {
|
|
243
|
+
enabled?: boolean;
|
|
244
|
+
lowCutoffHz?: number;
|
|
245
|
+
highCutoffHz?: number;
|
|
246
|
+
lowThresholdDb?: number;
|
|
247
|
+
lowRatio?: number;
|
|
248
|
+
lowAttackMs?: number;
|
|
249
|
+
lowReleaseMs?: number;
|
|
250
|
+
midThresholdDb?: number;
|
|
251
|
+
midRatio?: number;
|
|
252
|
+
midAttackMs?: number;
|
|
253
|
+
midReleaseMs?: number;
|
|
254
|
+
highThresholdDb?: number;
|
|
255
|
+
highRatio?: number;
|
|
256
|
+
highAttackMs?: number;
|
|
257
|
+
highReleaseMs?: number;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
saturation?: {
|
|
261
|
+
tape?: {
|
|
262
|
+
enabled?: boolean;
|
|
263
|
+
driveDb?: number;
|
|
264
|
+
saturation?: number;
|
|
265
|
+
hysteresis?: number;
|
|
266
|
+
outputGainDb?: number;
|
|
267
|
+
speedIps?: number;
|
|
268
|
+
headBumpDb?: number;
|
|
269
|
+
bias?: number;
|
|
270
|
+
gapLoss?: number;
|
|
271
|
+
};
|
|
272
|
+
exciter?: {
|
|
273
|
+
enabled?: boolean;
|
|
274
|
+
frequencyHz?: number;
|
|
275
|
+
driveDb?: number;
|
|
276
|
+
amount?: number;
|
|
277
|
+
q?: number;
|
|
278
|
+
evenOddMix?: number;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
spectral?: {
|
|
282
|
+
airBand?: {
|
|
283
|
+
enabled?: boolean;
|
|
284
|
+
amount?: number;
|
|
285
|
+
shelfFrequencyHz?: number;
|
|
286
|
+
dynamicThresholdDb?: number;
|
|
287
|
+
dynamicRangeDb?: number;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
stereo?: {
|
|
291
|
+
imager?: {
|
|
292
|
+
enabled?: boolean;
|
|
293
|
+
width?: number;
|
|
294
|
+
outputGainDb?: number;
|
|
295
|
+
decorrelationAmount?: number;
|
|
296
|
+
preserveEnergy?: boolean;
|
|
297
|
+
};
|
|
298
|
+
monoMaker?: {
|
|
299
|
+
enabled?: boolean;
|
|
300
|
+
amount?: number;
|
|
301
|
+
frequencyHz?: number;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
maximizer?: {
|
|
305
|
+
truePeakLimiter?: {
|
|
306
|
+
enabled?: boolean;
|
|
307
|
+
ceilingDb?: number;
|
|
308
|
+
lookaheadMs?: number;
|
|
309
|
+
releaseMs?: number;
|
|
310
|
+
oversampleFactor?: number;
|
|
311
|
+
applyGainAtInputRate?: boolean;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
loudness?: {
|
|
315
|
+
enabled?: boolean;
|
|
316
|
+
targetLufs?: number;
|
|
317
|
+
ceilingDb?: number;
|
|
318
|
+
truePeakOversample?: number;
|
|
319
|
+
releaseMs?: number;
|
|
320
|
+
applyGainAtInputRate?: boolean;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* Dot-notation spelling of any leaf above, e.g. `'loudness.targetLufs': -20`
|
|
324
|
+
* beside or instead of `loudness: { targetLufs: -20 }`. It is the form the C
|
|
325
|
+
* ABI carries parameters in, so a caller assembling overrides dynamically can
|
|
326
|
+
* emit it directly; the core validates the key and rejects an unknown one.
|
|
327
|
+
* The nested spelling is canonical — prefer it in hand-written code, where it
|
|
328
|
+
* is checked field by field while a dotted key is only checked at run time.
|
|
329
|
+
*/
|
|
330
|
+
[flatKey: `${string}.${string}`]: number | boolean | undefined;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Configuration for the block-by-block {@link StreamingMasteringChain}.
|
|
334
|
+
*
|
|
335
|
+
* Extends {@link MasteringChainConfig} with optional precomputed loudness
|
|
336
|
+
* parameters. The streaming chain cannot measure whole-signal integrated LUFS,
|
|
337
|
+
* so an enabled `loudness` stage normally throws at construction. To let a
|
|
338
|
+
* preset's streaming preview match its offline render, the caller may
|
|
339
|
+
* precompute the loudness normalization gain offline (e.g.
|
|
340
|
+
* `targetLufs - measuredIntegratedLufs`) and supply it here.
|
|
341
|
+
*/
|
|
342
|
+
interface StreamingMasteringChainConfig extends MasteringChainConfig {
|
|
343
|
+
/**
|
|
344
|
+
* Precomputed static loudness gain in dB. When omitted (the default), an
|
|
345
|
+
* enabled `loudness` stage still throws. When provided and `loudness.enabled`
|
|
346
|
+
* is set, the chain applies this fixed gain per block before the loudness
|
|
347
|
+
* stage's true-peak limiter instead of throwing.
|
|
348
|
+
*/
|
|
349
|
+
loudnessStaticGainDb?: number;
|
|
350
|
+
/**
|
|
351
|
+
* Offline-measured true-peak (dBFS) of the source the static gain was
|
|
352
|
+
* computed for. When provided, the static gain is clamped to
|
|
353
|
+
* `loudness.ceilingDb - loudnessStaticGainPeakDb` so the streaming preview
|
|
354
|
+
* does not drive the loudness limiter harder than the offline chain. When
|
|
355
|
+
* omitted (the default) the static gain is applied verbatim.
|
|
356
|
+
*/
|
|
357
|
+
loudnessStaticGainPeakDb?: number;
|
|
358
|
+
}
|
|
359
|
+
|
|
120
360
|
type PanMode = 'balance' | 'pan' | 'stereoPan' | 'stereo-pan' | 'dualPan' | 'dual-pan' | number;
|
|
121
361
|
/**
|
|
122
362
|
* Interpolation curve for scheduled automation events
|
|
@@ -546,6 +786,15 @@ declare class RealtimeEngine {
|
|
|
546
786
|
* Returns `-1` when the track, insert, or name is unknown. (The Python binding
|
|
547
787
|
* raises a `SonareError` for an unknown id where Node/WASM return the `-1`
|
|
548
788
|
* sentinel.)
|
|
789
|
+
*
|
|
790
|
+
* This trio is how a mastering processor gets time-varying automation: the
|
|
791
|
+
* `eq.*`, `dynamics.*`, `saturation.*`, `spectral.*`, `stereo.*`,
|
|
792
|
+
* `maximizer.*` and `multiband.*` processors are all available as strip
|
|
793
|
+
* inserts, so placing one on a strip and resolving its parameter here drives
|
|
794
|
+
* it at audio-block precision, live and offline alike. The whole-signal
|
|
795
|
+
* stages of the offline mastering chain (`repair.*`, `loudness`, and the
|
|
796
|
+
* match stages) have no insert form and no automation id: they buffer the
|
|
797
|
+
* entire signal by construction and do not run on the realtime path.
|
|
549
798
|
*/
|
|
550
799
|
resolveTrackInsertAutomationId(trackId: number, insertIndex: number, paramName: string): number;
|
|
551
800
|
resolveMasterInsertAutomationId(insertIndex: number, paramName: string): number;
|
|
@@ -612,6 +861,27 @@ declare class RealtimeEngine {
|
|
|
612
861
|
* `prepareChannels`.
|
|
613
862
|
*/
|
|
614
863
|
processPrepared(numFrames: number): void;
|
|
864
|
+
/**
|
|
865
|
+
* Allocates the cue-bus counterpart of {@link prepareChannels}. Needed only
|
|
866
|
+
* when PFL/AFL monitoring must reach a separate output: `processPrepared`
|
|
867
|
+
* folds the cue bus into the program output, while
|
|
868
|
+
* {@link processPreparedWithMonitor} keeps the two apart. Call once, off the
|
|
869
|
+
* audio thread, with at least as many channels as `prepareChannels` got.
|
|
870
|
+
*/
|
|
871
|
+
prepareMonitorChannels(numChannels: number, maxFrames: number): void;
|
|
872
|
+
/**
|
|
873
|
+
* Returns a Float32Array view onto the persistent cue-bus scratch for one
|
|
874
|
+
* channel (valid for up to `numFrames`). Read it after
|
|
875
|
+
* {@link processPreparedWithMonitor}. Re-acquire after WASM memory growth.
|
|
876
|
+
*/
|
|
877
|
+
getMonitorChannelBuffer(channel: number, numFrames: number): Float32Array;
|
|
878
|
+
/**
|
|
879
|
+
* Runs the engine in place over the prepared scratch, writing the cue bus to
|
|
880
|
+
* the monitor scratch instead of folding it into the program output.
|
|
881
|
+
* Allocation-free: safe on the AudioWorklet render thread after
|
|
882
|
+
* `prepareChannels` and `prepareMonitorChannels`.
|
|
883
|
+
*/
|
|
884
|
+
processPreparedWithMonitor(numFrames: number): void;
|
|
615
885
|
processWithMonitor(channels: Float32Array[]): WasmEngineProcessWithMonitorResult;
|
|
616
886
|
renderOffline(channels: Float32Array[], blockSize?: number): Float32Array[];
|
|
617
887
|
bounceOffline(options: EngineBounceOptions): EngineBounceResult;
|
|
@@ -823,6 +1093,91 @@ declare function attachOpfsClipStream(streamer: ClipPageStreamer, engine: Realti
|
|
|
823
1093
|
*/
|
|
824
1094
|
declare function attachOpfsClipStream(engine: WorkletOpfsClipStreamHost, options: OpfsClipStreamOptions): Promise<OpfsClipStream>;
|
|
825
1095
|
|
|
1096
|
+
/**
|
|
1097
|
+
* Block-by-block streaming variant of {@link masteringChain}.
|
|
1098
|
+
*
|
|
1099
|
+
* Maintains processor state across {@link processMono}/{@link processStereo}
|
|
1100
|
+
* calls. Only ProcessorBase-backed stages are supported. Configurations that
|
|
1101
|
+
* enable `repair.denoise` throw at construction. An enabled `loudness` stage
|
|
1102
|
+
* also throws unless {@link StreamingMasteringChainConfig.loudnessStaticGainDb}
|
|
1103
|
+
* supplies a precomputed normalization gain.
|
|
1104
|
+
*
|
|
1105
|
+
* Call {@link delete} (or use a `try/finally`) to release the underlying WASM
|
|
1106
|
+
* object — the embind handle is not garbage-collected automatically.
|
|
1107
|
+
*
|
|
1108
|
+
* Reachable from the AudioWorklet realm through the `sonare/worklet` entry, but
|
|
1109
|
+
* the realtime contract is the caller's to keep:
|
|
1110
|
+
*
|
|
1111
|
+
* - {@link prepare} builds the processors and allocates. Call it once from a
|
|
1112
|
+
* message handler, never from `AudioWorkletProcessor.process()`.
|
|
1113
|
+
* - {@link processMono}/{@link processStereo} return fresh arrays. On the render
|
|
1114
|
+
* thread, reuse the returned reference for the block rather than retaining it.
|
|
1115
|
+
* - An enabled `loudness` stage needs `loudnessStaticGainDb` measured offline,
|
|
1116
|
+
* because whole-signal integrated LUFS cannot be measured block by block. Pass
|
|
1117
|
+
* `loudnessStaticGainPeakDb` too and the static gain is clamped exactly as the
|
|
1118
|
+
* offline chain clamps it, so the live preview matches the render.
|
|
1119
|
+
* - {@link flush} output starts {@link latencySamples} samples early; discard
|
|
1120
|
+
* that many leading samples when time alignment matters.
|
|
1121
|
+
*
|
|
1122
|
+
* The chain is a host-side stage, not an engine insert: it does not participate
|
|
1123
|
+
* in the engine's PDC or bypass, so latency compensation against other engine
|
|
1124
|
+
* outputs is also the caller's.
|
|
1125
|
+
*
|
|
1126
|
+
* @example
|
|
1127
|
+
* ```typescript
|
|
1128
|
+
* const chain = new StreamingMasteringChain({ eq: { tiltDb: 1.0 } });
|
|
1129
|
+
* try {
|
|
1130
|
+
* chain.prepare(44100, 512, 1);
|
|
1131
|
+
* const out = chain.processMono(blockSamples);
|
|
1132
|
+
* } finally {
|
|
1133
|
+
* chain.delete();
|
|
1134
|
+
* }
|
|
1135
|
+
* ```
|
|
1136
|
+
*/
|
|
1137
|
+
declare class StreamingMasteringChain {
|
|
1138
|
+
private chain;
|
|
1139
|
+
constructor(config: StreamingMasteringChainConfig);
|
|
1140
|
+
/**
|
|
1141
|
+
* Initialize processors for the given sample rate and block layout.
|
|
1142
|
+
*
|
|
1143
|
+
* @param sampleRate - Sample rate in Hz
|
|
1144
|
+
* @param maxBlockSize - Maximum block size per process call
|
|
1145
|
+
* @param numChannels - 1 (mono) or 2 (stereo)
|
|
1146
|
+
*/
|
|
1147
|
+
prepare(sampleRate: number, maxBlockSize: number, numChannels: number): void;
|
|
1148
|
+
/**
|
|
1149
|
+
* Process one mono block, returning the processed samples (same length).
|
|
1150
|
+
*/
|
|
1151
|
+
processMono(samples: Float32Array): Float32Array;
|
|
1152
|
+
/**
|
|
1153
|
+
* Process one stereo block, returning the processed channels.
|
|
1154
|
+
*/
|
|
1155
|
+
processStereo(left: Float32Array, right: Float32Array): {
|
|
1156
|
+
left: Float32Array;
|
|
1157
|
+
right: Float32Array;
|
|
1158
|
+
};
|
|
1159
|
+
/**
|
|
1160
|
+
* Emit delayed audio and finite processor tails after the final mono block.
|
|
1161
|
+
* Call until this returns an empty array. The initial `latencySamples()`
|
|
1162
|
+
* samples of the concatenated stream are delayed and should be discarded for
|
|
1163
|
+
* time-aligned output.
|
|
1164
|
+
*/
|
|
1165
|
+
flushMono(): Float32Array;
|
|
1166
|
+
/** Stereo counterpart of {@link flushMono}. */
|
|
1167
|
+
flushStereo(): {
|
|
1168
|
+
left: Float32Array;
|
|
1169
|
+
right: Float32Array;
|
|
1170
|
+
};
|
|
1171
|
+
/** Reset all processor state without rebuilding. */
|
|
1172
|
+
reset(): void;
|
|
1173
|
+
/** Total reported latency in samples across all active processors. */
|
|
1174
|
+
latencySamples(): number;
|
|
1175
|
+
/** Ordered stage names that will run (e.g. `"eq.tilt"`). */
|
|
1176
|
+
stageNames(): string[];
|
|
1177
|
+
/** Release the underlying WASM object. Safe to call only once. */
|
|
1178
|
+
delete(): void;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
826
1181
|
/**
|
|
827
1182
|
* sonare - Audio Analysis Library
|
|
828
1183
|
*
|
|
@@ -1146,6 +1501,13 @@ interface SonareRealtimeEngineWorkletProcessorOptions {
|
|
|
1146
1501
|
/** Lock-free worklet-to-main-thread MIDI-1 output ring. */
|
|
1147
1502
|
externalMidiSharedBuffer?: SharedArrayBuffer;
|
|
1148
1503
|
externalMidiRingCapacity?: number;
|
|
1504
|
+
/**
|
|
1505
|
+
* Route the PFL/AFL cue bus to the processor's SECOND output instead of
|
|
1506
|
+
* folding it into the program output. Off by default, so an existing
|
|
1507
|
+
* single-output host keeps its current mix sample for sample. The node must
|
|
1508
|
+
* be constructed with two outputs for the cue to be audible.
|
|
1509
|
+
*/
|
|
1510
|
+
cueOutput?: boolean;
|
|
1149
1511
|
}
|
|
1150
1512
|
interface SonareRealtimeVoiceChangerWorkletProcessorOptions {
|
|
1151
1513
|
preset?: RealtimeVoiceChangerConfigInput;
|
|
@@ -1175,6 +1537,11 @@ interface SonareRealtimeEngineNodeCapabilities {
|
|
|
1175
1537
|
clipPageRequestsRealtimeSafe: boolean;
|
|
1176
1538
|
/** True when external MIDI uses the SAB output ring rather than postMessage. */
|
|
1177
1539
|
externalMidiRealtimeSafe: boolean;
|
|
1540
|
+
/**
|
|
1541
|
+
* True when the node carries a second output fed by the PFL/AFL cue bus. When
|
|
1542
|
+
* false the cue is folded into the program output, as it always was.
|
|
1543
|
+
*/
|
|
1544
|
+
cueOutput: boolean;
|
|
1178
1545
|
engineAbiVersion?: number;
|
|
1179
1546
|
expectedEngineAbiVersion?: number;
|
|
1180
1547
|
abiCompatible?: boolean;
|
|
@@ -2027,6 +2394,8 @@ declare class SonareRealtimeEngineWorkletProcessor {
|
|
|
2027
2394
|
private lastMeterFrame;
|
|
2028
2395
|
private metronomeConfig;
|
|
2029
2396
|
private channelBuffers;
|
|
2397
|
+
private monitorBuffers;
|
|
2398
|
+
private readonly cueOutput;
|
|
2030
2399
|
private readonly liveClips;
|
|
2031
2400
|
private readonly pagedClipProviders;
|
|
2032
2401
|
private readonly pagedClipPageFrames;
|
|
@@ -2037,6 +2406,7 @@ declare class SonareRealtimeEngineWorkletProcessor {
|
|
|
2037
2406
|
constructor(options?: SonareRealtimeEngineWorkletProcessorOptions, transport?: WorkletTransport);
|
|
2038
2407
|
process(inputs: WorkletInput, outputs: WorkletOutput): boolean;
|
|
2039
2408
|
private reacquireChannelBuffers;
|
|
2409
|
+
private reacquireMonitorBuffers;
|
|
2040
2410
|
receiveCommand(command: SonareEngineCommandRecord): void;
|
|
2041
2411
|
receiveSync(message: SonareEngineSyncMessage): void;
|
|
2042
2412
|
private applySync;
|
|
@@ -2142,4 +2512,4 @@ declare class SonareRealtimeVoiceChangerWorkletProcessor {
|
|
|
2142
2512
|
}
|
|
2143
2513
|
declare function registerSonareRealtimeVoiceChangerWorkletProcessor(name?: string): void;
|
|
2144
2514
|
|
|
2145
|
-
export { type OpfsClipStream, type OpfsClipStreamOptions, SONARE_CLIP_PAGE_REQUEST_RING_HEADER_INTS, SONARE_CLIP_PAGE_REQUEST_RING_RECORD_UINT32S, SONARE_ENGINE_COMMAND_RECORD_BYTES, SONARE_ENGINE_RING_HEADER_INTS, SONARE_ENGINE_TELEMETRY_RECORD_BYTES, SONARE_EXTERNAL_MIDI_RING_HEADER_INTS, SONARE_EXTERNAL_MIDI_RING_RECORD_UINT32S, SONARE_METER_RING_HEADER_INTS, SONARE_METER_RING_RECORD_FLOATS, SONARE_SCOPE_RING_HEADER_INTS, SONARE_SPECTRUM_RING_HEADER_INTS, type SonareClipPageRequest, type SonareClipPageRequestRingBuffer, type SonareClipPageRequestRingReadResult, SonareEngine, type SonareEngineCaptureRequestMessage, type SonareEngineCaptureResponseMessage, type SonareEngineClipPageRequestMessage, type SonareEngineCommandRecord, type SonareEngineCommandRingBuffer, SonareEngineCommandType, type SonareEngineOptions, type SonareEngineSyncAutomationMessage, type SonareEngineSyncBuiltinInstrumentMessage, type SonareEngineSyncCaptureMessage, type SonareEngineSyncClipsDeltaMessage, type SonareEngineSyncClipsMessage, type SonareEngineSyncLoadSoundFontMessage, type SonareEngineSyncMarkersMessage, type SonareEngineSyncMasterStripEqBandMessage, type SonareEngineSyncMasterStripInsertBypassedMessage, type SonareEngineSyncMessage, type SonareEngineSyncMetronomeMessage, type SonareEngineSyncMidiCcMessage, type SonareEngineSyncMidiClipsMessage, type SonareEngineSyncMidiNoteMessage, type SonareEngineSyncMidiPanicMessage, type SonareEngineSyncMixerMessage, type SonareEngineSyncSf2InstrumentMessage, type SonareEngineSyncSynthInstrumentMessage, type SonareEngineSyncTempoMessage, type SonareEngineSyncTrackStripEqBandMessage, type SonareEngineSyncTrackStripInsertBypassedMessage, SonareEngineTelemetryError, type SonareEngineTelemetryRecord, type SonareEngineTelemetryRingBuffer, type SonareEngineTelemetryRingReadResult, SonareEngineTelemetryType, type SonareEngineTransportFacade, type SonareEngineTransportRequestMessage, type SonareEngineTransportResponseMessage, type SonareExternalMidiRingBuffer, type SonareExternalMidiRingReadResult, type SonareMeterRingBuffer, type SonareMeterRingReadResult, SonareRealtimeEngineNode, type SonareRealtimeEngineNodeCapabilities, type SonareRealtimeEngineNodeOptions, SonareRealtimeEngineWorkletProcessor, type SonareRealtimeEngineWorkletProcessorOptions, type SonareRealtimeVoiceChangerDestroyMessage, type SonareRealtimeVoiceChangerMessage, type SonareRealtimeVoiceChangerResetMessage, type SonareRealtimeVoiceChangerSetConfigMessage, SonareRealtimeVoiceChangerWorkletProcessor, type SonareRealtimeVoiceChangerWorkletProcessorOptions, type SonareScopeRingBuffer, type SonareScopeRingReadResult, type SonareSpectrumRingBuffer, type SonareSpectrumRingReadResult, type SonareWorkletDestroyMessage, type SonareWorkletMessage, type SonareWorkletMeterSnapshot, SonareWorkletProcessor, type SonareWorkletProcessorOptions, type SonareWorkletScheduleInsertAutomationMessage, type SonareWorkletScopeSnapshot, type SonareWorkletSetMeterIntervalMessage, type SonareWorkletSpectrumSnapshot, type SonareWorkletTransportMessage, attachOpfsClipStream, createSonareClipPageRequestRingBuffer, createSonareEngineCommandRingBuffer, createSonareEngineTelemetryRingBuffer, createSonareExternalMidiRingBuffer, createSonareMeterRingBuffer, createSonareScopeRingBuffer, createSonareSpectrumRingBuffer, decodeFrame, encodeFrameHi, encodeFrameLo, init, isInitialized, popSonareEngineCommandRingBuffer, pushSonareClipPageRequestRingBuffer, pushSonareEngineCommandRingBuffer, pushSonareExternalMidiRingBuffer, readSonareClipPageRequestRingBuffer, readSonareEngineTelemetryRingBuffer, readSonareExternalMidiRingBuffer, readSonareMeterRingBuffer, readSonareScopeRingBuffer, readSonareSpectrumRingBuffer, registerSonareRealtimeEngineWorkletProcessor, registerSonareRealtimeVoiceChangerWorkletProcessor, registerSonareWorkletProcessor, sonareClipPageRequestRingBufferByteLength, sonareEngineCommandRingBufferByteLength, sonareEngineTelemetryRingBufferByteLength, sonareExternalMidiRingBufferByteLength, sonareMeterRingBufferByteLength, sonareScopeRingBufferByteLength, sonareSpectrumRingBufferByteLength, writeSonareEngineTelemetryRingBuffer };
|
|
2515
|
+
export { type OpfsClipStream, type OpfsClipStreamOptions, SONARE_CLIP_PAGE_REQUEST_RING_HEADER_INTS, SONARE_CLIP_PAGE_REQUEST_RING_RECORD_UINT32S, SONARE_ENGINE_COMMAND_RECORD_BYTES, SONARE_ENGINE_RING_HEADER_INTS, SONARE_ENGINE_TELEMETRY_RECORD_BYTES, SONARE_EXTERNAL_MIDI_RING_HEADER_INTS, SONARE_EXTERNAL_MIDI_RING_RECORD_UINT32S, SONARE_METER_RING_HEADER_INTS, SONARE_METER_RING_RECORD_FLOATS, SONARE_SCOPE_RING_HEADER_INTS, SONARE_SPECTRUM_RING_HEADER_INTS, type SonareClipPageRequest, type SonareClipPageRequestRingBuffer, type SonareClipPageRequestRingReadResult, SonareEngine, type SonareEngineCaptureRequestMessage, type SonareEngineCaptureResponseMessage, type SonareEngineClipPageRequestMessage, type SonareEngineCommandRecord, type SonareEngineCommandRingBuffer, SonareEngineCommandType, type SonareEngineOptions, type SonareEngineSyncAutomationMessage, type SonareEngineSyncBuiltinInstrumentMessage, type SonareEngineSyncCaptureMessage, type SonareEngineSyncClipsDeltaMessage, type SonareEngineSyncClipsMessage, type SonareEngineSyncLoadSoundFontMessage, type SonareEngineSyncMarkersMessage, type SonareEngineSyncMasterStripEqBandMessage, type SonareEngineSyncMasterStripInsertBypassedMessage, type SonareEngineSyncMessage, type SonareEngineSyncMetronomeMessage, type SonareEngineSyncMidiCcMessage, type SonareEngineSyncMidiClipsMessage, type SonareEngineSyncMidiNoteMessage, type SonareEngineSyncMidiPanicMessage, type SonareEngineSyncMixerMessage, type SonareEngineSyncSf2InstrumentMessage, type SonareEngineSyncSynthInstrumentMessage, type SonareEngineSyncTempoMessage, type SonareEngineSyncTrackStripEqBandMessage, type SonareEngineSyncTrackStripInsertBypassedMessage, SonareEngineTelemetryError, type SonareEngineTelemetryRecord, type SonareEngineTelemetryRingBuffer, type SonareEngineTelemetryRingReadResult, SonareEngineTelemetryType, type SonareEngineTransportFacade, type SonareEngineTransportRequestMessage, type SonareEngineTransportResponseMessage, type SonareExternalMidiRingBuffer, type SonareExternalMidiRingReadResult, type SonareMeterRingBuffer, type SonareMeterRingReadResult, SonareRealtimeEngineNode, type SonareRealtimeEngineNodeCapabilities, type SonareRealtimeEngineNodeOptions, SonareRealtimeEngineWorkletProcessor, type SonareRealtimeEngineWorkletProcessorOptions, type SonareRealtimeVoiceChangerDestroyMessage, type SonareRealtimeVoiceChangerMessage, type SonareRealtimeVoiceChangerResetMessage, type SonareRealtimeVoiceChangerSetConfigMessage, SonareRealtimeVoiceChangerWorkletProcessor, type SonareRealtimeVoiceChangerWorkletProcessorOptions, type SonareScopeRingBuffer, type SonareScopeRingReadResult, type SonareSpectrumRingBuffer, type SonareSpectrumRingReadResult, type SonareWorkletDestroyMessage, type SonareWorkletMessage, type SonareWorkletMeterSnapshot, SonareWorkletProcessor, type SonareWorkletProcessorOptions, type SonareWorkletScheduleInsertAutomationMessage, type SonareWorkletScopeSnapshot, type SonareWorkletSetMeterIntervalMessage, type SonareWorkletSpectrumSnapshot, type SonareWorkletTransportMessage, StreamingMasteringChain, type StreamingMasteringChainConfig, attachOpfsClipStream, createSonareClipPageRequestRingBuffer, createSonareEngineCommandRingBuffer, createSonareEngineTelemetryRingBuffer, createSonareExternalMidiRingBuffer, createSonareMeterRingBuffer, createSonareScopeRingBuffer, createSonareSpectrumRingBuffer, decodeFrame, encodeFrameHi, encodeFrameLo, init, isInitialized, popSonareEngineCommandRingBuffer, pushSonareClipPageRequestRingBuffer, pushSonareEngineCommandRingBuffer, pushSonareExternalMidiRingBuffer, readSonareClipPageRequestRingBuffer, readSonareEngineTelemetryRingBuffer, readSonareExternalMidiRingBuffer, readSonareMeterRingBuffer, readSonareScopeRingBuffer, readSonareSpectrumRingBuffer, registerSonareRealtimeEngineWorkletProcessor, registerSonareRealtimeVoiceChangerWorkletProcessor, registerSonareWorkletProcessor, sonareClipPageRequestRingBufferByteLength, sonareEngineCommandRingBufferByteLength, sonareEngineTelemetryRingBufferByteLength, sonareExternalMidiRingBufferByteLength, sonareMeterRingBufferByteLength, sonareScopeRingBufferByteLength, sonareSpectrumRingBufferByteLength, writeSonareEngineTelemetryRingBuffer };
|