@libraz/libsonare 1.3.2 → 1.4.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 +45 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +403 -70
- package/dist/index.js.map +1 -1
- package/dist/sonare-rt-module.js +2 -2
- package/dist/sonare-rt.js +2 -2
- package/dist/sonare-rt.wasm +0 -0
- package/dist/sonare.js +2 -2
- package/dist/sonare.wasm +0 -0
- package/dist/worklet.d.ts +907 -144
- package/dist/worklet.js +1803 -207
- package/dist/worklet.js.map +1 -1
- package/package.json +1 -1
- package/src/codes.ts +6 -1
- package/src/effects_mastering.ts +103 -1
- package/src/feature_music.ts +18 -4
- package/src/feature_spectral.ts +7 -1
- package/src/index.ts +27 -1
- package/src/mixer.ts +9 -0
- package/src/module_state.ts +82 -17
- package/src/opfs_clip_pages.ts +43 -9
- package/src/project.ts +74 -0
- package/src/public_types.ts +52 -0
- package/src/realtime_engine.ts +313 -109
- package/src/sonare.js.d.ts +140 -0
- package/src/stream_types.ts +7 -0
- package/src/validation.ts +7 -0
- package/src/web_midi.ts +15 -11
- package/src/worklet/audio_types.ts +2 -0
- package/src/worklet/guards.ts +146 -0
- package/src/worklet/messages.ts +461 -0
- package/src/worklet/protocol.ts +767 -0
- package/src/worklet.ts +1659 -888
package/dist/worklet.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { ProgressCallback, WasmNnlsChromaResult, WasmFourierTempogramResult, WasmCyclicTempogramResult, WasmFrameResult, WasmTempogramResult, WasmTrimResult, WasmDecomposeResult, WasmHpssWithResidualResult, WasmLufsResult, WasmMatrix2dResult, WasmEngineAutomationPoint, WasmEngineBounceOptions, WasmEngineBounceResult, WasmEngineCaptureStatus, WasmEngineClip, WasmEngineFreezeOptions, WasmEngineFreezeResult, WasmEngineGraphSpec, WasmEngineMarker, WasmEngineMeterTelemetry, WasmEngineMetronomeConfig, WasmEngineParameterInfo, WasmEngineTelemetry, WasmEngineTransportState, WasmClipPageRequest, WasmEngineProcessWithMonitorResult } from './sonare.js';
|
|
1
|
+
import { ProgressCallback, WasmNnlsChromaResult, WasmFourierTempogramResult, WasmCyclicTempogramResult, WasmFrameResult, WasmTempogramResult, WasmTrimResult, WasmDecomposeResult, WasmHpssWithResidualResult, WasmLufsResult, WasmMatrix2dResult, WasmEngineAutomationPoint, WasmEngineBounceOptions, WasmEngineBounceResult, WasmEngineCaptureStatus, WasmEngineClip, WasmEngineFreezeOptions, WasmEngineFreezeResult, WasmEngineGraphSpec, WasmEngineMarker, WasmEngineMeterTelemetry, WasmEngineMeterTelemetryWide, WasmEngineMetronomeConfig, WasmEngineParameterInfo, WasmEngineScopeTelemetry, WasmEngineTelemetry, WasmEngineTempoSegment, WasmEngineTimeSignatureSegment, WasmEngineTransportState, WasmClipPageRequest, WasmEngineProcessWithMonitorResult, SonareModule } from './sonare.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Per-call validation options accepted by guarded wrappers. Empty-buffer
|
|
5
5
|
* checks are always performed; pass `{ validate: false }` to opt out of the
|
|
6
6
|
* O(n) NaN/Inf scan on hot paths.
|
|
7
|
+
*
|
|
8
|
+
* `{ validate: false }` only skips this JS-side pre-scan (which raises a
|
|
9
|
+
* `RangeError` naming the exact offending index). It is NOT a way to push
|
|
10
|
+
* non-finite samples into the core: the native layer always re-validates the
|
|
11
|
+
* buffer (see `validate_offline_audio_input` in the C++ core), matching the C
|
|
12
|
+
* ABI / Node / Python surfaces, so an NaN/Inf buffer still throws — just with a
|
|
13
|
+
* generic native message instead of the indexed JS one.
|
|
7
14
|
*/
|
|
8
15
|
interface ValidateOptions {
|
|
9
16
|
validate?: boolean;
|
|
@@ -227,6 +234,36 @@ interface NoteStretchOptions {
|
|
|
227
234
|
/** Stretch ratio (0.5 = double duration, 2.0 = half duration). Default 1. */
|
|
228
235
|
stretchRatio?: number;
|
|
229
236
|
}
|
|
237
|
+
/** How a `spectralEdit` region op modifies the masked bins. */
|
|
238
|
+
type SpectralEditMode = 'gain' | 'attenuate' | 'mute' | 'heal';
|
|
239
|
+
/** Analysis/synthesis window used by `spectralEdit`. */
|
|
240
|
+
type SpectralEditWindow = 'hann' | 'hamming' | 'blackman' | 'rectangular';
|
|
241
|
+
/** One time x frequency rectangle edit op for `spectralEdit`. */
|
|
242
|
+
interface SpectralRegionOp {
|
|
243
|
+
/** Region time start (input samples); clamped to [0, length]. Default 0. */
|
|
244
|
+
startSample?: number;
|
|
245
|
+
/** Region time end, exclusive (input samples); clamped to [0, length]. Default = signal length. */
|
|
246
|
+
endSample?: number;
|
|
247
|
+
/** Region frequency low edge in Hz; clamped to [0, nyquist]. Default 0. */
|
|
248
|
+
lowHz?: number;
|
|
249
|
+
/** Region frequency high edge in Hz; <=0 or >= nyquist means nyquist. Default 0. */
|
|
250
|
+
highHz?: number;
|
|
251
|
+
/** Linear gain in dB for 'gain'/'attenuate'; ignored by 'mute'/'heal'. Default 0. */
|
|
252
|
+
gainDb?: number;
|
|
253
|
+
/** Edit mode. Default 'gain'. */
|
|
254
|
+
mode?: SpectralEditMode;
|
|
255
|
+
}
|
|
256
|
+
/** STFT + heal parameters for `spectralEdit`. All fields are optional. */
|
|
257
|
+
interface SpectralEditOptions {
|
|
258
|
+
/** FFT size; must be a power of two (>= 2). Default 2048. */
|
|
259
|
+
nFft?: number;
|
|
260
|
+
/** Hop length; must satisfy 0 < hop <= nFft/2. Default 512. */
|
|
261
|
+
hopLength?: number;
|
|
262
|
+
/** Analysis + synthesis window. Default 'hann'. */
|
|
263
|
+
window?: SpectralEditWindow;
|
|
264
|
+
/** Neighbour frames each side used by 'heal' (>= 1). Default 2. */
|
|
265
|
+
healRadiusFrames?: number;
|
|
266
|
+
}
|
|
230
267
|
/**
|
|
231
268
|
* Detected beat
|
|
232
269
|
*/
|
|
@@ -490,6 +527,23 @@ interface MasteringResult {
|
|
|
490
527
|
}
|
|
491
528
|
type MasteringProcessorParams = Record<string, number | boolean>;
|
|
492
529
|
type PanMode = 'balance' | 'stereoPan' | 'stereo-pan' | 'dualPan' | 'dual-pan' | number;
|
|
530
|
+
/**
|
|
531
|
+
* Surround pan position for a strip feeding a >2-channel bus. Phase 1 honors
|
|
532
|
+
* `azimuth`/`divergence`/`lfe`; `elevation`/`distance` are reserved. All fields
|
|
533
|
+
* are optional and default to a centered point source.
|
|
534
|
+
*/
|
|
535
|
+
interface SurroundPan {
|
|
536
|
+
/** -180..180 deg, 0 = front-center, positive = right. */
|
|
537
|
+
azimuth?: number;
|
|
538
|
+
/** Reserved (no height beds in phase 1). */
|
|
539
|
+
elevation?: number;
|
|
540
|
+
/** 0 = point source, 1 = spread across the front. */
|
|
541
|
+
divergence?: number;
|
|
542
|
+
/** 0..1 scalar send into the LFE plane. */
|
|
543
|
+
lfe?: number;
|
|
544
|
+
/** Reserved (focus/spread), defaults to 1. */
|
|
545
|
+
distance?: number;
|
|
546
|
+
}
|
|
493
547
|
interface MixOptions {
|
|
494
548
|
inputTrimDb?: number | number[];
|
|
495
549
|
faderDb?: number | number[];
|
|
@@ -1079,6 +1133,21 @@ declare function voiceChangeRealtime(samples: Float32Array, options?: VoiceChang
|
|
|
1079
1133
|
* @returns Normalized audio
|
|
1080
1134
|
*/
|
|
1081
1135
|
declare function normalize(samples: Float32Array, sampleRate: number, targetDb?: number, options?: ValidateOptions): Float32Array;
|
|
1136
|
+
/**
|
|
1137
|
+
* Apply region-based spectral edits (gain/attenuate/mute/heal) to mono audio.
|
|
1138
|
+
*
|
|
1139
|
+
* Each op is a time x frequency rectangle applied in array order over a single
|
|
1140
|
+
* STFT buffer, so a later op observes the result of earlier ops. The output has
|
|
1141
|
+
* the same length and sample rate as the input; an empty `ops` list is an
|
|
1142
|
+
* identity transform (within the iSTFT's own tolerance).
|
|
1143
|
+
*
|
|
1144
|
+
* @param samples - Audio samples (mono, float32)
|
|
1145
|
+
* @param sampleRate - Sample rate in Hz
|
|
1146
|
+
* @param ops - Region edit ops applied in order ({@link SpectralRegionOp})
|
|
1147
|
+
* @param options - STFT + heal configuration ({@link SpectralEditOptions})
|
|
1148
|
+
* @returns Edited audio
|
|
1149
|
+
*/
|
|
1150
|
+
declare function spectralEdit(samples: Float32Array, sampleRate: number, ops?: SpectralRegionOp[], options?: SpectralEditOptions & ValidateOptions): Float32Array;
|
|
1082
1151
|
/**
|
|
1083
1152
|
* Apply mastering loudness normalization with a true-peak ceiling.
|
|
1084
1153
|
*
|
|
@@ -1106,6 +1175,62 @@ declare function masteringInsertNames(): string[];
|
|
|
1106
1175
|
* @param name - Insert processor name (see {@link masteringInsertNames}).
|
|
1107
1176
|
*/
|
|
1108
1177
|
declare function masteringInsertParamNames(name: string): string[];
|
|
1178
|
+
/** One realtime-automatable parameter of an insert processor. */
|
|
1179
|
+
interface MasteringInsertParamInfo {
|
|
1180
|
+
/** JSON-key parameter name, as used in scene insert params. */
|
|
1181
|
+
name: string;
|
|
1182
|
+
/** Integer param id for realtime automation lanes / MIDI-CC binding. */
|
|
1183
|
+
id: number;
|
|
1184
|
+
/** Whether the param can be changed live from the audio thread. */
|
|
1185
|
+
rtSafe: boolean;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Returns the realtime-automatable parameter descriptors for an insert / FX
|
|
1189
|
+
* processor: each entry maps a JSON-key parameter name to the integer id used by
|
|
1190
|
+
* realtime automation and reports whether it is realtime-safe. Unlike
|
|
1191
|
+
* {@link masteringInsertParamNames} (every construction key), this lists only the
|
|
1192
|
+
* realtime-controllable subset — the keys accepted by
|
|
1193
|
+
* {@link RealtimeEngine.setTrackStripInsertParamByName}. Returns an empty array
|
|
1194
|
+
* for an unknown name or a processor with no automatable parameters.
|
|
1195
|
+
*
|
|
1196
|
+
* @param name - Insert processor name (see {@link masteringInsertNames}).
|
|
1197
|
+
*/
|
|
1198
|
+
declare function masteringInsertParamInfo(name: string): MasteringInsertParamInfo[];
|
|
1199
|
+
/**
|
|
1200
|
+
* How a processor handles a buffer with more than two channels (a surround
|
|
1201
|
+
* bed). "multichannel" processes every plane in one call; "stereoPairOnly"
|
|
1202
|
+
* operates on the front L/R pair and passes any surround planes through dry.
|
|
1203
|
+
* "perChannel"/"passthrough" are reserved and unused by the current catalog.
|
|
1204
|
+
*/
|
|
1205
|
+
type MasteringChannelPolicy = 'multichannel' | 'stereoPairOnly' | 'perChannel' | 'passthrough';
|
|
1206
|
+
/** One processor's realtime/offline/pair classification in the catalog. */
|
|
1207
|
+
interface MasteringProcessorCatalogEntry {
|
|
1208
|
+
/** Processor id (the name used for scene inserts / named processors). */
|
|
1209
|
+
id: string;
|
|
1210
|
+
/**
|
|
1211
|
+
* Primary classification, by precedence pair > realtime > offline: "pair" for
|
|
1212
|
+
* two-input match.* processors, "realtime" for ids that build as a realtime
|
|
1213
|
+
* scene insert, "offline" for whole-file-only processors.
|
|
1214
|
+
*/
|
|
1215
|
+
kind: 'realtime' | 'offline' | 'pair';
|
|
1216
|
+
/** True exactly for ids that always succeed as a realtime scene insert. */
|
|
1217
|
+
realtimeInsertable: boolean;
|
|
1218
|
+
/** True for processors with no mono implementation (stereo-only). */
|
|
1219
|
+
stereoOnly: boolean;
|
|
1220
|
+
/**
|
|
1221
|
+
* How the mixer wraps the processor on a >2-channel (surround) bus insert:
|
|
1222
|
+
* "multichannel" (one full-buffer call) or "stereoPairOnly" (front L/R pair,
|
|
1223
|
+
* surround planes passed through dry).
|
|
1224
|
+
*/
|
|
1225
|
+
channelPolicy: MasteringChannelPolicy;
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Returns the machine-readable classification catalog for every named processor
|
|
1229
|
+
* id, merging the offline registry, the realtime insert factory, and the pair
|
|
1230
|
+
* registry. Lets a host filter a processor picker by realtime insertability
|
|
1231
|
+
* instead of offering ids the realtime strip would reject.
|
|
1232
|
+
*/
|
|
1233
|
+
declare function masteringProcessorCatalog(): MasteringProcessorCatalogEntry[];
|
|
1109
1234
|
declare function masteringPairProcessorNames(): PairProcessor[];
|
|
1110
1235
|
declare function masteringPairAnalysisNames(): PairAnalysis[];
|
|
1111
1236
|
declare function masteringStereoAnalysisNames(): StereoAnalysis[];
|
|
@@ -1670,7 +1795,9 @@ declare function tempogramRatio(tempogramData: Float32Array, winLength?: number,
|
|
|
1670
1795
|
* Measure loudness (EBU R128 / ITU-R BS.1770).
|
|
1671
1796
|
*
|
|
1672
1797
|
* @param samples - Audio samples (mono, float32)
|
|
1673
|
-
* @param sampleRate - Sample rate in Hz
|
|
1798
|
+
* @param sampleRate - Sample rate in Hz. The default (22050) is non-standard for
|
|
1799
|
+
* audio; pass the buffer's actual rate, as K-weighting is sample-rate
|
|
1800
|
+
* dependent and a wrong rate yields wrong loudness.
|
|
1674
1801
|
* @returns Loudness measurement result
|
|
1675
1802
|
*/
|
|
1676
1803
|
declare function lufs(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): LufsResult;
|
|
@@ -1678,7 +1805,8 @@ declare function lufs(samples: Float32Array, sampleRate?: number, options?: Vali
|
|
|
1678
1805
|
* Compute the momentary loudness (LUFS) over time.
|
|
1679
1806
|
*
|
|
1680
1807
|
* @param samples - Audio samples (mono, float32)
|
|
1681
|
-
* @param sampleRate - Sample rate in Hz
|
|
1808
|
+
* @param sampleRate - Sample rate in Hz. The default (22050) is non-standard and
|
|
1809
|
+
* K-weighting is sample-rate dependent; pass the buffer's actual rate.
|
|
1682
1810
|
* @returns Momentary LUFS values over time
|
|
1683
1811
|
*/
|
|
1684
1812
|
declare function momentaryLufs(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): Float32Array;
|
|
@@ -1686,7 +1814,8 @@ declare function momentaryLufs(samples: Float32Array, sampleRate?: number, optio
|
|
|
1686
1814
|
* Compute the short-term loudness (LUFS) over time.
|
|
1687
1815
|
*
|
|
1688
1816
|
* @param samples - Audio samples (mono, float32)
|
|
1689
|
-
* @param sampleRate - Sample rate in Hz
|
|
1817
|
+
* @param sampleRate - Sample rate in Hz. The default (22050) is non-standard and
|
|
1818
|
+
* K-weighting is sample-rate dependent; pass the buffer's actual rate.
|
|
1690
1819
|
* @returns Short-term LUFS values over time
|
|
1691
1820
|
*/
|
|
1692
1821
|
declare function shortTermLufs(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): Float32Array;
|
|
@@ -1883,10 +2012,16 @@ declare function hpssWithResidual(samples: Float32Array, sampleRate?: number, ke
|
|
|
1883
2012
|
* Channel-weighted multichannel integrated loudness + LRA (ITU-R BS.1770 /
|
|
1884
2013
|
* EBU R128) from an interleaved buffer of `frames * channels` samples. The
|
|
1885
2014
|
* per-channel frame count is derived from the buffer length and `channels`.
|
|
2015
|
+
*
|
|
2016
|
+
* Pass the buffer's actual `sampleRate`: the default (22050) is non-standard for
|
|
2017
|
+
* audio, and K-weighting is sample-rate dependent, so a wrong rate yields wrong
|
|
2018
|
+
* loudness.
|
|
1886
2019
|
*/
|
|
1887
2020
|
declare function lufsInterleaved(samples: Float32Array, channels: number, sampleRate?: number, options?: ValidateOptions): WasmLufsResult;
|
|
1888
2021
|
/**
|
|
1889
|
-
* Standards-compliant EBU R128 loudness range (LRA) in LU.
|
|
2022
|
+
* Standards-compliant EBU R128 loudness range (LRA) in LU. Pass the buffer's
|
|
2023
|
+
* actual `sampleRate`: the default (22050) is non-standard and K-weighting is
|
|
2024
|
+
* sample-rate dependent.
|
|
1890
2025
|
*/
|
|
1891
2026
|
declare function ebur128LoudnessRange(samples: Float32Array, sampleRate?: number): number;
|
|
1892
2027
|
/**
|
|
@@ -2097,6 +2232,9 @@ declare function mfccToAudio(mfccCoefficients: Float32Array, nMfcc: number, nFra
|
|
|
2097
2232
|
*/
|
|
2098
2233
|
declare function chroma(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, options?: GuardedOptions$1): ChromaResult;
|
|
2099
2234
|
|
|
2235
|
+
type WorkletInput = readonly (readonly Float32Array[])[];
|
|
2236
|
+
type WorkletOutput = Float32Array[][];
|
|
2237
|
+
|
|
2100
2238
|
interface SonareRtModule {
|
|
2101
2239
|
_malloc(size: number): number;
|
|
2102
2240
|
_free(ptr: number): void;
|
|
@@ -2154,133 +2292,31 @@ interface SonareRtModule {
|
|
|
2154
2292
|
): number;
|
|
2155
2293
|
}
|
|
2156
2294
|
|
|
2157
|
-
interface SonareWorkletProcessorOptions {
|
|
2158
|
-
sceneJson: string;
|
|
2159
|
-
sampleRate?: number;
|
|
2160
|
-
blockSize?: number;
|
|
2161
|
-
stripCount?: number;
|
|
2162
|
-
meterIntervalFrames?: number;
|
|
2163
|
-
meterSharedBuffer?: SharedArrayBuffer;
|
|
2164
|
-
meterRingCapacity?: number;
|
|
2165
|
-
spectrumIntervalFrames?: number;
|
|
2166
|
-
spectrumBands?: number;
|
|
2167
|
-
spectrumSharedBuffer?: SharedArrayBuffer;
|
|
2168
|
-
spectrumRingCapacity?: number;
|
|
2169
|
-
}
|
|
2170
|
-
interface SonareRealtimeEngineWorkletProcessorOptions {
|
|
2171
|
-
runtimeTarget?: 'embind' | 'sonare-rt';
|
|
2172
|
-
rtModuleUrl?: string;
|
|
2173
|
-
rtWasmBinary?: ArrayBuffer | Uint8Array;
|
|
2174
|
-
sampleRate?: number;
|
|
2175
|
-
blockSize?: number;
|
|
2176
|
-
channelCount?: number;
|
|
2177
|
-
meterIntervalFrames?: number;
|
|
2178
|
-
commandSharedBuffer?: SharedArrayBuffer;
|
|
2179
|
-
commandRingCapacity?: number;
|
|
2180
|
-
telemetrySharedBuffer?: SharedArrayBuffer;
|
|
2181
|
-
telemetryRingCapacity?: number;
|
|
2182
|
-
meterSharedBuffer?: SharedArrayBuffer;
|
|
2183
|
-
meterRingCapacity?: number;
|
|
2184
|
-
}
|
|
2185
|
-
interface SonareRealtimeVoiceChangerWorkletProcessorOptions {
|
|
2186
|
-
preset?: RealtimeVoiceChangerConfigInput;
|
|
2187
|
-
sampleRate?: number;
|
|
2188
|
-
blockSize?: number;
|
|
2189
|
-
channelCount?: number;
|
|
2190
|
-
}
|
|
2191
|
-
interface SonareRealtimeVoiceChangerSetConfigMessage {
|
|
2192
|
-
type: 'setConfig';
|
|
2193
|
-
preset: RealtimeVoiceChangerConfigInput;
|
|
2194
|
-
}
|
|
2195
|
-
interface SonareRealtimeVoiceChangerResetMessage {
|
|
2196
|
-
type: 'reset';
|
|
2197
|
-
}
|
|
2198
|
-
interface SonareRealtimeVoiceChangerDestroyMessage {
|
|
2199
|
-
type: 'destroy';
|
|
2200
|
-
}
|
|
2201
|
-
type SonareRealtimeVoiceChangerMessage = SonareRealtimeVoiceChangerSetConfigMessage | SonareRealtimeVoiceChangerResetMessage | SonareRealtimeVoiceChangerDestroyMessage;
|
|
2202
|
-
interface SonareRealtimeEngineNodeCapabilities {
|
|
2203
|
-
mode: 'sab' | 'postMessage';
|
|
2204
|
-
runtimeTarget: 'embind' | 'sonare-rt';
|
|
2205
|
-
sharedArrayBuffer: boolean;
|
|
2206
|
-
atomics: boolean;
|
|
2207
|
-
audioWorklet: boolean;
|
|
2208
|
-
engineAbiVersion?: number;
|
|
2209
|
-
expectedEngineAbiVersion?: number;
|
|
2210
|
-
abiCompatible?: boolean;
|
|
2211
|
-
degradedReason?: string;
|
|
2212
|
-
}
|
|
2213
|
-
interface SonareRealtimeEngineNodeOptions extends SonareRealtimeEngineWorkletProcessorOptions {
|
|
2214
|
-
processorName?: string;
|
|
2215
|
-
moduleUrl?: string | URL;
|
|
2216
|
-
rtModuleUrl?: string;
|
|
2217
|
-
mode?: 'auto' | 'sab' | 'postMessage';
|
|
2218
|
-
engineAbiVersion?: number;
|
|
2219
|
-
expectedEngineAbiVersion?: number;
|
|
2220
|
-
requireAbiCompatible?: boolean;
|
|
2221
|
-
nodeFactory?: (context: BaseAudioContext, processorName: string, options: AudioWorkletNodeOptions) => AudioWorkletNode;
|
|
2222
|
-
}
|
|
2223
|
-
interface SonareRtRealtimeEngineRuntimeOptions {
|
|
2224
|
-
module: SonareRtModule;
|
|
2225
|
-
memory: WebAssembly.Memory;
|
|
2226
|
-
sampleRate?: number;
|
|
2227
|
-
blockSize?: number;
|
|
2228
|
-
channelCount?: number;
|
|
2229
|
-
commandSharedBuffer?: SharedArrayBuffer;
|
|
2230
|
-
commandRingCapacity?: number;
|
|
2231
|
-
telemetrySharedBuffer?: SharedArrayBuffer;
|
|
2232
|
-
telemetryRingCapacity?: number;
|
|
2233
|
-
}
|
|
2234
|
-
interface SonareEngineOptions extends SonareRealtimeEngineNodeOptions {
|
|
2235
|
-
offlineEngine?: RealtimeEngine;
|
|
2236
|
-
offlineBlockSize?: number;
|
|
2237
|
-
offlineChannelCount?: number;
|
|
2238
|
-
}
|
|
2239
|
-
interface SonareEngineTransportFacade {
|
|
2240
|
-
play(sampleTime?: number): boolean;
|
|
2241
|
-
stop(sampleTime?: number): boolean;
|
|
2242
|
-
seekPpq(ppq: number, sampleTime?: number): boolean;
|
|
2243
|
-
seekSeconds(seconds: number, sampleTime?: number): boolean;
|
|
2244
|
-
setTempo(bpm: number): void;
|
|
2245
|
-
setLoop(startPpq: number, endPpq: number, enabled?: boolean): boolean;
|
|
2246
|
-
}
|
|
2247
|
-
type WorkletInput = readonly (readonly Float32Array[])[];
|
|
2248
|
-
type WorkletOutput = Float32Array[][];
|
|
2249
|
-
interface SonareWorkletScheduleInsertAutomationMessage {
|
|
2250
|
-
type: 'scheduleInsertAutomation';
|
|
2251
|
-
stripIndex: number;
|
|
2252
|
-
insertIndex: number;
|
|
2253
|
-
paramId: number;
|
|
2254
|
-
value: number;
|
|
2255
|
-
samplePos?: number;
|
|
2256
|
-
curve?: AutomationCurve;
|
|
2257
|
-
}
|
|
2258
|
-
interface SonareWorkletSetMeterIntervalMessage {
|
|
2259
|
-
type: 'setMeterInterval';
|
|
2260
|
-
frames: number;
|
|
2261
|
-
}
|
|
2262
|
-
interface SonareWorkletDestroyMessage {
|
|
2263
|
-
type: 'destroy';
|
|
2264
|
-
}
|
|
2265
|
-
type SonareWorkletMessage = SonareWorkletScheduleInsertAutomationMessage | SonareWorkletSetMeterIntervalMessage | SonareWorkletDestroyMessage;
|
|
2266
2295
|
interface SonareWorkletMeterSnapshot {
|
|
2267
2296
|
type: 'meter';
|
|
2297
|
+
targetId: number;
|
|
2268
2298
|
frame: number;
|
|
2269
2299
|
peakDbL: number;
|
|
2270
2300
|
peakDbR: number;
|
|
2271
2301
|
rmsDbL: number;
|
|
2272
2302
|
rmsDbR: number;
|
|
2273
2303
|
correlation: number;
|
|
2304
|
+
truePeakDbL: number;
|
|
2305
|
+
truePeakDbR: number;
|
|
2306
|
+
momentaryLufs: number;
|
|
2307
|
+
shortTermLufs: number;
|
|
2308
|
+
integratedLufs: number;
|
|
2309
|
+
gainReductionDb: number;
|
|
2274
2310
|
}
|
|
2275
2311
|
interface SonareWorkletSpectrumSnapshot {
|
|
2276
2312
|
type: 'spectrum';
|
|
2277
2313
|
frame: number;
|
|
2278
2314
|
bands: Float32Array;
|
|
2279
2315
|
}
|
|
2280
|
-
type SonareWorkletTransportMessage = SonareWorkletMeterSnapshot | SonareWorkletSpectrumSnapshot | SonareEngineTelemetryRecord;
|
|
2281
2316
|
declare const SONARE_METER_RING_HEADER_INTS = 4;
|
|
2282
|
-
declare const SONARE_METER_RING_RECORD_FLOATS =
|
|
2317
|
+
declare const SONARE_METER_RING_RECORD_FLOATS = 14;
|
|
2283
2318
|
declare const SONARE_SPECTRUM_RING_HEADER_INTS = 5;
|
|
2319
|
+
declare const SONARE_SCOPE_RING_HEADER_INTS = 6;
|
|
2284
2320
|
/** Low 24 bits of a frame index (exact in Float32). */
|
|
2285
2321
|
declare function encodeFrameLo(frame: number): number;
|
|
2286
2322
|
/** High bits of a frame index above 2^24 (exact in Float32 up to ~2^48). */
|
|
@@ -2330,11 +2366,6 @@ declare enum SonareEngineTelemetryError {
|
|
|
2330
2366
|
StaleAutomationLanes = 12,
|
|
2331
2367
|
SmoothedParameterCapacity = 13
|
|
2332
2368
|
}
|
|
2333
|
-
interface WorkletTransport {
|
|
2334
|
-
postMessage?: (message: SonareWorkletTransportMessage) => void;
|
|
2335
|
-
onMeter?: (meter: SonareWorkletMeterSnapshot) => void;
|
|
2336
|
-
onSpectrum?: (spectrum: SonareWorkletSpectrumSnapshot) => void;
|
|
2337
|
-
}
|
|
2338
2369
|
interface SonareMeterRingBuffer {
|
|
2339
2370
|
sharedBuffer: SharedArrayBuffer;
|
|
2340
2371
|
header: Int32Array;
|
|
@@ -2356,6 +2387,34 @@ interface SonareSpectrumRingReadResult {
|
|
|
2356
2387
|
nextReadIndex: number;
|
|
2357
2388
|
spectra: SonareWorkletSpectrumSnapshot[];
|
|
2358
2389
|
}
|
|
2390
|
+
/**
|
|
2391
|
+
* A single target-addressed scope record drained from the realtime engine's
|
|
2392
|
+
* scope ring: an FFT magnitude spectrum plus a decimated goniometer/vectorscope
|
|
2393
|
+
* point cloud. Unlike {@link SonareWorkletSpectrumSnapshot} (the legacy
|
|
2394
|
+
* coarse-DFT meter spectrum), this carries a `targetId` (master/lane/bus) and a
|
|
2395
|
+
* stereo point cloud, mirroring the engine's `ScopeTelemetryRecord`.
|
|
2396
|
+
*/
|
|
2397
|
+
interface SonareWorkletScopeSnapshot {
|
|
2398
|
+
type: 'scope';
|
|
2399
|
+
targetId: number;
|
|
2400
|
+
frame: number;
|
|
2401
|
+
/** Linear-band magnitudes in dB (length = the configured band count). */
|
|
2402
|
+
bands: Float32Array;
|
|
2403
|
+
/** Interleaved stereo goniometer points: [l0, r0, l1, r1, ...]. */
|
|
2404
|
+
points: Float32Array;
|
|
2405
|
+
}
|
|
2406
|
+
interface SonareScopeRingBuffer {
|
|
2407
|
+
sharedBuffer: SharedArrayBuffer;
|
|
2408
|
+
header: Int32Array;
|
|
2409
|
+
records: Float32Array;
|
|
2410
|
+
capacity: number;
|
|
2411
|
+
bands: number;
|
|
2412
|
+
maxPoints: number;
|
|
2413
|
+
}
|
|
2414
|
+
interface SonareScopeRingReadResult {
|
|
2415
|
+
nextReadIndex: number;
|
|
2416
|
+
scopes: SonareWorkletScopeSnapshot[];
|
|
2417
|
+
}
|
|
2359
2418
|
interface SonareEngineCommandRecord {
|
|
2360
2419
|
type: SonareEngineCommandType | number;
|
|
2361
2420
|
targetId?: number;
|
|
@@ -2363,24 +2422,6 @@ interface SonareEngineCommandRecord {
|
|
|
2363
2422
|
argFloat?: number;
|
|
2364
2423
|
argInt?: number | bigint;
|
|
2365
2424
|
}
|
|
2366
|
-
interface SonareEngineSyncClipsMessage {
|
|
2367
|
-
type: 'syncClips';
|
|
2368
|
-
clips: EngineClip[];
|
|
2369
|
-
}
|
|
2370
|
-
interface SonareEngineSyncMarkersMessage {
|
|
2371
|
-
type: 'syncMarkers';
|
|
2372
|
-
markers: EngineMarker[];
|
|
2373
|
-
}
|
|
2374
|
-
interface SonareEngineSyncMetronomeMessage {
|
|
2375
|
-
type: 'syncMetronome';
|
|
2376
|
-
config: EngineMetronomeConfig;
|
|
2377
|
-
}
|
|
2378
|
-
interface SonareEngineSyncAutomationMessage {
|
|
2379
|
-
type: 'syncAutomation';
|
|
2380
|
-
paramId: number;
|
|
2381
|
-
points: EngineAutomationPoint[];
|
|
2382
|
-
}
|
|
2383
|
-
type SonareEngineSyncMessage = SonareEngineSyncClipsMessage | SonareEngineSyncMarkersMessage | SonareEngineSyncMetronomeMessage | SonareEngineSyncAutomationMessage;
|
|
2384
2425
|
interface SonareEngineTelemetryRecord {
|
|
2385
2426
|
type: SonareEngineTelemetryType | number;
|
|
2386
2427
|
error: SonareEngineTelemetryError | number;
|
|
@@ -2412,6 +2453,9 @@ declare function readSonareMeterRingBuffer(ring: SonareMeterRingBuffer, readInde
|
|
|
2412
2453
|
declare function sonareSpectrumRingBufferByteLength(capacity: number, bands?: number): number;
|
|
2413
2454
|
declare function createSonareSpectrumRingBuffer(capacity?: number, bands?: number): SonareSpectrumRingBuffer;
|
|
2414
2455
|
declare function readSonareSpectrumRingBuffer(ring: SonareSpectrumRingBuffer, readIndex?: number): SonareSpectrumRingReadResult;
|
|
2456
|
+
declare function sonareScopeRingBufferByteLength(capacity: number, bands?: number, maxPoints?: number): number;
|
|
2457
|
+
declare function createSonareScopeRingBuffer(capacity?: number, bands?: number, maxPoints?: number): SonareScopeRingBuffer;
|
|
2458
|
+
declare function readSonareScopeRingBuffer(ring: SonareScopeRingBuffer, readIndex?: number): SonareScopeRingReadResult;
|
|
2415
2459
|
declare function sonareEngineCommandRingBufferByteLength(capacity: number): number;
|
|
2416
2460
|
declare function sonareEngineTelemetryRingBufferByteLength(capacity: number): number;
|
|
2417
2461
|
declare function createSonareEngineCommandRingBuffer(capacity?: number): SonareEngineCommandRingBuffer;
|
|
@@ -2420,6 +2464,343 @@ declare function pushSonareEngineCommandRingBuffer(ring: SonareEngineCommandRing
|
|
|
2420
2464
|
declare function popSonareEngineCommandRingBuffer(ring: SonareEngineCommandRingBuffer): SonareEngineCommandRecord | null;
|
|
2421
2465
|
declare function writeSonareEngineTelemetryRingBuffer(ring: SonareEngineTelemetryRingBuffer, telemetry: SonareEngineTelemetryRecord): void;
|
|
2422
2466
|
declare function readSonareEngineTelemetryRingBuffer(ring: SonareEngineTelemetryRingBuffer, readIndex?: number): SonareEngineTelemetryRingReadResult;
|
|
2467
|
+
|
|
2468
|
+
interface SonareWorkletProcessorOptions {
|
|
2469
|
+
sceneJson: string;
|
|
2470
|
+
sampleRate?: number;
|
|
2471
|
+
blockSize?: number;
|
|
2472
|
+
stripCount?: number;
|
|
2473
|
+
meterIntervalFrames?: number;
|
|
2474
|
+
meterSharedBuffer?: SharedArrayBuffer;
|
|
2475
|
+
meterRingCapacity?: number;
|
|
2476
|
+
spectrumIntervalFrames?: number;
|
|
2477
|
+
spectrumBands?: number;
|
|
2478
|
+
spectrumSharedBuffer?: SharedArrayBuffer;
|
|
2479
|
+
spectrumRingCapacity?: number;
|
|
2480
|
+
}
|
|
2481
|
+
interface SonareRealtimeEngineWorkletProcessorOptions {
|
|
2482
|
+
runtimeTarget?: 'embind' | 'sonare-rt';
|
|
2483
|
+
rtModuleUrl?: string;
|
|
2484
|
+
rtWasmBinary?: ArrayBuffer | Uint8Array;
|
|
2485
|
+
wasmBinary?: ArrayBuffer | Uint8Array;
|
|
2486
|
+
initialSyncMessages?: SonareEngineSyncMessage[];
|
|
2487
|
+
initialCommands?: SonareEngineCommandRecord[];
|
|
2488
|
+
sampleRate?: number;
|
|
2489
|
+
blockSize?: number;
|
|
2490
|
+
channelCount?: number;
|
|
2491
|
+
meterIntervalFrames?: number;
|
|
2492
|
+
commandSharedBuffer?: SharedArrayBuffer;
|
|
2493
|
+
commandRingCapacity?: number;
|
|
2494
|
+
telemetrySharedBuffer?: SharedArrayBuffer;
|
|
2495
|
+
telemetryRingCapacity?: number;
|
|
2496
|
+
meterSharedBuffer?: SharedArrayBuffer;
|
|
2497
|
+
meterRingCapacity?: number;
|
|
2498
|
+
scopeIntervalFrames?: number;
|
|
2499
|
+
scopeBands?: number;
|
|
2500
|
+
scopeSharedBuffer?: SharedArrayBuffer;
|
|
2501
|
+
scopeRingCapacity?: number;
|
|
2502
|
+
}
|
|
2503
|
+
interface SonareRealtimeVoiceChangerWorkletProcessorOptions {
|
|
2504
|
+
preset?: RealtimeVoiceChangerConfigInput;
|
|
2505
|
+
sampleRate?: number;
|
|
2506
|
+
blockSize?: number;
|
|
2507
|
+
channelCount?: number;
|
|
2508
|
+
}
|
|
2509
|
+
interface SonareRealtimeVoiceChangerSetConfigMessage {
|
|
2510
|
+
type: 'setConfig';
|
|
2511
|
+
preset: RealtimeVoiceChangerConfigInput;
|
|
2512
|
+
}
|
|
2513
|
+
interface SonareRealtimeVoiceChangerResetMessage {
|
|
2514
|
+
type: 'reset';
|
|
2515
|
+
}
|
|
2516
|
+
interface SonareRealtimeVoiceChangerDestroyMessage {
|
|
2517
|
+
type: 'destroy';
|
|
2518
|
+
}
|
|
2519
|
+
type SonareRealtimeVoiceChangerMessage = SonareRealtimeVoiceChangerSetConfigMessage | SonareRealtimeVoiceChangerResetMessage | SonareRealtimeVoiceChangerDestroyMessage;
|
|
2520
|
+
interface SonareRealtimeEngineNodeCapabilities {
|
|
2521
|
+
mode: 'sab' | 'postMessage';
|
|
2522
|
+
runtimeTarget: 'embind' | 'sonare-rt';
|
|
2523
|
+
sharedArrayBuffer: boolean;
|
|
2524
|
+
atomics: boolean;
|
|
2525
|
+
audioWorklet: boolean;
|
|
2526
|
+
engineAbiVersion?: number;
|
|
2527
|
+
expectedEngineAbiVersion?: number;
|
|
2528
|
+
abiCompatible?: boolean;
|
|
2529
|
+
degradedReason?: string;
|
|
2530
|
+
readyMessage?: boolean;
|
|
2531
|
+
}
|
|
2532
|
+
interface SonareRealtimeEngineNodeOptions extends SonareRealtimeEngineWorkletProcessorOptions {
|
|
2533
|
+
processorName?: string;
|
|
2534
|
+
moduleUrl?: string | URL;
|
|
2535
|
+
rtModuleUrl?: string;
|
|
2536
|
+
mode?: 'auto' | 'sab' | 'postMessage';
|
|
2537
|
+
engineAbiVersion?: number;
|
|
2538
|
+
expectedEngineAbiVersion?: number;
|
|
2539
|
+
requireAbiCompatible?: boolean;
|
|
2540
|
+
nodeFactory?: (context: BaseAudioContext, processorName: string, options: AudioWorkletNodeOptions) => AudioWorkletNode;
|
|
2541
|
+
}
|
|
2542
|
+
interface SonareRtRealtimeEngineRuntimeOptions {
|
|
2543
|
+
module: SonareRtModule;
|
|
2544
|
+
memory: WebAssembly.Memory;
|
|
2545
|
+
sampleRate?: number;
|
|
2546
|
+
blockSize?: number;
|
|
2547
|
+
channelCount?: number;
|
|
2548
|
+
commandSharedBuffer?: SharedArrayBuffer;
|
|
2549
|
+
commandRingCapacity?: number;
|
|
2550
|
+
telemetrySharedBuffer?: SharedArrayBuffer;
|
|
2551
|
+
telemetryRingCapacity?: number;
|
|
2552
|
+
}
|
|
2553
|
+
interface SonareEngineTransportFacade {
|
|
2554
|
+
play(sampleTime?: number): boolean;
|
|
2555
|
+
stop(sampleTime?: number): boolean;
|
|
2556
|
+
seekPpq(ppq: number, sampleTime?: number): boolean;
|
|
2557
|
+
seekSeconds(seconds: number, sampleTime?: number): boolean;
|
|
2558
|
+
setTempo(bpm: number): void;
|
|
2559
|
+
setTempoSegments(segments: readonly EngineTempoSegment[]): void;
|
|
2560
|
+
setLoop(startPpq: number, endPpq: number, enabled?: boolean): boolean;
|
|
2561
|
+
}
|
|
2562
|
+
interface SonareWorkletScheduleInsertAutomationMessage {
|
|
2563
|
+
type: 'scheduleInsertAutomation';
|
|
2564
|
+
stripIndex: number;
|
|
2565
|
+
insertIndex: number;
|
|
2566
|
+
paramId: number;
|
|
2567
|
+
value: number;
|
|
2568
|
+
samplePos?: number;
|
|
2569
|
+
curve?: AutomationCurve;
|
|
2570
|
+
}
|
|
2571
|
+
interface SonareWorkletSetMeterIntervalMessage {
|
|
2572
|
+
type: 'setMeterInterval';
|
|
2573
|
+
frames: number;
|
|
2574
|
+
}
|
|
2575
|
+
interface SonareWorkletDestroyMessage {
|
|
2576
|
+
type: 'destroy';
|
|
2577
|
+
}
|
|
2578
|
+
type SonareWorkletMessage = SonareWorkletScheduleInsertAutomationMessage | SonareWorkletSetMeterIntervalMessage | SonareWorkletDestroyMessage;
|
|
2579
|
+
type SonareWorkletTransportMessage = SonareWorkletMeterSnapshot | SonareWorkletSpectrumSnapshot | SonareEngineTelemetryRecord;
|
|
2580
|
+
interface WorkletTransport {
|
|
2581
|
+
postMessage?: (message: SonareWorkletTransportMessage | SonareEngineCaptureResponseMessage | SonareEngineTransportResponseMessage, transfer?: Transferable[]) => void;
|
|
2582
|
+
onMeter?: (meter: SonareWorkletMeterSnapshot) => void;
|
|
2583
|
+
onSpectrum?: (spectrum: SonareWorkletSpectrumSnapshot) => void;
|
|
2584
|
+
}
|
|
2585
|
+
interface SonareEngineSyncClipsMessage {
|
|
2586
|
+
type: 'syncClips';
|
|
2587
|
+
clips: EngineClip[];
|
|
2588
|
+
}
|
|
2589
|
+
interface SonareEngineSyncClipsDeltaMessage {
|
|
2590
|
+
type: 'syncClipsDelta';
|
|
2591
|
+
upserts: EngineClip[];
|
|
2592
|
+
removeIds: number[];
|
|
2593
|
+
}
|
|
2594
|
+
interface SonareEngineSyncMidiClipsMessage {
|
|
2595
|
+
type: 'syncMidiClips';
|
|
2596
|
+
clips: EngineMidiClipSchedule[];
|
|
2597
|
+
}
|
|
2598
|
+
interface SonareEngineSyncMarkersMessage {
|
|
2599
|
+
type: 'syncMarkers';
|
|
2600
|
+
markers: EngineMarker[];
|
|
2601
|
+
}
|
|
2602
|
+
interface SonareEngineSyncMetronomeMessage {
|
|
2603
|
+
type: 'syncMetronome';
|
|
2604
|
+
config: EngineMetronomeConfig;
|
|
2605
|
+
}
|
|
2606
|
+
interface SonareEngineSyncAutomationMessage {
|
|
2607
|
+
type: 'syncAutomation';
|
|
2608
|
+
paramId: number;
|
|
2609
|
+
points: EngineAutomationPoint[];
|
|
2610
|
+
}
|
|
2611
|
+
interface SonareEngineSyncTempoMessage {
|
|
2612
|
+
type: 'syncTempo';
|
|
2613
|
+
bpm: number;
|
|
2614
|
+
timeSignature: {
|
|
2615
|
+
numerator: number;
|
|
2616
|
+
denominator: number;
|
|
2617
|
+
};
|
|
2618
|
+
tempoSegments?: EngineTempoSegment[];
|
|
2619
|
+
timeSignatureSegments?: EngineTimeSignatureSegment[];
|
|
2620
|
+
}
|
|
2621
|
+
interface SonareEngineSyncMixerMessage {
|
|
2622
|
+
type: 'syncMixer';
|
|
2623
|
+
lanes: EngineTrackLane[];
|
|
2624
|
+
buses?: EngineBus[];
|
|
2625
|
+
trackStrips?: Array<{
|
|
2626
|
+
trackId: number;
|
|
2627
|
+
sceneJson: string;
|
|
2628
|
+
}>;
|
|
2629
|
+
busStrips?: Array<{
|
|
2630
|
+
busId: number;
|
|
2631
|
+
sceneJson: string;
|
|
2632
|
+
}>;
|
|
2633
|
+
masterStripJson?: string;
|
|
2634
|
+
/** Lane insert sidechain bindings (replayed after lanes/strips). */
|
|
2635
|
+
laneSidechains?: Array<{
|
|
2636
|
+
trackId: number;
|
|
2637
|
+
insertIndex: number;
|
|
2638
|
+
sourceTrackId: number;
|
|
2639
|
+
}>;
|
|
2640
|
+
}
|
|
2641
|
+
interface SonareEngineSyncCaptureMessage {
|
|
2642
|
+
type: 'syncCapture';
|
|
2643
|
+
bufferFrames: number;
|
|
2644
|
+
channels: number;
|
|
2645
|
+
source: EngineCaptureStatus['source'];
|
|
2646
|
+
recordOffsetSamples: number;
|
|
2647
|
+
inputMonitor: {
|
|
2648
|
+
enabled: boolean;
|
|
2649
|
+
gain: number;
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
interface SonareEngineSyncTrackStripEqBandMessage {
|
|
2653
|
+
type: 'syncTrackStripEqBand';
|
|
2654
|
+
trackId: number;
|
|
2655
|
+
bandIndex: number;
|
|
2656
|
+
bandJson: string;
|
|
2657
|
+
}
|
|
2658
|
+
interface SonareEngineSyncMasterStripEqBandMessage {
|
|
2659
|
+
type: 'syncMasterStripEqBand';
|
|
2660
|
+
bandIndex: number;
|
|
2661
|
+
bandJson: string;
|
|
2662
|
+
}
|
|
2663
|
+
interface SonareEngineSyncTrackStripInsertBypassedMessage {
|
|
2664
|
+
type: 'syncTrackStripInsertBypassed';
|
|
2665
|
+
trackId: number;
|
|
2666
|
+
insertIndex: number;
|
|
2667
|
+
bypassed: boolean;
|
|
2668
|
+
resetOnBypass: boolean;
|
|
2669
|
+
}
|
|
2670
|
+
interface SonareEngineSyncMasterStripInsertBypassedMessage {
|
|
2671
|
+
type: 'syncMasterStripInsertBypassed';
|
|
2672
|
+
insertIndex: number;
|
|
2673
|
+
bypassed: boolean;
|
|
2674
|
+
resetOnBypass: boolean;
|
|
2675
|
+
}
|
|
2676
|
+
interface SonareEngineSyncTrackStripInsertParamByNameMessage {
|
|
2677
|
+
type: 'syncTrackStripInsertParamByName';
|
|
2678
|
+
trackId: number;
|
|
2679
|
+
insertIndex: number;
|
|
2680
|
+
paramName: string;
|
|
2681
|
+
value: number;
|
|
2682
|
+
}
|
|
2683
|
+
interface SonareEngineSyncMasterStripInsertParamByNameMessage {
|
|
2684
|
+
type: 'syncMasterStripInsertParamByName';
|
|
2685
|
+
insertIndex: number;
|
|
2686
|
+
paramName: string;
|
|
2687
|
+
value: number;
|
|
2688
|
+
}
|
|
2689
|
+
interface SonareEngineSyncTrackStripPanMessage {
|
|
2690
|
+
type: 'syncTrackStripPan';
|
|
2691
|
+
trackId: number;
|
|
2692
|
+
pan: number;
|
|
2693
|
+
}
|
|
2694
|
+
interface SonareEngineSyncTrackStripPanLawMessage {
|
|
2695
|
+
type: 'syncTrackStripPanLaw';
|
|
2696
|
+
trackId: number;
|
|
2697
|
+
panLaw: number;
|
|
2698
|
+
}
|
|
2699
|
+
interface SonareEngineSyncTrackStripPanModeMessage {
|
|
2700
|
+
type: 'syncTrackStripPanMode';
|
|
2701
|
+
trackId: number;
|
|
2702
|
+
panMode: number;
|
|
2703
|
+
}
|
|
2704
|
+
interface SonareEngineSyncTrackStripDualPanMessage {
|
|
2705
|
+
type: 'syncTrackStripDualPan';
|
|
2706
|
+
trackId: number;
|
|
2707
|
+
leftPan: number;
|
|
2708
|
+
rightPan: number;
|
|
2709
|
+
}
|
|
2710
|
+
interface SonareEngineSyncTrackStripChannelDelaySamplesMessage {
|
|
2711
|
+
type: 'syncTrackStripChannelDelaySamples';
|
|
2712
|
+
trackId: number;
|
|
2713
|
+
delaySamples: number;
|
|
2714
|
+
}
|
|
2715
|
+
interface SonareEngineSyncBuiltinInstrumentMessage {
|
|
2716
|
+
type: 'syncBuiltinInstrument';
|
|
2717
|
+
destinationId: number;
|
|
2718
|
+
config: {
|
|
2719
|
+
destinationId?: number;
|
|
2720
|
+
} & Record<string, unknown>;
|
|
2721
|
+
}
|
|
2722
|
+
interface SonareEngineSyncSynthInstrumentMessage {
|
|
2723
|
+
type: 'syncSynthInstrument';
|
|
2724
|
+
destinationId: number;
|
|
2725
|
+
patch: Record<string, unknown> | string;
|
|
2726
|
+
}
|
|
2727
|
+
interface SonareEngineSyncSf2InstrumentMessage {
|
|
2728
|
+
type: 'syncSf2Instrument';
|
|
2729
|
+
destinationId: number;
|
|
2730
|
+
config: {
|
|
2731
|
+
destinationId?: number;
|
|
2732
|
+
gain?: number;
|
|
2733
|
+
polyphony?: number;
|
|
2734
|
+
};
|
|
2735
|
+
}
|
|
2736
|
+
interface SonareEngineSyncLoadSoundFontMessage {
|
|
2737
|
+
type: 'syncLoadSoundFont';
|
|
2738
|
+
data: Uint8Array;
|
|
2739
|
+
}
|
|
2740
|
+
interface SonareEngineSyncMidiNoteMessage {
|
|
2741
|
+
type: 'syncMidiNoteOn' | 'syncMidiNoteOff';
|
|
2742
|
+
destinationId: number;
|
|
2743
|
+
group: number;
|
|
2744
|
+
channel: number;
|
|
2745
|
+
note: number;
|
|
2746
|
+
velocity: number;
|
|
2747
|
+
renderFrame: number;
|
|
2748
|
+
}
|
|
2749
|
+
interface SonareEngineSyncMidiCcMessage {
|
|
2750
|
+
type: 'syncMidiCc';
|
|
2751
|
+
destinationId: number;
|
|
2752
|
+
group: number;
|
|
2753
|
+
channel: number;
|
|
2754
|
+
controller: number;
|
|
2755
|
+
value: number;
|
|
2756
|
+
renderFrame: number;
|
|
2757
|
+
}
|
|
2758
|
+
interface SonareEngineSyncMidiPanicMessage {
|
|
2759
|
+
type: 'syncMidiPanic';
|
|
2760
|
+
renderFrame: number;
|
|
2761
|
+
}
|
|
2762
|
+
type SonareEngineSyncMessage = SonareEngineSyncClipsMessage | SonareEngineSyncClipsDeltaMessage | SonareEngineSyncMidiClipsMessage | SonareEngineSyncMarkersMessage | SonareEngineSyncMetronomeMessage | SonareEngineSyncAutomationMessage | SonareEngineSyncTempoMessage | SonareEngineSyncMixerMessage | SonareEngineSyncCaptureMessage | SonareEngineSyncTrackStripEqBandMessage | SonareEngineSyncMasterStripEqBandMessage | SonareEngineSyncTrackStripInsertBypassedMessage | SonareEngineSyncMasterStripInsertBypassedMessage | SonareEngineSyncTrackStripInsertParamByNameMessage | SonareEngineSyncMasterStripInsertParamByNameMessage | SonareEngineSyncTrackStripPanMessage | SonareEngineSyncTrackStripPanLawMessage | SonareEngineSyncTrackStripPanModeMessage | SonareEngineSyncTrackStripDualPanMessage | SonareEngineSyncTrackStripChannelDelaySamplesMessage | SonareEngineSyncBuiltinInstrumentMessage | SonareEngineSyncSynthInstrumentMessage | SonareEngineSyncSf2InstrumentMessage | SonareEngineSyncLoadSoundFontMessage | SonareEngineSyncMidiNoteMessage | SonareEngineSyncMidiCcMessage | SonareEngineSyncMidiPanicMessage;
|
|
2763
|
+
interface WorkletPort {
|
|
2764
|
+
postMessage?: (message: unknown, transfer?: Transferable[]) => void;
|
|
2765
|
+
onmessage?: (event: {
|
|
2766
|
+
data: unknown;
|
|
2767
|
+
}) => void;
|
|
2768
|
+
addEventListener?: (type: 'message', listener: (event: {
|
|
2769
|
+
data: unknown;
|
|
2770
|
+
}) => void) => void;
|
|
2771
|
+
start?: () => void;
|
|
2772
|
+
}
|
|
2773
|
+
interface SonareEngineCaptureRequestMessage {
|
|
2774
|
+
type: 'captureRequest';
|
|
2775
|
+
requestId: number;
|
|
2776
|
+
op: 'status' | 'read' | 'reset';
|
|
2777
|
+
}
|
|
2778
|
+
interface SonareEngineCaptureResponseMessage {
|
|
2779
|
+
type: 'captureResponse';
|
|
2780
|
+
requestId: number;
|
|
2781
|
+
ok: boolean;
|
|
2782
|
+
status?: EngineCaptureStatus;
|
|
2783
|
+
channels?: Float32Array[] | number[][];
|
|
2784
|
+
error?: string;
|
|
2785
|
+
}
|
|
2786
|
+
interface SonareEngineTransportRequestMessage {
|
|
2787
|
+
type: 'transportRequest';
|
|
2788
|
+
requestId: number;
|
|
2789
|
+
op: 'state';
|
|
2790
|
+
}
|
|
2791
|
+
interface SonareEngineTransportResponseMessage {
|
|
2792
|
+
type: 'transportResponse';
|
|
2793
|
+
requestId: number;
|
|
2794
|
+
ok: boolean;
|
|
2795
|
+
state?: EngineTransportState;
|
|
2796
|
+
error?: string;
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
interface SonareEngineOptions extends SonareRealtimeEngineNodeOptions {
|
|
2800
|
+
offlineEngine?: RealtimeEngine;
|
|
2801
|
+
offlineBlockSize?: number;
|
|
2802
|
+
offlineChannelCount?: number;
|
|
2803
|
+
}
|
|
2423
2804
|
/**
|
|
2424
2805
|
* AudioWorklet-style mixer bridge backed by the package's single `sonare.wasm`.
|
|
2425
2806
|
*
|
|
@@ -2471,16 +2852,20 @@ declare class SonareRealtimeEngineWorkletProcessor {
|
|
|
2471
2852
|
private commandRing?;
|
|
2472
2853
|
private telemetryRing?;
|
|
2473
2854
|
private meterRing?;
|
|
2855
|
+
private scopeRing?;
|
|
2474
2856
|
private transport?;
|
|
2475
2857
|
private meterIntervalFrames;
|
|
2476
2858
|
private lastMeterFrame;
|
|
2477
2859
|
private metronomeConfig;
|
|
2478
2860
|
private channelBuffers;
|
|
2861
|
+
private readonly liveClips;
|
|
2479
2862
|
constructor(options?: SonareRealtimeEngineWorkletProcessorOptions, transport?: WorkletTransport);
|
|
2480
2863
|
process(inputs: WorkletInput, outputs: WorkletOutput): boolean;
|
|
2481
2864
|
private reacquireChannelBuffers;
|
|
2482
2865
|
receiveCommand(command: SonareEngineCommandRecord): void;
|
|
2483
2866
|
receiveSync(message: SonareEngineSyncMessage): void;
|
|
2867
|
+
receiveCaptureRequest(message: SonareEngineCaptureRequestMessage): void;
|
|
2868
|
+
receiveTransportRequest(message: SonareEngineTransportRequestMessage): void;
|
|
2484
2869
|
destroy(): void;
|
|
2485
2870
|
private drainCommands;
|
|
2486
2871
|
private applyCommand;
|
|
@@ -2488,6 +2873,8 @@ declare class SonareRealtimeEngineWorkletProcessor {
|
|
|
2488
2873
|
private publishTelemetryRecord;
|
|
2489
2874
|
private publishMeters;
|
|
2490
2875
|
private writeMeterRing;
|
|
2876
|
+
private publishScope;
|
|
2877
|
+
private writeScopeRing;
|
|
2491
2878
|
private commandRingFromSharedBuffer;
|
|
2492
2879
|
private telemetryRingFromSharedBuffer;
|
|
2493
2880
|
}
|
|
@@ -2510,6 +2897,8 @@ declare class SonareRtRealtimeEngineRuntime {
|
|
|
2510
2897
|
process(inputs: WorkletInput, outputs: WorkletOutput): boolean;
|
|
2511
2898
|
receiveCommand(command: SonareEngineCommandRecord): void;
|
|
2512
2899
|
receiveSync(message: SonareEngineSyncMessage): void;
|
|
2900
|
+
receiveCaptureRequest(message: SonareEngineCaptureRequestMessage, port?: WorkletPort): void;
|
|
2901
|
+
receiveTransportRequest(message: SonareEngineTransportRequestMessage, port?: WorkletPort): void;
|
|
2513
2902
|
destroy(): void;
|
|
2514
2903
|
private writeChannelPointers;
|
|
2515
2904
|
private drainCommands;
|
|
@@ -2524,11 +2913,18 @@ declare class SonareRealtimeEngineNode {
|
|
|
2524
2913
|
readonly commandRing?: SonareEngineCommandRingBuffer;
|
|
2525
2914
|
readonly telemetryRing?: SonareEngineTelemetryRingBuffer;
|
|
2526
2915
|
readonly meterRing?: SonareMeterRingBuffer;
|
|
2916
|
+
readonly scopeRing?: SonareScopeRingBuffer;
|
|
2527
2917
|
readonly ready: Promise<void>;
|
|
2528
2918
|
private telemetryReadIndex;
|
|
2529
2919
|
private meterReadIndex;
|
|
2920
|
+
private scopeReadIndex;
|
|
2530
2921
|
private telemetryListeners;
|
|
2531
2922
|
private meterListeners;
|
|
2923
|
+
private scopeListeners;
|
|
2924
|
+
private captureRequestId;
|
|
2925
|
+
private readonly captureRequests;
|
|
2926
|
+
private transportRequestId;
|
|
2927
|
+
private readonly transportRequests;
|
|
2532
2928
|
private resolveReady;
|
|
2533
2929
|
private rejectReady;
|
|
2534
2930
|
private destroyed;
|
|
@@ -2539,13 +2935,22 @@ declare class SonareRealtimeEngineNode {
|
|
|
2539
2935
|
seekSample(timelineSample: number, sampleTime?: number): boolean;
|
|
2540
2936
|
seekPpq(ppq: number, sampleTime?: number): boolean;
|
|
2541
2937
|
sendCommand(command: SonareEngineCommandRecord): boolean;
|
|
2938
|
+
requestCaptureStatus(): Promise<EngineCaptureStatus>;
|
|
2939
|
+
requestCapturedAudio(): Promise<Float32Array[]>;
|
|
2940
|
+
requestCaptureReset(): Promise<void>;
|
|
2941
|
+
requestTransportState(): Promise<EngineTransportState>;
|
|
2542
2942
|
pollTelemetry(): SonareEngineTelemetryRecord[];
|
|
2543
2943
|
pollMeters(): SonareWorkletMeterSnapshot[];
|
|
2944
|
+
pollScope(): SonareWorkletScopeSnapshot[];
|
|
2544
2945
|
onTelemetry(callback: (telemetry: SonareEngineTelemetryRecord) => void): () => void;
|
|
2545
2946
|
onMeter(callback: (meter: SonareWorkletMeterSnapshot) => void): () => void;
|
|
2947
|
+
onScope(callback: (scope: SonareWorkletScopeSnapshot) => void): () => void;
|
|
2546
2948
|
destroy(): void;
|
|
2547
2949
|
private emitTelemetry;
|
|
2548
2950
|
private emitMeter;
|
|
2951
|
+
private emitScope;
|
|
2952
|
+
private sendCaptureRequest;
|
|
2953
|
+
private sendTransportRequest;
|
|
2549
2954
|
}
|
|
2550
2955
|
declare class SonareEngine {
|
|
2551
2956
|
readonly node: AudioWorkletNode;
|
|
@@ -2559,41 +2964,207 @@ declare class SonareEngine {
|
|
|
2559
2964
|
private readonly offlineChannelCount;
|
|
2560
2965
|
private readonly automationLanes;
|
|
2561
2966
|
private readonly clips;
|
|
2967
|
+
private readonly midiClips;
|
|
2562
2968
|
private readonly markers;
|
|
2969
|
+
private readonly trackLaneIds;
|
|
2970
|
+
private readonly trackSends;
|
|
2971
|
+
private readonly trackOutputBus;
|
|
2972
|
+
private readonly laneSidechains;
|
|
2973
|
+
private readonly buses;
|
|
2974
|
+
private readonly trackStripJson;
|
|
2975
|
+
private readonly busStripJson;
|
|
2976
|
+
private masterStripJson;
|
|
2977
|
+
private captureConfig;
|
|
2978
|
+
private tempoBpm;
|
|
2979
|
+
private timeSignature;
|
|
2980
|
+
private tempoSegments;
|
|
2981
|
+
private timeSignatureSegments;
|
|
2982
|
+
private latestTransportState;
|
|
2563
2983
|
private nextClipId;
|
|
2564
2984
|
private nextMarkerId;
|
|
2985
|
+
private transportPlaying;
|
|
2986
|
+
private readonly pendingInstrumentSync;
|
|
2565
2987
|
private destroyed;
|
|
2566
2988
|
private constructor();
|
|
2567
2989
|
static create(context: BaseAudioContext, options?: SonareEngineOptions): Promise<SonareEngine>;
|
|
2568
2990
|
suspend(): Promise<void>;
|
|
2569
2991
|
resume(): Promise<void>;
|
|
2570
2992
|
setTempo(bpm: number): void;
|
|
2993
|
+
setTempoSegments(segments: readonly EngineTempoSegment[]): void;
|
|
2994
|
+
setTimeSignature(numerator: number, denominator: number): void;
|
|
2995
|
+
setTimeSignatureSegments(segments: readonly EngineTimeSignatureSegment[]): void;
|
|
2571
2996
|
setLoop(startPpq: number, endPpq: number, enabled?: boolean): boolean;
|
|
2997
|
+
countInEndSample(startSample: number, bars: number): number;
|
|
2998
|
+
getTransportState(): Promise<EngineTransportState>;
|
|
2999
|
+
cachedTransportState(): EngineTransportState | undefined;
|
|
2572
3000
|
setParam(nodeId: string, param: string | number, value: number): boolean;
|
|
2573
3001
|
scheduleParam(nodeId: string, param: string | number, ppq: number, value: number, curve?: number | 'linear' | 'exponential'): void;
|
|
2574
3002
|
addAutomationPoint(laneId: string | number, ppq: number, value: number, curve?: number | 'linear' | 'exponential'): void;
|
|
3003
|
+
/**
|
|
3004
|
+
* Replaces the automation lane for `paramId` with the given breakpoints.
|
|
3005
|
+
*
|
|
3006
|
+
* Unlike scheduleParam (which appends a single point), this sets the whole
|
|
3007
|
+
* lane at once; an empty array clears the lane. The points are defensively
|
|
3008
|
+
* copied and sorted by ppq before being mirrored to the offline engine and
|
|
3009
|
+
* the live worklet engine.
|
|
3010
|
+
*
|
|
3011
|
+
* @param paramId Automation target id (registered parameter or a reserved
|
|
3012
|
+
* engine mixer target from automationParamId/busAutomationParamId).
|
|
3013
|
+
* @param points Lane breakpoints; order does not matter.
|
|
3014
|
+
*/
|
|
3015
|
+
setAutomationLane(paramId: number, points: ReadonlyArray<EngineAutomationPoint>): void;
|
|
3016
|
+
/**
|
|
3017
|
+
* Returns the automation target id for a mixer strip parameter.
|
|
3018
|
+
*
|
|
3019
|
+
* The id addresses the engine's reserved mixer namespace, so it can be fed
|
|
3020
|
+
* straight to setAutomationLane to automate a fader or pan without
|
|
3021
|
+
* registering a parameter.
|
|
3022
|
+
*
|
|
3023
|
+
* @param target Track id (declares a mixer lane on first use) or 'master'.
|
|
3024
|
+
* @param kind Strip parameter to address.
|
|
3025
|
+
* @returns Reserved engine parameter id for the strip parameter.
|
|
3026
|
+
*/
|
|
3027
|
+
automationParamId(target: string | number, kind: 'faderDb' | 'pan'): number;
|
|
3028
|
+
/**
|
|
3029
|
+
* Returns the automation target id for a bus fader.
|
|
3030
|
+
*
|
|
3031
|
+
* @param busId Bus id (declares the mixer bus on first use).
|
|
3032
|
+
* @returns Reserved engine parameter id for the bus fader gain (dB).
|
|
3033
|
+
*/
|
|
3034
|
+
busAutomationParamId(busId: number): number;
|
|
3035
|
+
/**
|
|
3036
|
+
* Returns the number of automation lanes installed on the engine, including
|
|
3037
|
+
* lanes whose breakpoint list is currently empty.
|
|
3038
|
+
*
|
|
3039
|
+
* @returns Engine-side automation lane count.
|
|
3040
|
+
*/
|
|
3041
|
+
automationLaneCount(): number;
|
|
2575
3042
|
listParameters(): EngineParameterInfo[];
|
|
2576
3043
|
setSoloMute(target: string | number, solo: boolean, mute: boolean): boolean;
|
|
3044
|
+
setStripGain(target: string | number, db: number): boolean;
|
|
3045
|
+
setStripPan(target: string | number, pan: number): boolean;
|
|
3046
|
+
/**
|
|
3047
|
+
* Declares the mixer track lanes in an explicit order.
|
|
3048
|
+
*
|
|
3049
|
+
* Lane indices are append-only: once a track id occupies a lane, its index
|
|
3050
|
+
* stays fixed for the engine's lifetime. The given list must therefore start
|
|
3051
|
+
* with the already-declared lane ids in their current order and may only
|
|
3052
|
+
* append new track ids after them. Entries carrying `sends` replace that
|
|
3053
|
+
* track's send list; entries without `sends` leave existing sends untouched.
|
|
3054
|
+
*
|
|
3055
|
+
* @param lanes Track ids or lane descriptors in the desired lane order.
|
|
3056
|
+
*/
|
|
3057
|
+
setTrackLanes(lanes: ReadonlyArray<number | EngineTrackLane>): void;
|
|
3058
|
+
/**
|
|
3059
|
+
* Routes a track lane's post-fader output into a declared bus instead of
|
|
3060
|
+
* the master mix (group/folder routing); busId 0 restores the master mix.
|
|
3061
|
+
*/
|
|
3062
|
+
setTrackOutputBus(target: string | number, busId: number): void;
|
|
3063
|
+
/**
|
|
3064
|
+
* Keys one insert of a lane strip from another lane's post-strip pre-fader
|
|
3065
|
+
* audio (ducking/sidechainRouter inserts). sourceTarget null removes the
|
|
3066
|
+
* binding.
|
|
3067
|
+
*/
|
|
3068
|
+
setLaneSidechain(target: string | number, insertIndex: number, sourceTarget: string | number | null): void;
|
|
3069
|
+
setSends(target: string | number, sends: EngineTrackSend[]): void;
|
|
3070
|
+
setTrackBuses(buses: EngineBus[]): void;
|
|
3071
|
+
setBusGain(busId: number, db: number): boolean;
|
|
3072
|
+
setTrackStripJson(target: string | number, sceneJson: string): void;
|
|
3073
|
+
setTrackStripEqBand(target: string | number, bandIndex: number, band: EqBand | string): void;
|
|
3074
|
+
setTrackStripInsertBypassed(target: string | number, insertIndex: number, bypassed: boolean, resetOnBypass?: boolean): void;
|
|
3075
|
+
setTrackStripInsertParamByName(target: string | number, insertIndex: number, paramName: string, value: number): void;
|
|
3076
|
+
setTrackStripPan(target: string | number, pan: number): void;
|
|
3077
|
+
setTrackStripPanLaw(target: string | number, panLaw: PanLaw | number): void;
|
|
3078
|
+
setTrackStripPanMode(target: string | number, panMode: PanMode | number): void;
|
|
3079
|
+
setTrackStripDualPan(target: string | number, leftPan: number, rightPan: number): void;
|
|
3080
|
+
setTrackStripChannelDelaySamples(target: string | number, delaySamples: number): void;
|
|
3081
|
+
setStripEq(target: string | number, bandIndex: number, band: EqBand | string): void;
|
|
3082
|
+
setStripInsertBypassed(target: string | number, insertIndex: number, bypassed: boolean, resetOnBypass?: boolean): void;
|
|
3083
|
+
setStripInserts(target: string | number, sceneJson: string): void;
|
|
3084
|
+
setBusStripJson(busId: number, sceneJson: string): void;
|
|
3085
|
+
setMasterStripJson(sceneJson: string): void;
|
|
3086
|
+
setMasterStripEqBand(bandIndex: number, band: EqBand | string): void;
|
|
3087
|
+
setMasterStripInsertBypassed(insertIndex: number, bypassed: boolean, resetOnBypass?: boolean): void;
|
|
3088
|
+
setMasterStripInsertParamByName(insertIndex: number, paramName: string, value: number): void;
|
|
3089
|
+
setStripInsertParamByName(target: string | number, insertIndex: number, paramName: string, value: number): void;
|
|
3090
|
+
setMasterChain(sceneJson: string): void;
|
|
2577
3091
|
addClip(trackId: string | number, buffer: Float32Array[], startPpq: number, opts?: Partial<Omit<EngineClip, 'channels' | 'startPpq'>>): number;
|
|
2578
3092
|
removeClip(clipId: number): void;
|
|
3093
|
+
setMidiClips(clips: readonly EngineMidiClipSchedule[]): void;
|
|
3094
|
+
setBuiltinInstrument(trackId: string | number, config?: {
|
|
3095
|
+
destinationId?: number;
|
|
3096
|
+
} & Record<string, unknown>): void;
|
|
3097
|
+
setSynthInstrument(trackId: string | number, patch?: Record<string, unknown> | string): void;
|
|
3098
|
+
loadSoundFont(data: Uint8Array): void;
|
|
3099
|
+
setSf2Instrument(trackId: string | number, config?: {
|
|
3100
|
+
destinationId?: number;
|
|
3101
|
+
gain?: number;
|
|
3102
|
+
polyphony?: number;
|
|
3103
|
+
}): void;
|
|
3104
|
+
pushMidiNoteOn(trackId: string | number, group: number, channel: number, note: number, velocity: number, renderFrame?: number): void;
|
|
3105
|
+
pushMidiNoteOff(trackId: string | number, group: number, channel: number, note: number, velocity?: number, renderFrame?: number): void;
|
|
3106
|
+
pushMidiCc(trackId: string | number, group: number, channel: number, controller: number, value: number, renderFrame?: number): void;
|
|
3107
|
+
pushMidiPanic(renderFrame?: number): void;
|
|
3108
|
+
configureCapture(options: {
|
|
3109
|
+
bufferFrames: number;
|
|
3110
|
+
channels?: number;
|
|
3111
|
+
source?: EngineCaptureStatus['source'];
|
|
3112
|
+
recordOffsetSamples?: number;
|
|
3113
|
+
inputMonitor?: {
|
|
3114
|
+
enabled: boolean;
|
|
3115
|
+
gain?: number;
|
|
3116
|
+
};
|
|
3117
|
+
}): void;
|
|
2579
3118
|
armRecord(trackId: string | number, enabled: boolean): boolean;
|
|
2580
3119
|
punch(inPpq: number, outPpq: number): boolean;
|
|
3120
|
+
captureStatus(): Promise<EngineCaptureStatus>;
|
|
3121
|
+
capturedAudio(): Promise<Float32Array[]>;
|
|
3122
|
+
resetCapture(): Promise<void>;
|
|
2581
3123
|
setMetronome(opts: EngineMetronomeConfig): void;
|
|
2582
3124
|
addMarker(ppq: number, name?: string): number;
|
|
3125
|
+
/**
|
|
3126
|
+
* Replaces the whole marker set in one call.
|
|
3127
|
+
*
|
|
3128
|
+
* Entries without an `id` are assigned fresh ids; entries carrying an `id`
|
|
3129
|
+
* keep it (ids must be positive and unique within the list). Returns the
|
|
3130
|
+
* resolved markers in the order given, so a caller can map its own marker
|
|
3131
|
+
* identities to the engine ids used by `seekMarker`/`setLoopFromMarkers`.
|
|
3132
|
+
*
|
|
3133
|
+
* @param markers The full marker list (an empty list clears all markers).
|
|
3134
|
+
* @returns The markers with their resolved engine ids.
|
|
3135
|
+
*/
|
|
3136
|
+
setMarkers(markers: ReadonlyArray<{
|
|
3137
|
+
ppq: number;
|
|
3138
|
+
name?: string;
|
|
3139
|
+
id?: number;
|
|
3140
|
+
}>): EngineMarker[];
|
|
3141
|
+
markerCount(): number;
|
|
3142
|
+
markerByIndex(index: number): EngineMarker;
|
|
3143
|
+
marker(markerId: number): EngineMarker;
|
|
2583
3144
|
seekMarker(markerId: number): boolean;
|
|
3145
|
+
setLoopFromMarkers(startMarkerId: number, endMarkerId: number): boolean;
|
|
2584
3146
|
renderOffline(totalFrames: number): Promise<Float32Array[]>;
|
|
2585
3147
|
onMeter(callback: (meter: SonareWorkletMeterSnapshot) => void): () => void;
|
|
3148
|
+
onScope(callback: (scope: SonareWorkletScopeSnapshot) => void): () => void;
|
|
2586
3149
|
onTelemetry(callback: (telemetry: SonareEngineTelemetryRecord) => void): () => void;
|
|
2587
3150
|
pollTelemetry(): SonareEngineTelemetryRecord[];
|
|
2588
3151
|
pollMeters(): SonareWorkletMeterSnapshot[];
|
|
3152
|
+
pollScope(): SonareWorkletScopeSnapshot[];
|
|
2589
3153
|
destroy(): void;
|
|
2590
|
-
private
|
|
3154
|
+
private syncClipsDelta;
|
|
3155
|
+
private syncMidiClips;
|
|
3156
|
+
private mixerLanes;
|
|
3157
|
+
private syncMixer;
|
|
2591
3158
|
private syncMarkers;
|
|
3159
|
+
private postInstrumentSync;
|
|
3160
|
+
private flushPendingInstrumentSync;
|
|
3161
|
+
private postTempoSync;
|
|
2592
3162
|
private postSync;
|
|
2593
3163
|
private resolveParamId;
|
|
2594
3164
|
private resolveTargetId;
|
|
3165
|
+
private ensureTrackLane;
|
|
3166
|
+
private ensureBus;
|
|
2595
3167
|
private curveCode;
|
|
2596
|
-
private ppqToApproxSample;
|
|
2597
3168
|
}
|
|
2598
3169
|
declare class SonareRealtimeVoiceChangerWorkletProcessor {
|
|
2599
3170
|
private static warnedMonoOverflow;
|
|
@@ -2829,6 +3400,32 @@ interface ProjectBounceOptions {
|
|
|
2829
3400
|
/** Host-instrument PDC (latency) fed to the compiler. */
|
|
2830
3401
|
instrumentLatencySamples?: number;
|
|
2831
3402
|
}
|
|
3403
|
+
/**
|
|
3404
|
+
* Marker kind ordinals. Mirrors `SonareMarkerKind` in `src/sonare_c_types.h`;
|
|
3405
|
+
* the values are part of the ABI and must not be renumbered.
|
|
3406
|
+
*/
|
|
3407
|
+
declare const MarkerKind: {
|
|
3408
|
+
readonly marker: 0;
|
|
3409
|
+
readonly text: 1;
|
|
3410
|
+
readonly lyric: 2;
|
|
3411
|
+
readonly cuePoint: 3;
|
|
3412
|
+
readonly keySignature: 4;
|
|
3413
|
+
};
|
|
3414
|
+
/** A project timeline marker with its kind and (for key signatures) the key. */
|
|
3415
|
+
interface ProjectMarker {
|
|
3416
|
+
/** Stable marker id (0 when allocating a new id via {@link Project.setMarkerEx}). */
|
|
3417
|
+
id: number;
|
|
3418
|
+
/** Marker position in PPQ (quarter notes). */
|
|
3419
|
+
ppq: number;
|
|
3420
|
+
/** Marker label. */
|
|
3421
|
+
name?: string;
|
|
3422
|
+
/** {@link MarkerKind} ordinal (default 0 = marker). */
|
|
3423
|
+
kind?: number;
|
|
3424
|
+
/** Key signature only: -7..7 (sharps positive). */
|
|
3425
|
+
keyFifths?: number;
|
|
3426
|
+
/** Key signature only: false = major, true = minor. */
|
|
3427
|
+
keyMinor?: boolean;
|
|
3428
|
+
}
|
|
2832
3429
|
/** Oscillator waveform for the built-in synth. */
|
|
2833
3430
|
type BuiltinSynthWaveform = 'sine' | 'saw' | 'sawtooth' | 'square' | 'triangle' | 0 | 1 | 2 | 3;
|
|
2834
3431
|
/**
|
|
@@ -3366,6 +3963,14 @@ declare class Project {
|
|
|
3366
3963
|
* Routes through an undoable edit command.
|
|
3367
3964
|
*/
|
|
3368
3965
|
setTrackMidiDestination(trackId: number, destinationId: number): void;
|
|
3966
|
+
/** Set a track's linear playback gain (1.0 = unity; >= 0) via an undoable edit. */
|
|
3967
|
+
setTrackGain(trackId: number, gain: number): void;
|
|
3968
|
+
/** Set a track's mute flag via an undoable edit (a muted track is silent). */
|
|
3969
|
+
setTrackMute(trackId: number, mute: boolean): void;
|
|
3970
|
+
/** Set a track's solo flag via an undoable edit (when any track is soloed, only soloed tracks sound). */
|
|
3971
|
+
setTrackSolo(trackId: number, solo: boolean): void;
|
|
3972
|
+
/** Set a track's stereo balance in [-1, +1] (0 = center) via an undoable edit. */
|
|
3973
|
+
setTrackPan(trackId: number, pan: number): void;
|
|
3369
3974
|
/** Undo the most recent edit. */
|
|
3370
3975
|
undo(): void;
|
|
3371
3976
|
/** Redo the most recently undone edit. */
|
|
@@ -3547,6 +4152,16 @@ declare class Project {
|
|
|
3547
4152
|
* stable marker id (the allocated id when 0 was passed).
|
|
3548
4153
|
*/
|
|
3549
4154
|
setMarker(markerId: number, ppq: number, name: string): number;
|
|
4155
|
+
/**
|
|
4156
|
+
* Add or replace a marker from a full {@link ProjectMarker}, including its
|
|
4157
|
+
* {@link MarkerKind} and (for key signatures) the key. Pass `id` 0 to allocate
|
|
4158
|
+
* a new id; returns the stable marker id.
|
|
4159
|
+
*/
|
|
4160
|
+
setMarkerEx(marker: ProjectMarker): number;
|
|
4161
|
+
/** Read a project marker by index (0-based, in stored order). */
|
|
4162
|
+
markerByIndex(index: number): ProjectMarker;
|
|
4163
|
+
/** Number of markers in the project. */
|
|
4164
|
+
markerCount(): number;
|
|
3550
4165
|
/** Number of tracks in the project. */
|
|
3551
4166
|
trackCount(): number;
|
|
3552
4167
|
/** Number of audio sources registered on the project. */
|
|
@@ -3585,7 +4200,70 @@ type EngineFreezeOptions = WasmEngineFreezeOptions;
|
|
|
3585
4200
|
type EngineFreezeResult = WasmEngineFreezeResult;
|
|
3586
4201
|
type EngineTelemetry = WasmEngineTelemetry;
|
|
3587
4202
|
type EngineMeterTelemetry = WasmEngineMeterTelemetry;
|
|
4203
|
+
type EngineMeterTelemetryWide = WasmEngineMeterTelemetryWide;
|
|
4204
|
+
type EngineScopeTelemetry = WasmEngineScopeTelemetry;
|
|
3588
4205
|
type EngineTransportState = WasmEngineTransportState;
|
|
4206
|
+
type EngineTempoSegment = WasmEngineTempoSegment;
|
|
4207
|
+
type EngineTimeSignatureSegment = WasmEngineTimeSignatureSegment;
|
|
4208
|
+
interface EngineTrackSend {
|
|
4209
|
+
busId: number;
|
|
4210
|
+
levelDb?: number;
|
|
4211
|
+
enabled?: boolean;
|
|
4212
|
+
/**
|
|
4213
|
+
* Pre/post-fader tap point. Defaults to post-fader when omitted, matching the
|
|
4214
|
+
* historical lane-send behavior and the scene-JSON default.
|
|
4215
|
+
*/
|
|
4216
|
+
sendTiming?: SendTiming | number;
|
|
4217
|
+
}
|
|
4218
|
+
interface EngineTrackLane {
|
|
4219
|
+
trackId: number;
|
|
4220
|
+
sends?: EngineTrackSend[];
|
|
4221
|
+
/**
|
|
4222
|
+
* Bus the lane's post-fader output sums into instead of the master mix
|
|
4223
|
+
* (group/folder routing); 0 or absent keeps the lane on the master mix.
|
|
4224
|
+
*/
|
|
4225
|
+
outputBusId?: number;
|
|
4226
|
+
/**
|
|
4227
|
+
* Input channel layout of the source feeding this lane (`SonareChannelLayout`:
|
|
4228
|
+
* 0 mono, 1 stereo, 2 5.1, 3 7.1). Absent defaults to stereo. Stored but inert
|
|
4229
|
+
* until the surround DSP path lands.
|
|
4230
|
+
*/
|
|
4231
|
+
sourceChannelLayout?: number;
|
|
4232
|
+
}
|
|
4233
|
+
interface EngineBus {
|
|
4234
|
+
busId: number;
|
|
4235
|
+
gainDb?: number;
|
|
4236
|
+
/**
|
|
4237
|
+
* Channel layout of the bus (`SonareChannelLayout`: 0 mono, 1 stereo, 2 5.1,
|
|
4238
|
+
* 3 7.1). A surround layout makes this a surround group bus: lanes routed to
|
|
4239
|
+
* it are surround-panned and it sums into the master plane-by-plane. Defaults
|
|
4240
|
+
* to stereo.
|
|
4241
|
+
*/
|
|
4242
|
+
channelLayout?: number;
|
|
4243
|
+
}
|
|
4244
|
+
interface EngineMidiEvent {
|
|
4245
|
+
renderFrame: number;
|
|
4246
|
+
word0?: number;
|
|
4247
|
+
word1?: number;
|
|
4248
|
+
word2?: number;
|
|
4249
|
+
word3?: number;
|
|
4250
|
+
wordCount?: number;
|
|
4251
|
+
group?: number;
|
|
4252
|
+
sysexHandle?: number;
|
|
4253
|
+
data0?: number;
|
|
4254
|
+
data1?: number;
|
|
4255
|
+
}
|
|
4256
|
+
interface EngineMidiClipSchedule {
|
|
4257
|
+
id?: number;
|
|
4258
|
+
trackId?: number;
|
|
4259
|
+
destinationId?: number;
|
|
4260
|
+
startSample?: number;
|
|
4261
|
+
startPpq?: number;
|
|
4262
|
+
lengthSamples?: number;
|
|
4263
|
+
loop?: boolean;
|
|
4264
|
+
loopLengthSamples?: number;
|
|
4265
|
+
events: EngineMidiEvent[];
|
|
4266
|
+
}
|
|
3589
4267
|
declare const EXPECTED_ENGINE_ABI_VERSION = 3;
|
|
3590
4268
|
/** Options for {@link RealtimeEngine.bindMidiCc}. All fields are optional. */
|
|
3591
4269
|
interface MidiCcBindOptions {
|
|
@@ -3606,13 +4284,14 @@ interface EngineCapabilities {
|
|
|
3606
4284
|
declare function engineCapabilities(): EngineCapabilities;
|
|
3607
4285
|
declare class RealtimeEngine {
|
|
3608
4286
|
private native;
|
|
3609
|
-
private nativeExt;
|
|
3610
4287
|
constructor(sampleRate?: number, maxBlockSize?: number, commandCapacity?: number, telemetryCapacity?: number);
|
|
3611
4288
|
prepare(sampleRate: number, maxBlockSize: number, commandCapacity?: number, telemetryCapacity?: number): void;
|
|
3612
4289
|
/** Queue a sample-accurate parameter change (engine kSetParam). */
|
|
3613
4290
|
setParameter(paramId: number, value: number, renderFrame?: number): void;
|
|
3614
4291
|
/** Queue a smoothed parameter change (engine kSetParamSmoothed). */
|
|
3615
4292
|
setParameterSmoothed(paramId: number, value: number, renderFrame?: number): void;
|
|
4293
|
+
setSoloMute(laneIndex: number, solo: boolean, mute: boolean, renderFrame?: number): void;
|
|
4294
|
+
setMidiClips(clips: readonly EngineMidiClipSchedule[]): void;
|
|
3616
4295
|
setBuiltinInstrument(config?: {
|
|
3617
4296
|
destinationId?: number;
|
|
3618
4297
|
} & Record<string, unknown>, destinationId?: number): void;
|
|
@@ -3691,9 +4370,19 @@ declare class RealtimeEngine {
|
|
|
3691
4370
|
play(renderFrame?: number): void;
|
|
3692
4371
|
stop(renderFrame?: number): void;
|
|
3693
4372
|
seekSample(timelineSample: number, renderFrame?: number): void;
|
|
4373
|
+
/**
|
|
4374
|
+
* Snaps every in-flight parameter ramp (engine-level smoothed params, mixer
|
|
4375
|
+
* lane fader/pan/gate, bus gains) to its target value. Offline renders call
|
|
4376
|
+
* this after a priming process() block so the first audible block renders at
|
|
4377
|
+
* settled values instead of ramping in from defaults.
|
|
4378
|
+
*/
|
|
4379
|
+
settleParameters(): void;
|
|
3694
4380
|
seekPpq(ppq: number, renderFrame?: number): void;
|
|
3695
4381
|
setTempo(bpm: number): void;
|
|
4382
|
+
setTempoSegments(segments: readonly EngineTempoSegment[]): void;
|
|
3696
4383
|
setTimeSignature(numerator: number, denominator: number): void;
|
|
4384
|
+
setTimeSignatureSegments(segments: readonly EngineTimeSignatureSegment[]): void;
|
|
4385
|
+
sampleAtPpq(ppq: number): number;
|
|
3697
4386
|
setLoop(startPpq: number, endPpq: number, enabled?: boolean): void;
|
|
3698
4387
|
addParameter(info: EngineParameterInfo): void;
|
|
3699
4388
|
parameterCount(): number;
|
|
@@ -3715,6 +4404,45 @@ declare class RealtimeEngine {
|
|
|
3715
4404
|
graphConnectionCount(): number;
|
|
3716
4405
|
setClips(clips: EngineClip[]): void;
|
|
3717
4406
|
clipCount(): number;
|
|
4407
|
+
setTrackLanes(lanes: Array<number | EngineTrackLane>): void;
|
|
4408
|
+
/**
|
|
4409
|
+
* Keys one insert of a lane strip from another lane's post-strip audio
|
|
4410
|
+
* (ducking/sidechainRouter inserts). sourceTrackId 0 removes the binding.
|
|
4411
|
+
*/
|
|
4412
|
+
setLaneSidechain(trackId: number, insertIndex: number, sourceTrackId: number): void;
|
|
4413
|
+
setTrackBuses(buses: EngineBus[]): void;
|
|
4414
|
+
setBusStripJson(busId: number, sceneJson: string): void;
|
|
4415
|
+
setTrackStripJson(trackId: number, sceneJson: string): void;
|
|
4416
|
+
setTrackStripEqBand(trackId: number, bandIndex: number, band: EqBand | string): void;
|
|
4417
|
+
setTrackStripEqBandJson(trackId: number, bandIndex: number, bandJson: string): void;
|
|
4418
|
+
setTrackStripInsertBypassed(trackId: number, insertIndex: number, bypassed: boolean, resetOnBypass?: boolean): void;
|
|
4419
|
+
setMasterStripJson(sceneJson: string): void;
|
|
4420
|
+
setMasterStripEqBand(bandIndex: number, band: EqBand | string): void;
|
|
4421
|
+
setMasterStripEqBandJson(bandIndex: number, bandJson: string): void;
|
|
4422
|
+
setMasterStripInsertBypassed(insertIndex: number, bypassed: boolean, resetOnBypass?: boolean): void;
|
|
4423
|
+
/**
|
|
4424
|
+
* Changes one track-strip insert parameter in realtime, addressed by the
|
|
4425
|
+
* processor's JSON-key parameter name (see {@link masteringInsertParamInfo}).
|
|
4426
|
+
* Applied at the next block head via the engine command queue; safe during
|
|
4427
|
+
* playback. Throws if the track, insert, or name is unknown, the param is not
|
|
4428
|
+
* realtime-safe, or the command queue is full.
|
|
4429
|
+
*/
|
|
4430
|
+
setTrackStripInsertParamByName(trackId: number, insertIndex: number, paramName: string, value: number): void;
|
|
4431
|
+
/** Master-strip counterpart of {@link setTrackStripInsertParamByName}. */
|
|
4432
|
+
setMasterStripInsertParamByName(insertIndex: number, paramName: string, value: number): void;
|
|
4433
|
+
/** Sets a track lane strip's pan position in realtime (glitch-free). */
|
|
4434
|
+
setTrackStripPan(trackId: number, pan: number): void;
|
|
4435
|
+
/** Sets a track lane strip's pan law in realtime. */
|
|
4436
|
+
setTrackStripPanLaw(trackId: number, panLaw: PanLaw | number): void;
|
|
4437
|
+
/** Sets a track lane strip's pan mode in realtime. */
|
|
4438
|
+
setTrackStripPanMode(trackId: number, panMode: PanMode | number): void;
|
|
4439
|
+
/** Sets a track lane strip's dual-pan left/right positions in realtime. */
|
|
4440
|
+
setTrackStripDualPan(trackId: number, leftPan: number, rightPan: number): void;
|
|
4441
|
+
/**
|
|
4442
|
+
* Sets a track lane strip's inter-channel alignment delay (whole samples).
|
|
4443
|
+
* Adjusts strip latency, so PDC and reported graph latency are refreshed.
|
|
4444
|
+
*/
|
|
4445
|
+
setTrackStripChannelDelaySamples(trackId: number, delaySamples: number): void;
|
|
3718
4446
|
createClipPageProvider(numChannels: number, numSamples: number, pageFrames: number): ClipPageProvider;
|
|
3719
4447
|
supplyClipPage(providerId: number, pageIndex: number, channels: Float32Array[]): void;
|
|
3720
4448
|
clearClipPage(providerId: number, pageIndex: number): void;
|
|
@@ -3755,6 +4483,24 @@ declare class RealtimeEngine {
|
|
|
3755
4483
|
freezeOffline(options: EngineFreezeOptions): EngineFreezeResult;
|
|
3756
4484
|
drainTelemetry(maxRecords?: number): EngineTelemetry[];
|
|
3757
4485
|
drainMeterTelemetry(maxRecords?: number): EngineMeterTelemetry[];
|
|
4486
|
+
/**
|
|
4487
|
+
* Drains pending meter telemetry as per-plane (wide) records for a surround
|
|
4488
|
+
* target. Use this for a surround mix target; {@link drainMeterTelemetry}
|
|
4489
|
+
* stays the stereo fast path. The two share one queue — call only one per
|
|
4490
|
+
* target. The live AudioWorklet path owns the queue via the stereo drain, so
|
|
4491
|
+
* this wide drain is for an offline (non-worklet) engine instance; per-plane
|
|
4492
|
+
* surround meters are not delivered over the live worklet meter ring.
|
|
4493
|
+
*/
|
|
4494
|
+
drainMeterTelemetryWide(maxRecords?: number): EngineMeterTelemetryWide[];
|
|
4495
|
+
/**
|
|
4496
|
+
* Enables per-target spectrum + vectorscope capture. @param intervalFrames is
|
|
4497
|
+
* the minimum render-frame gap between snapshots (0 disables). @param bandCount
|
|
4498
|
+
* is the FFT band resolution (1..64); changing it re-prepares the tap. Returns
|
|
4499
|
+
* the band count actually applied.
|
|
4500
|
+
*/
|
|
4501
|
+
configureScopeTelemetry(intervalFrames: number, bandCount: number): number;
|
|
4502
|
+
/** Drains pending spectrum + vectorscope snapshots (per mix target). */
|
|
4503
|
+
drainScopeTelemetry(maxRecords?: number): EngineScopeTelemetry[];
|
|
3758
4504
|
destroy(): void;
|
|
3759
4505
|
}
|
|
3760
4506
|
declare class ClipPageProvider {
|
|
@@ -3782,7 +4528,7 @@ interface OpfsClipPageProviderBinding {
|
|
|
3782
4528
|
supplyRequest(request: ClipPageRequest): Promise<boolean>;
|
|
3783
4529
|
close(): void;
|
|
3784
4530
|
}
|
|
3785
|
-
declare const opfsClipPageWorkerSource = "\nself.onmessage = async (event) => {\n const message = event.data;\n if (!message || message.type !== 'sonare:read-clip-page') return;\n const { requestId, path, pageIndex, numChannels, numSamples, pageFrames, dataOffsetBytes = 0 } = message;\n try {\n if (pageIndex < 0) {\n self.postMessage({ type: 'sonare:clip-page', requestId, pageIndex, ok: false });\n return;\n }\n const startFrame = pageIndex * pageFrames;\n if (startFrame >= numSamples) {\n self.postMessage({ type: 'sonare:clip-page', requestId, pageIndex, ok: false });\n return;\n }\n const root = await self.navigator.storage.getDirectory();\n let dir = root;\n const parts = String(path).split('/').filter(Boolean);\n for (let i = 0; i < parts.length - 1; ++i) {\n dir = await dir.getDirectoryHandle(parts[i]);\n }\n const fileHandle = await dir.getFileHandle(parts[parts.length - 1]);\n const access = await fileHandle.createSyncAccessHandle();\n try {\n const frames = Math.min(pageFrames, numSamples - startFrame);\n const frameBytes = numChannels * 4;\n const bytes = new Uint8Array(frames * frameBytes);\n let bytesReadTotal = 0;\n const readOffset = dataOffsetBytes + startFrame * frameBytes;\n while (bytesReadTotal < bytes.byteLength) {\n const bytesRead = access.read(bytes.subarray(bytesReadTotal), {\n at: readOffset + bytesReadTotal,\n });\n if (bytesRead <= 0) {\n break;\n }\n bytesReadTotal += bytesRead;\n }\n if (bytesReadTotal !== bytes.byteLength || bytesReadTotal % frameBytes !== 0) {\n self.postMessage({ type: 'sonare:clip-page', requestId, pageIndex, ok: false });\n return;\n }\n const framesRead = bytesReadTotal / frameBytes;\n const view = new DataView(bytes.buffer, 0, framesRead * frameBytes);\n const channelBuffers = Array.from({ length: numChannels }, () => new ArrayBuffer(framesRead * 4));\n for (let ch = 0; ch < numChannels; ++ch) {\n const channel = new Float32Array(channelBuffers[ch]);\n for (let frame = 0; frame < framesRead; ++frame) {\n channel[frame] = view.getFloat32((frame * numChannels + ch) * 4, true);\n }\n }\n self.postMessage(\n { type: 'sonare:clip-page', requestId, pageIndex, ok: true, frames: framesRead, channelBuffers },\n channelBuffers,\n );\n } finally {\n access.close();\n }\n } catch (error) {\n self.postMessage({\n type: 'sonare:clip-page',\n requestId,\n pageIndex,\n ok: false,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n};\n";
|
|
4531
|
+
declare const opfsClipPageWorkerSource = "\nconst sonareClipPageReadQueues = new Map();\n\nfunction sonareEnqueueClipPageRead(key, task) {\n const previous = sonareClipPageReadQueues.get(key) || Promise.resolve();\n const next = previous.catch(() => undefined).then(task);\n const queued = next.finally(() => {\n if (sonareClipPageReadQueues.get(key) === queued) {\n sonareClipPageReadQueues.delete(key);\n }\n });\n sonareClipPageReadQueues.set(key, queued);\n return next;\n}\n\nself.onmessage = async (event) => {\n const message = event.data;\n if (!message || message.type !== 'sonare:read-clip-page') return;\n const { requestId, path, pageIndex, numChannels, numSamples, pageFrames, dataOffsetBytes = 0 } = message;\n await sonareEnqueueClipPageRead(String(path), async () => {\n try {\n if (pageIndex < 0) {\n self.postMessage({ type: 'sonare:clip-page', requestId, pageIndex, ok: false });\n return;\n }\n const startFrame = pageIndex * pageFrames;\n if (startFrame >= numSamples) {\n self.postMessage({ type: 'sonare:clip-page', requestId, pageIndex, ok: false });\n return;\n }\n const root = await self.navigator.storage.getDirectory();\n let dir = root;\n const parts = String(path).split('/').filter(Boolean);\n for (let i = 0; i < parts.length - 1; ++i) {\n dir = await dir.getDirectoryHandle(parts[i]);\n }\n const fileHandle = await dir.getFileHandle(parts[parts.length - 1]);\n const access = await fileHandle.createSyncAccessHandle();\n try {\n const frames = Math.min(pageFrames, numSamples - startFrame);\n const frameBytes = numChannels * 4;\n const bytes = new Uint8Array(frames * frameBytes);\n let bytesReadTotal = 0;\n const readOffset = dataOffsetBytes + startFrame * frameBytes;\n while (bytesReadTotal < bytes.byteLength) {\n const bytesRead = access.read(bytes.subarray(bytesReadTotal), {\n at: readOffset + bytesReadTotal,\n });\n if (bytesRead <= 0) {\n break;\n }\n bytesReadTotal += bytesRead;\n }\n if (bytesReadTotal !== bytes.byteLength || bytesReadTotal % frameBytes !== 0) {\n self.postMessage({ type: 'sonare:clip-page', requestId, pageIndex, ok: false });\n return;\n }\n const framesRead = bytesReadTotal / frameBytes;\n const view = new DataView(bytes.buffer, 0, framesRead * frameBytes);\n const channelBuffers = Array.from({ length: numChannels }, () => new ArrayBuffer(framesRead * 4));\n for (let ch = 0; ch < numChannels; ++ch) {\n const channel = new Float32Array(channelBuffers[ch]);\n for (let frame = 0; frame < framesRead; ++frame) {\n channel[frame] = view.getFloat32((frame * numChannels + ch) * 4, true);\n }\n }\n self.postMessage(\n { type: 'sonare:clip-page', requestId, pageIndex, ok: true, frames: framesRead, channelBuffers },\n channelBuffers,\n );\n } finally {\n access.close();\n }\n } catch (error) {\n self.postMessage({\n type: 'sonare:clip-page',\n requestId,\n pageIndex,\n ok: false,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n });\n};\n";
|
|
3786
4532
|
declare function createOpfsClipPageWorker(): Worker;
|
|
3787
4533
|
declare function createOpfsClipPageProvider(engine: RealtimeEngine, options: OpfsClipPageProviderOptions): OpfsClipPageProviderBinding;
|
|
3788
4534
|
|
|
@@ -4045,6 +4791,11 @@ interface FrameBuffer {
|
|
|
4045
4791
|
/** Number of mel bands; flat `mel` is `[nFrames * nMels]` row-major. */
|
|
4046
4792
|
nMels: number;
|
|
4047
4793
|
timestamps: Float32Array;
|
|
4794
|
+
/**
|
|
4795
|
+
* Mel spectrogram in LINEAR power (not dB) — the raw per-frame mel energies.
|
|
4796
|
+
* The quantized read paths (`readFramesU8` / `readFramesI16`) convert to dB
|
|
4797
|
+
* before packing, so their `mel` is dB-scaled; this float buffer is not.
|
|
4798
|
+
*/
|
|
4048
4799
|
mel: Float32Array;
|
|
4049
4800
|
chroma: Float32Array;
|
|
4050
4801
|
onsetStrength: Float32Array;
|
|
@@ -4077,6 +4828,7 @@ interface StreamFramesU8 {
|
|
|
4077
4828
|
nFrames: number;
|
|
4078
4829
|
nMels: number;
|
|
4079
4830
|
timestamps: Float32Array;
|
|
4831
|
+
/** Row-major `[nFrames * nMels]` mel in dB, quantized over `[melDbMin, melDbMax]`. */
|
|
4080
4832
|
mel: Uint8Array;
|
|
4081
4833
|
chroma: Uint8Array;
|
|
4082
4834
|
onsetStrength: Uint8Array;
|
|
@@ -4088,6 +4840,7 @@ interface StreamFramesI16 {
|
|
|
4088
4840
|
nFrames: number;
|
|
4089
4841
|
nMels: number;
|
|
4090
4842
|
timestamps: Float32Array;
|
|
4843
|
+
/** Row-major `[nFrames * nMels]` mel in dB, quantized over `[melDbMin, melDbMax]`. */
|
|
4091
4844
|
mel: Int16Array;
|
|
4092
4845
|
chroma: Int16Array;
|
|
4093
4846
|
onsetStrength: Int16Array;
|
|
@@ -4413,6 +5166,11 @@ declare class Mixer {
|
|
|
4413
5166
|
setVcaOffsetDb(stripIndex: number, offsetDb: number): void;
|
|
4414
5167
|
/** Set independent left/right pan positions (dual-pan mode). */
|
|
4415
5168
|
setDualPan(stripIndex: number, leftPan: number, rightPan: number): void;
|
|
5169
|
+
/**
|
|
5170
|
+
* Set the strip's surround pan position, used when it feeds a >2-channel bus.
|
|
5171
|
+
* Stored on the scene; inert until the surround DSP path applies it.
|
|
5172
|
+
*/
|
|
5173
|
+
setSurroundPan(stripIndex: number, pan: SurroundPan): void;
|
|
4416
5174
|
/**
|
|
4417
5175
|
* Add a send to a strip after construction.
|
|
4418
5176
|
*
|
|
@@ -4902,6 +5660,11 @@ type HpssWithResidualResult = WasmHpssWithResidualResult;
|
|
|
4902
5660
|
*/
|
|
4903
5661
|
declare function init(options?: {
|
|
4904
5662
|
locateFile?: (path: string, prefix: string) => string;
|
|
5663
|
+
wasmBinary?: ArrayBuffer | Uint8Array;
|
|
5664
|
+
moduleFactory?: (options?: {
|
|
5665
|
+
locateFile?: (path: string, prefix: string) => string;
|
|
5666
|
+
wasmBinary?: ArrayBuffer | Uint8Array;
|
|
5667
|
+
}) => Promise<SonareModule>;
|
|
4905
5668
|
}): Promise<void>;
|
|
4906
5669
|
/**
|
|
4907
5670
|
* Check if the module is initialized.
|
|
@@ -4925,4 +5688,4 @@ declare function voiceCharacterPresetId(preset: VoicePresetId | number): string
|
|
|
4925
5688
|
*/
|
|
4926
5689
|
declare function realtimeVoiceChangerPresetConfig(preset: VoicePresetId | number): RealtimeVoiceChangerPodConfig | null;
|
|
4927
5690
|
|
|
4928
|
-
export { type EngineClip as $, type AcousticOptions as A, type BarChord as B, type Chord as C, type CompressorDetector as D, type CompressorOptions as E, type CqtResult as F, type DeclickOptions as G, type DeclipOptions as H, type DecomposeResult as I, type DecrackleMode as J, type DecrackleOptions as K, type DehumOptions as L, type DenoiseClassicalMode as M, type DenoiseClassicalNoiseEstimator as N, type DenoiseClassicalOptions as O, type DereverbClassicalOptions as P, type DynamicRangeReport as Q, type Dynamics as R, type DynamicsAnalysisResult as S, SONARE_ENGINE_COMMAND_RECORD_BYTES, SONARE_ENGINE_RING_HEADER_INTS, SONARE_ENGINE_TELEMETRY_RECORD_BYTES, SONARE_METER_RING_HEADER_INTS, SONARE_METER_RING_RECORD_FLOATS, SONARE_SPECTRUM_RING_HEADER_INTS, SonareEngine, type SonareEngineCommandRecord, type SonareEngineCommandRingBuffer, SonareEngineCommandType, type SonareEngineOptions, type SonareEngineSyncAutomationMessage, type SonareEngineSyncClipsMessage, type SonareEngineSyncMarkersMessage, type SonareEngineSyncMessage, type SonareEngineSyncMetronomeMessage, SonareEngineTelemetryError, type SonareEngineTelemetryRecord, type SonareEngineTelemetryRingBuffer, type SonareEngineTelemetryRingReadResult, SonareEngineTelemetryType, type SonareEngineTransportFacade, type SonareMeterRingBuffer, type SonareMeterRingReadResult, SonareRealtimeEngineNode, type SonareRealtimeEngineNodeCapabilities, type SonareRealtimeEngineNodeOptions, SonareRealtimeEngineWorkletProcessor, type SonareRealtimeEngineWorkletProcessorOptions, type SonareRealtimeVoiceChangerDestroyMessage, type SonareRealtimeVoiceChangerMessage, type SonareRealtimeVoiceChangerResetMessage, type SonareRealtimeVoiceChangerSetConfigMessage, SonareRealtimeVoiceChangerWorkletProcessor, type SonareRealtimeVoiceChangerWorkletProcessorOptions, SonareRtRealtimeEngineRuntime, type SonareRtRealtimeEngineRuntimeOptions, type SonareSpectrumRingBuffer, type SonareSpectrumRingReadResult, type SonareWorkletDestroyMessage, type SonareWorkletMessage, type SonareWorkletMeterSnapshot, SonareWorkletProcessor, type SonareWorkletProcessorOptions, type SonareWorkletScheduleInsertAutomationMessage, type SonareWorkletSetMeterIntervalMessage, type SonareWorkletSpectrumSnapshot, type SonareWorkletTransportMessage, type DynamicsResult as T, EXPECTED_ENGINE_ABI_VERSION as U, EXPECTED_PROJECT_ABI_VERSION as V, type EngineAutomationPoint as W, type EngineBounceOptions as X, type EngineBounceResult as Y, type EngineCapabilities as Z, type EngineCaptureStatus as _, type AcousticResult as a, type PatternScore as a$, type EngineFreezeOptions as a0, type EngineFreezeResult as a1, type EngineGraphSpec as a2, type EngineMarker as a3, type EngineMeterTelemetry as a4, type EngineMetronomeConfig as a5, type EngineParameterInfo as a6, type EngineTelemetry as a7, type EngineTransportState as a8, type EqBand as a9, type Matrix2dResult as aA, type MelPowerResult as aB, type MelSpectrogramResult as aC, type MelodyOptions as aD, type MelodyPoint as aE, type MelodyResult as aF, type MeterTap as aG, type MeteringDetectClippingOptions as aH, type MeteringDynamicRangeOptions as aI, type MfccResult as aJ, type MicrophoneInputBinding as aK, type MidiCcBindOptions as aL, type MidiCcLearnOptions as aM, type MixMeterSnapshot as aN, type MixOptions as aO, type MixResult as aP, Mixer as aQ, type MixerProcessResult as aR, type MixerRealtimeBuffer as aS, Mode as aT, type NoteStretchOptions as aU, type OpfsClipPageProviderBinding as aV, type OpfsClipPageProviderOptions as aW, type PairAnalysis as aX, type PairProcessor as aY, type PanLaw as aZ, type PanMode as a_, type EqBandPhase as aa, type EqBandType as ab, type EqCoeffMode as ac, type EqMatchOptions as ad, type EqSpectrumSnapshot as ae, type EqStereoPlacement as af, ErrorCode as ag, type FrameBuffer as ah, type GateOptions as ai, type GoniometerPoint as aj, type HpssResult as ak, type HpssWithResidualResult as al, type Key as am, type KeyCandidate as an, type KeyDetectionOptions as ao, KeyProfile as ap, type KeyProfileName as aq, type LufsResult as ar, type MasteringChainConfig as as, type MasteringChainResult as at, type MasteringOptions as au, type MasteringPreset as av, type MasteringProcessorParams as aw, type MasteringResult as ax, type MasteringStereoChainResult as ay, type MasteringStereoResult as az, type AnalysisResult as b, StreamAnalyzer as b$, type PhaseScopeReport as b0, PitchClass as b1, type PitchResult as b2, type ProgressiveEstimate as b3, Project as b4, type ProjectAssistSidecar as b5, type ProjectAutomationCurve as b6, type ProjectAutomationLaneDesc as b7, type ProjectAutomationPoint as b8, type ProjectBounceOptions as b9, type RhythmFeatures as bA, type RirResult as bB, type RirSynthOptions as bC, type RoomEstimateOptions as bD, type RoomEstimateResult as bE, type RoomGeometryOptions as bF, type RoomMorphOptions as bG, SYNTH_BODY_TYPES as bH, SYNTH_ENGINE_MODES as bI, SYNTH_FILTER_MODELS as bJ, SYNTH_FILTER_OUTPUTS as bK, SYNTH_MOD_DESTINATIONS as bL, SYNTH_MOD_SOURCES as bM, SYNTH_OSC_WAVEFORMS as bN, type Section as bO, SectionType as bP, type SendTiming as bQ, type Sf2InstrumentConfig as bR, type Sf2ProgramStatus as bS, type SoloProcessor as bT, SonareError as bU, type SourceBackend as bV, type SpectrumOptions as bW, type SpectrumReport as bX, type StereoAnalysis as bY, type StftPowerResult as bZ, type StftResult as b_, type ProjectChordSymbol as ba, type ProjectClipCompSegment as bb, type ProjectClipDesc as bc, type ProjectClipFade as bd, type ProjectClipTake as be, type ProjectCompileResult as bf, type ProjectFadeCurve as bg, type ProjectKeySegment as bh, type ProjectLoopMode as bi, type ProjectLoopRecordingDesc as bj, type ProjectLoopRecordingResult as bk, type ProjectMidiClipResult as bl, type ProjectMidiEvent as bm, type ProjectNotePairValidation as bn, type ProjectTrackDesc as bo, type ProjectTrackKind as bp, type ProjectWarpAnchor as bq, type ProjectWarpMapDesc as br, RealtimeEngine as bs, RealtimeVoiceChanger as bt, type RealtimeVoiceChangerConfigInput as bu, type RealtimeVoiceChangerInterleavedBuffer as bv, type RealtimeVoiceChangerMonoBuffer as bw, type RealtimeVoiceChangerPlanarBuffer as bx, type RealtimeVoiceChangerPodConfig as by, type RhythmAnalysisResult as bz, type AnalyzeBpmOptions as c, decompose as c$, type StreamConfig as c0, type StreamConfigDefaults as c1, type StreamFramesI16 as c2, type StreamFramesU8 as c3, type StreamQuantizeConfig as c4, StreamingEqualizer as c5, type StreamingEqualizerConfig as c6, StreamingMasteringChain as c7, type StreamingMasteringChainConfig as c8, type StreamingPlatform as c9, type WaveformPeaksOptions as cA, type WaveformPeaksReport as cB, type WebMidiBinding as cC, type WebMidiCcBinding as cD, type WebMidiInputInfo as cE, amplitudeToDb as cF, analyze as cG, analyzeBpm as cH, analyzeDynamics as cI, analyzeImpulseResponse as cJ, analyzeMelody as cK, analyzeRhythm as cL, analyzeSections as cM, analyzeTimbre as cN, analyzeWithProgress as cO, bassChroma as cP, bindMicrophoneInput as cQ, bindWebMidi as cR, chordFunctionalAnalysis as cS, chroma as cT, chromaCens as cU, cqt as cV, createOpfsClipPageProvider as cW, createOpfsClipPageWorker as cX, cyclicTempogram as cY, dbToAmplitude as cZ, dbToPower as c_, StreamingRetune as ca, type StreamingRetuneConfig as cb, type SynthBodyType as cc, type SynthEngineMode as cd, type SynthEnumTables as ce, type SynthFilterModel as cf, type SynthFilterOutput as cg, type SynthModDestination as ch, type SynthModRouting as ci, type SynthModSource as cj, type SynthOscWaveform as ck, type SynthPatch as cl, type TempogramMode as cm, type Timbre as cn, type TimbreAnalysisResult as co, type TimbreFrame as cp, type TimeSignature as cq, type TransientShaperOptions as cr, createSonareEngineCommandRingBuffer, createSonareEngineTelemetryRingBuffer, createSonareMeterRingBuffer, createSonareSpectrumRingBuffer, type TrimSilenceMode as cs, type TrimSilenceOptions as ct, type ValidateOptions as cu, type VectorscopeReport as cv, type VoiceChangeOptions as cw, type VoiceChangeRealtimeOptions as cx, type VoicePresetId as cy, type WaveformPeakPyramidOptions as cz, type AnalyzeDynamicsOptions as d, masteringRepairDereverbClassical as d$, decomposeWithInit as d0, deemphasis as d1, detectAcoustic as d2, detectBeats as d3, detectBpm as d4, detectChords as d5, detectDownbeats as d6, detectKey as d7, detectKeyCandidates as d8, detectOnsets as d9, masterAudioStereoWithProgress as dA, masterAudioWithProgress as dB, mastering as dC, masteringAssistantSuggest as dD, masteringAudioProfile as dE, masteringChain as dF, masteringChainStereo as dG, masteringChainStereoWithProgress as dH, masteringChainWithProgress as dI, masteringDynamicsCompressor as dJ, masteringDynamicsGate as dK, masteringDynamicsTransientShaper as dL, masteringInsertNames as dM, masteringInsertParamNames as dN, masteringPairAnalysisNames as dO, masteringPairAnalyze as dP, masteringPairProcess as dQ, masteringPairProcessorNames as dR, masteringPresetNames as dS, masteringProcess as dT, masteringProcessStereo as dU, masteringProcessorNames as dV, masteringRepairDeclick as dW, masteringRepairDeclip as dX, masteringRepairDecrackle as dY, masteringRepairDehum as dZ, masteringRepairDenoiseClassical as d_, ebur128LoudnessRange as da, engineAbiVersion as db, engineCapabilities as dc, estimateRoom as dd, estimateTuning as de, decodeFrame, fixFrames as df, fixLength as dg, fourierTempogram as dh, frameSignal as di, framesToSamples as dj, framesToTime as dk, harmonic as dl, hasFfmpegSupport as dm, hpss as dn, hpssWithResidual as dp, hybridCqt as dq, hzToMel as dr, hzToMidi as ds, hzToNote as dt, isSonareError as du, isWebMidiAvailable as dv, lufs as dw, lufsInterleaved as dx, masterAudio as dy, masterAudioStereo as dz, type AnalyzeRhythmOptions as e, samplesToFrames as e$, masteringRepairTrimSilence as e0, masteringStereoAnalysisNames as e1, masteringStereoAnalyze as e2, masteringStreamingPreview as e3, melSpectrogram as e4, melToAudio as e5, melToHz as e6, melToStft as e7, meteringCrestFactorDb as e8, meteringDcOffset as e9, onsetEnvelope as eA, onsetStrengthMulti as eB, opfsClipPageWorkerSource as eC, padCenter as eD, pcen as eE, peakPick as eF, percussive as eG, phaseVocoder as eH, pitchCorrectToMidi as eI, pitchCorrectToMidiTimevarying as eJ, pitchPyin as eK, pitchShift as eL, pitchTuning as eM, pitchYin as eN, plp as eO, polyFeatures as eP, powerToDb as eQ, preemphasis as eR, projectAbiVersion as eS, pseudoCqt as eT, realtimeVoiceChangerPresetConfig as eU, realtimeVoiceChangerPresetJson as eV, realtimeVoiceChangerPresetNames as eW, remix as eX, resample as eY, rmsEnergy as eZ, roomMorph as e_, meteringDetectClipping as ea, meteringDynamicRange as eb, meteringPeakDb as ec, meteringPhaseScope as ed, meteringPhaseScopeDecimated as ee, meteringRmsDb as ef, meteringSpectrum as eg, meteringSpectrumFrame as eh, meteringStereoCorrelation as ei, meteringStereoWidth as ej, meteringTruePeakDb as ek, meteringVectorscope as el, meteringVectorscopeDecimated as em, mfcc as en, encodeFrameHi, encodeFrameLo, mfccToAudio as eo, mfccToMel as ep, midiToHz as eq, mixStereo as er, mixingScenePresetJson as es, mixingScenePresetNames as et, momentaryLufs as eu, nnFilter as ev, nnlsChroma as ew, normalize as ex, noteStretch as ey, noteToHz as ez, type AnalyzeSectionsOptions as f, scaleCorrectionSemitones as f0, scalePitchClassEnabled as f1, scaleQuantizeMidi as f2, shortTermLufs as f3, spectralBandwidth as f4, spectralCentroid as f5, spectralContrast as f6, spectralFlatness as f7, spectralRolloff as f8, splitSilence as f9, stft as fa, stftDb as fb, streamAnalyzerConfigDefaults as fc, synthEnumTables as fd, synthPresetNames as fe, synthPresetPatch as ff, synthesizeRir as fg, tempogram as fh, tempogramRatio as fi, timeStretch as fj, timeToFrames as fk, tonnetz as fl, trim as fm, trimSilence as fn, validateRealtimeVoiceChangerPresetJson as fo, vectorNormalize as fp, version as fq, voiceChange as fr, voiceChangeRealtime as fs, voiceChangerAbiVersion as ft, voiceCharacterPresetId as fu, vqt as fv, waveformPeakPyramid as fw, waveformPeaks as fx, zeroCrossingRate as fy, zeroCrossings as fz, type AnalyzeTimbreOptions as g, type AnalyzerStats as h, Audio as i, init, isInitialized, type AutomationCurve as j, type Beat as k, type BindMicrophoneInputOptions as l, type BindWebMidiOptions as m, type BpmAnalysisResult as n, type BpmCandidate as o, type BrowserAudioDecodeOptions as p, popSonareEngineCommandRingBuffer, pushSonareEngineCommandRingBuffer, type BuiltinSynthBinding as q, type BuiltinSynthConfig as r, readSonareEngineTelemetryRingBuffer, readSonareMeterRingBuffer, readSonareSpectrumRingBuffer, registerSonareRealtimeEngineWorkletProcessor, registerSonareRealtimeVoiceChangerWorkletProcessor, registerSonareWorkletProcessor, type BuiltinSynthWaveform as s, sonareEngineCommandRingBufferByteLength, sonareEngineTelemetryRingBufferByteLength, sonareMeterRingBufferByteLength, sonareSpectrumRingBufferByteLength, type ChordAnalysisResult as t, type ChordChange as u, type ChordDetectionOptions as v, ChordQuality as w, writeSonareEngineTelemetryRingBuffer, type ChromaResult as x, type ClippingRegion as y, type ClippingReport as z };
|
|
5691
|
+
export { type EngineCaptureStatus as $, type AcousticOptions as A, type BarChord as B, type Chord as C, type CompressorDetector as D, type CompressorOptions as E, type CqtResult as F, type DeclickOptions as G, type DeclipOptions as H, type DecomposeResult as I, type DecrackleMode as J, type DecrackleOptions as K, type DehumOptions as L, type DenoiseClassicalMode as M, type DenoiseClassicalNoiseEstimator as N, type DenoiseClassicalOptions as O, type DereverbClassicalOptions as P, type DynamicRangeReport as Q, type Dynamics as R, type DynamicsAnalysisResult as S, SONARE_ENGINE_COMMAND_RECORD_BYTES, SONARE_ENGINE_RING_HEADER_INTS, SONARE_ENGINE_TELEMETRY_RECORD_BYTES, SONARE_METER_RING_HEADER_INTS, SONARE_METER_RING_RECORD_FLOATS, SONARE_SCOPE_RING_HEADER_INTS, SONARE_SPECTRUM_RING_HEADER_INTS, SonareEngine, type SonareEngineCaptureRequestMessage, type SonareEngineCaptureResponseMessage, 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 SonareMeterRingBuffer, type SonareMeterRingReadResult, SonareRealtimeEngineNode, type SonareRealtimeEngineNodeCapabilities, type SonareRealtimeEngineNodeOptions, SonareRealtimeEngineWorkletProcessor, type SonareRealtimeEngineWorkletProcessorOptions, type SonareRealtimeVoiceChangerDestroyMessage, type SonareRealtimeVoiceChangerMessage, type SonareRealtimeVoiceChangerResetMessage, type SonareRealtimeVoiceChangerSetConfigMessage, SonareRealtimeVoiceChangerWorkletProcessor, type SonareRealtimeVoiceChangerWorkletProcessorOptions, SonareRtRealtimeEngineRuntime, type SonareRtRealtimeEngineRuntimeOptions, 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, type DynamicsResult as T, EXPECTED_ENGINE_ABI_VERSION as U, EXPECTED_PROJECT_ABI_VERSION as V, type EngineAutomationPoint as W, type EngineBounceOptions as X, type EngineBounceResult as Y, type EngineBus as Z, type EngineCapabilities as _, type AcousticResult as a, type MixOptions as a$, type EngineClip as a0, type EngineFreezeOptions as a1, type EngineFreezeResult as a2, type EngineGraphSpec as a3, type EngineMarker as a4, type EngineMeterTelemetry as a5, type EngineMeterTelemetryWide as a6, type EngineMetronomeConfig as a7, type EngineMidiClipSchedule as a8, type EngineMidiEvent as a9, type LufsResult as aA, MarkerKind as aB, type MasteringChainConfig as aC, type MasteringChainResult as aD, type MasteringChannelPolicy as aE, type MasteringInsertParamInfo as aF, type MasteringOptions as aG, type MasteringPreset as aH, type MasteringProcessorCatalogEntry as aI, type MasteringProcessorParams as aJ, type MasteringResult as aK, type MasteringStereoChainResult as aL, type MasteringStereoResult as aM, type Matrix2dResult as aN, type MelPowerResult as aO, type MelSpectrogramResult as aP, type MelodyOptions as aQ, type MelodyPoint as aR, type MelodyResult as aS, type MeterTap as aT, type MeteringDetectClippingOptions as aU, type MeteringDynamicRangeOptions as aV, type MfccResult as aW, type MicrophoneInputBinding as aX, type MidiCcBindOptions as aY, type MidiCcLearnOptions as aZ, type MixMeterSnapshot as a_, type EngineParameterInfo as aa, type EngineScopeTelemetry as ab, type EngineTelemetry as ac, type EngineTempoSegment as ad, type EngineTimeSignatureSegment as ae, type EngineTrackLane as af, type EngineTrackSend as ag, type EngineTransportState as ah, type EqBand as ai, type EqBandPhase as aj, type EqBandType as ak, type EqCoeffMode as al, type EqMatchOptions as am, type EqSpectrumSnapshot as an, type EqStereoPlacement as ao, ErrorCode as ap, type FrameBuffer as aq, type GateOptions as ar, type GoniometerPoint as as, type HpssResult as at, type HpssWithResidualResult as au, type Key as av, type KeyCandidate as aw, type KeyDetectionOptions as ax, KeyProfile as ay, type KeyProfileName as az, type AnalysisResult as b, SYNTH_OSC_WAVEFORMS as b$, type MixResult as b0, Mixer as b1, type MixerProcessResult as b2, type MixerRealtimeBuffer as b3, Mode as b4, type NoteStretchOptions as b5, type OpfsClipPageProviderBinding as b6, type OpfsClipPageProviderOptions as b7, type PairAnalysis as b8, type PairProcessor as b9, type ProjectMidiEvent as bA, type ProjectNotePairValidation as bB, type ProjectTrackDesc as bC, type ProjectTrackKind as bD, type ProjectWarpAnchor as bE, type ProjectWarpMapDesc as bF, RealtimeEngine as bG, RealtimeVoiceChanger as bH, type RealtimeVoiceChangerConfigInput as bI, type RealtimeVoiceChangerInterleavedBuffer as bJ, type RealtimeVoiceChangerMonoBuffer as bK, type RealtimeVoiceChangerPlanarBuffer as bL, type RealtimeVoiceChangerPodConfig as bM, type RhythmAnalysisResult as bN, type RhythmFeatures as bO, type RirResult as bP, type RirSynthOptions as bQ, type RoomEstimateOptions as bR, type RoomEstimateResult as bS, type RoomGeometryOptions as bT, type RoomMorphOptions as bU, SYNTH_BODY_TYPES as bV, SYNTH_ENGINE_MODES as bW, SYNTH_FILTER_MODELS as bX, SYNTH_FILTER_OUTPUTS as bY, SYNTH_MOD_DESTINATIONS as bZ, SYNTH_MOD_SOURCES as b_, type PanLaw as ba, type PanMode as bb, type PatternScore as bc, type PhaseScopeReport as bd, PitchClass as be, type PitchResult as bf, type ProgressiveEstimate as bg, Project as bh, type ProjectAssistSidecar as bi, type ProjectAutomationCurve as bj, type ProjectAutomationLaneDesc as bk, type ProjectAutomationPoint as bl, type ProjectBounceOptions as bm, type ProjectChordSymbol as bn, type ProjectClipCompSegment as bo, type ProjectClipDesc as bp, type ProjectClipFade as bq, type ProjectClipTake as br, type ProjectCompileResult as bs, type ProjectFadeCurve as bt, type ProjectKeySegment as bu, type ProjectLoopMode as bv, type ProjectLoopRecordingDesc as bw, type ProjectLoopRecordingResult as bx, type ProjectMarker as by, type ProjectMidiClipResult as bz, type AnalyzeBpmOptions as c, analyzeImpulseResponse as c$, type Section as c0, SectionType as c1, type SendTiming as c2, type Sf2InstrumentConfig as c3, type Sf2ProgramStatus as c4, type SoloProcessor as c5, SonareError as c6, type SourceBackend as c7, type SpectralEditMode as c8, type SpectralEditOptions as c9, type SynthModRouting as cA, type SynthModSource as cB, type SynthOscWaveform as cC, type SynthPatch as cD, type TempogramMode as cE, type Timbre as cF, type TimbreAnalysisResult as cG, type TimbreFrame as cH, type TimeSignature as cI, type TransientShaperOptions as cJ, type TrimSilenceMode as cK, type TrimSilenceOptions as cL, type ValidateOptions as cM, type VectorscopeReport as cN, type VoiceChangeOptions as cO, type VoiceChangeRealtimeOptions as cP, type VoicePresetId as cQ, type WaveformPeakPyramidOptions as cR, type WaveformPeaksOptions as cS, type WaveformPeaksReport as cT, type WebMidiBinding as cU, type WebMidiCcBinding as cV, type WebMidiInputInfo as cW, amplitudeToDb as cX, analyze as cY, analyzeBpm as cZ, analyzeDynamics as c_, type SpectralEditWindow as ca, type SpectralRegionOp as cb, type SpectrumOptions as cc, type SpectrumReport as cd, type StereoAnalysis as ce, type StftPowerResult as cf, type StftResult as cg, StreamAnalyzer as ch, type StreamConfig as ci, type StreamConfigDefaults as cj, type StreamFramesI16 as ck, type StreamFramesU8 as cl, type StreamQuantizeConfig as cm, StreamingEqualizer as cn, type StreamingEqualizerConfig as co, StreamingMasteringChain as cp, type StreamingMasteringChainConfig as cq, type StreamingPlatform as cr, createSonareEngineCommandRingBuffer, createSonareEngineTelemetryRingBuffer, createSonareMeterRingBuffer, createSonareScopeRingBuffer, createSonareSpectrumRingBuffer, StreamingRetune as cs, type StreamingRetuneConfig as ct, type SynthBodyType as cu, type SynthEngineMode as cv, type SynthEnumTables as cw, type SynthFilterModel as cx, type SynthFilterOutput as cy, type SynthModDestination as cz, type AnalyzeDynamicsOptions as d, masteringDynamicsCompressor as d$, analyzeMelody as d0, analyzeRhythm as d1, analyzeSections as d2, analyzeTimbre as d3, analyzeWithProgress as d4, bassChroma as d5, bindMicrophoneInput as d6, bindWebMidi as d7, chordFunctionalAnalysis as d8, chroma as d9, fourierTempogram as dA, frameSignal as dB, framesToSamples as dC, framesToTime as dD, harmonic as dE, hasFfmpegSupport as dF, hpss as dG, hpssWithResidual as dH, hybridCqt as dI, hzToMel as dJ, hzToMidi as dK, hzToNote as dL, isSonareError as dM, isWebMidiAvailable as dN, lufs as dO, lufsInterleaved as dP, masterAudio as dQ, masterAudioStereo as dR, masterAudioStereoWithProgress as dS, masterAudioWithProgress as dT, mastering as dU, masteringAssistantSuggest as dV, masteringAudioProfile as dW, masteringChain as dX, masteringChainStereo as dY, masteringChainStereoWithProgress as dZ, masteringChainWithProgress as d_, chromaCens as da, cqt as db, createOpfsClipPageProvider as dc, createOpfsClipPageWorker as dd, cyclicTempogram as de, decodeFrame, dbToAmplitude as df, dbToPower as dg, decompose as dh, decomposeWithInit as di, deemphasis as dj, detectAcoustic as dk, detectBeats as dl, detectBpm as dm, detectChords as dn, detectDownbeats as dp, detectKey as dq, detectKeyCandidates as dr, detectOnsets as ds, ebur128LoudnessRange as dt, engineAbiVersion as du, engineCapabilities as dv, estimateRoom as dw, estimateTuning as dx, fixFrames as dy, fixLength as dz, type AnalyzeRhythmOptions as e, phaseVocoder as e$, masteringDynamicsGate as e0, masteringDynamicsTransientShaper as e1, masteringInsertNames as e2, masteringInsertParamInfo as e3, masteringInsertParamNames as e4, masteringPairAnalysisNames as e5, masteringPairAnalyze as e6, masteringPairProcess as e7, masteringPairProcessorNames as e8, masteringPresetNames as e9, meteringSpectrum as eA, meteringSpectrumFrame as eB, meteringStereoCorrelation as eC, meteringStereoWidth as eD, meteringTruePeakDb as eE, meteringVectorscope as eF, meteringVectorscopeDecimated as eG, mfcc as eH, mfccToAudio as eI, mfccToMel as eJ, midiToHz as eK, mixStereo as eL, mixingScenePresetJson as eM, mixingScenePresetNames as eN, momentaryLufs as eO, nnFilter as eP, nnlsChroma as eQ, normalize as eR, noteStretch as eS, noteToHz as eT, onsetEnvelope as eU, onsetStrengthMulti as eV, opfsClipPageWorkerSource as eW, padCenter as eX, pcen as eY, peakPick as eZ, percussive as e_, masteringProcess as ea, masteringProcessStereo as eb, masteringProcessorCatalog as ec, masteringProcessorNames as ed, masteringRepairDeclick as ee, masteringRepairDeclip as ef, masteringRepairDecrackle as eg, masteringRepairDehum as eh, masteringRepairDenoiseClassical as ei, masteringRepairDereverbClassical as ej, masteringRepairTrimSilence as ek, masteringStereoAnalysisNames as el, masteringStereoAnalyze as em, masteringStreamingPreview as en, encodeFrameHi, encodeFrameLo, melSpectrogram as eo, melToAudio as ep, melToHz as eq, melToStft as er, meteringCrestFactorDb as es, meteringDcOffset as et, meteringDetectClipping as eu, meteringDynamicRange as ev, meteringPeakDb as ew, meteringPhaseScope as ex, meteringPhaseScopeDecimated as ey, meteringRmsDb as ez, type AnalyzeSectionsOptions as f, pitchCorrectToMidi as f0, pitchCorrectToMidiTimevarying as f1, pitchPyin as f2, pitchShift as f3, pitchTuning as f4, pitchYin as f5, plp as f6, polyFeatures as f7, powerToDb as f8, preemphasis as f9, synthPresetPatch as fA, synthesizeRir as fB, tempogram as fC, tempogramRatio as fD, timeStretch as fE, timeToFrames as fF, tonnetz as fG, trim as fH, trimSilence as fI, validateRealtimeVoiceChangerPresetJson as fJ, vectorNormalize as fK, version as fL, voiceChange as fM, voiceChangeRealtime as fN, voiceChangerAbiVersion as fO, voiceCharacterPresetId as fP, vqt as fQ, waveformPeakPyramid as fR, waveformPeaks as fS, zeroCrossingRate as fT, zeroCrossings as fU, projectAbiVersion as fa, pseudoCqt as fb, realtimeVoiceChangerPresetConfig as fc, realtimeVoiceChangerPresetJson as fd, realtimeVoiceChangerPresetNames as fe, remix as ff, resample as fg, rmsEnergy as fh, roomMorph as fi, samplesToFrames as fj, scaleCorrectionSemitones as fk, scalePitchClassEnabled as fl, scaleQuantizeMidi as fm, shortTermLufs as fn, spectralBandwidth as fo, spectralCentroid as fp, spectralContrast as fq, spectralEdit as fr, spectralFlatness as fs, spectralRolloff as ft, splitSilence as fu, stft as fv, stftDb as fw, streamAnalyzerConfigDefaults as fx, synthEnumTables as fy, synthPresetNames as fz, type AnalyzeTimbreOptions as g, type AnalyzerStats as h, Audio as i, init, isInitialized, type AutomationCurve as j, type Beat as k, type BindMicrophoneInputOptions as l, type BindWebMidiOptions as m, type BpmAnalysisResult as n, type BpmCandidate as o, type BrowserAudioDecodeOptions as p, popSonareEngineCommandRingBuffer, pushSonareEngineCommandRingBuffer, type BuiltinSynthBinding as q, type BuiltinSynthConfig as r, readSonareEngineTelemetryRingBuffer, readSonareMeterRingBuffer, readSonareScopeRingBuffer, readSonareSpectrumRingBuffer, registerSonareRealtimeEngineWorkletProcessor, registerSonareRealtimeVoiceChangerWorkletProcessor, registerSonareWorkletProcessor, type BuiltinSynthWaveform as s, sonareEngineCommandRingBufferByteLength, sonareEngineTelemetryRingBufferByteLength, sonareMeterRingBufferByteLength, sonareScopeRingBufferByteLength, sonareSpectrumRingBufferByteLength, type ChordAnalysisResult as t, type ChordChange as u, type ChordDetectionOptions as v, ChordQuality as w, writeSonareEngineTelemetryRingBuffer, type ChromaResult as x, type ClippingRegion as y, type ClippingReport as z };
|