@libraz/libsonare 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +5 -5
  2. package/dist/analysis.js +2 -0
  3. package/dist/analysis.js.map +1 -1
  4. package/dist/index.d.ts +8 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1927 -140
  7. package/dist/index.js.map +1 -1
  8. package/dist/instrument_types.d.ts +27 -3
  9. package/dist/instrument_types.d.ts.map +1 -1
  10. package/dist/mastering_core.d.ts +3 -2
  11. package/dist/mastering_core.d.ts.map +1 -1
  12. package/dist/mixer.d.ts +2 -2
  13. package/dist/project.d.ts +5 -4
  14. package/dist/project.d.ts.map +1 -1
  15. package/dist/project_class.d.ts +57 -3
  16. package/dist/project_class.d.ts.map +1 -1
  17. package/dist/project_internal.d.ts +35 -1
  18. package/dist/project_internal.d.ts.map +1 -1
  19. package/dist/project_types.d.ts +10 -1
  20. package/dist/project_types.d.ts.map +1 -1
  21. package/dist/public_types.d.ts +1 -0
  22. package/dist/public_types.d.ts.map +1 -1
  23. package/dist/public_types_mastering.d.ts +1 -1
  24. package/dist/public_types_mastering.d.ts.map +1 -1
  25. package/dist/public_types_vocal_edit.d.ts +250 -0
  26. package/dist/public_types_vocal_edit.d.ts.map +1 -0
  27. package/dist/public_types_vocal_project.d.ts +63 -0
  28. package/dist/public_types_vocal_project.d.ts.map +1 -0
  29. package/dist/realtime_engine.d.ts +57 -10
  30. package/dist/realtime_engine.d.ts.map +1 -1
  31. package/dist/repair_dereverb.d.ts +1 -0
  32. package/dist/repair_dereverb.d.ts.map +1 -1
  33. package/dist/repair_noise.d.ts +1 -0
  34. package/dist/repair_noise.d.ts.map +1 -1
  35. package/dist/sonare-analysis.wasm +0 -0
  36. package/dist/sonare.d.ts +53 -0
  37. package/dist/sonare.js +1 -1
  38. package/dist/sonare.wasm +0 -0
  39. package/dist/vocal_edit.d.ts +131 -0
  40. package/dist/vocal_edit.d.ts.map +1 -0
  41. package/dist/vocal_edit_worker.d.ts +51 -0
  42. package/dist/vocal_edit_worker.d.ts.map +1 -0
  43. package/dist/vocal_edit_worker.js +1462 -0
  44. package/dist/vocal_edit_worker.js.map +1 -0
  45. package/dist/vocal_edit_worker_client.d.ts +118 -0
  46. package/dist/vocal_edit_worker_client.d.ts.map +1 -0
  47. package/dist/vocal_edit_worker_protocol.d.ts +139 -0
  48. package/dist/vocal_edit_worker_protocol.d.ts.map +1 -0
  49. package/dist/vocal_project.d.ts +17 -0
  50. package/dist/vocal_project.d.ts.map +1 -0
  51. package/dist/web_midi.d.ts +4 -0
  52. package/dist/web_midi.d.ts.map +1 -1
  53. package/dist/worker.js.map +1 -1
  54. package/dist/worklet/engine-mixer-facade.d.ts +2 -1
  55. package/dist/worklet/engine-mixer-facade.d.ts.map +1 -1
  56. package/dist/worklet/engine-node.d.ts +8 -0
  57. package/dist/worklet/engine-node.d.ts.map +1 -1
  58. package/dist/worklet/engine-processor.d.ts +2 -1
  59. package/dist/worklet/engine-processor.d.ts.map +1 -1
  60. package/dist/worklet/engine-register.d.ts.map +1 -1
  61. package/dist/worklet/engine-strips.d.ts +4 -2
  62. package/dist/worklet/engine-strips.d.ts.map +1 -1
  63. package/dist/worklet/engine.d.ts +15 -3
  64. package/dist/worklet/engine.d.ts.map +1 -1
  65. package/dist/worklet/guards.d.ts +3 -1
  66. package/dist/worklet/guards.d.ts.map +1 -1
  67. package/dist/worklet/messages.d.ts +50 -5
  68. package/dist/worklet/messages.d.ts.map +1 -1
  69. package/dist/worklet/protocol.d.ts +10 -0
  70. package/dist/worklet/protocol.d.ts.map +1 -1
  71. package/dist/worklet.d.ts +1 -1
  72. package/dist/worklet.d.ts.map +1 -1
  73. package/dist/worklet.js +223 -16
  74. package/dist/worklet.js.map +1 -1
  75. package/package.json +6 -1
  76. package/src/index.ts +33 -0
  77. package/src/instrument_types.ts +29 -3
  78. package/src/mastering_core.ts +3 -2
  79. package/src/mixer.ts +2 -2
  80. package/src/project.ts +8 -1
  81. package/src/project_class.ts +136 -1
  82. package/src/project_internal.ts +90 -0
  83. package/src/project_types.ts +11 -1
  84. package/src/public_types.ts +1 -0
  85. package/src/public_types_mastering.ts +2 -0
  86. package/src/public_types_vocal_edit.ts +289 -0
  87. package/src/public_types_vocal_project.ts +69 -0
  88. package/src/realtime_engine.ts +86 -9
  89. package/src/repair_dereverb.ts +1 -0
  90. package/src/repair_noise.ts +1 -0
  91. package/src/sonare.js.d.ts +53 -0
  92. package/src/vocal_edit.ts +885 -0
  93. package/src/vocal_edit_worker.ts +832 -0
  94. package/src/vocal_edit_worker_client.ts +812 -0
  95. package/src/vocal_edit_worker_protocol.ts +206 -0
  96. package/src/vocal_project.ts +327 -0
  97. package/src/web_midi.ts +100 -5
  98. package/src/worklet/engine-mixer-facade.ts +2 -1
  99. package/src/worklet/engine-node.ts +47 -0
  100. package/src/worklet/engine-processor.ts +46 -1
  101. package/src/worklet/engine-register.ts +3 -0
  102. package/src/worklet/engine-strips.ts +31 -4
  103. package/src/worklet/engine.ts +27 -3
  104. package/src/worklet/guards.ts +26 -0
  105. package/src/worklet/messages.ts +59 -2
  106. package/src/worklet/protocol.ts +10 -0
  107. package/src/worklet.ts +2 -0
@@ -0,0 +1,289 @@
1
+ /** Public value types for the monophonic vocal edit surface. */
2
+
3
+ /** A uint64 value crossing the JavaScript boundary is decimal text. */
4
+ export type VocalUint64 = string;
5
+
6
+ export interface VocalRange {
7
+ startSample: number;
8
+ endSample: number;
9
+ }
10
+
11
+ export interface VocalStateToken {
12
+ sessionEpoch: VocalUint64;
13
+ revision: VocalUint64;
14
+ draftId: VocalUint64;
15
+ generation: VocalUint64;
16
+ requestId: VocalUint64;
17
+ profileId: number;
18
+ }
19
+
20
+ export interface VocalPitchPoint {
21
+ sourceSample: number;
22
+ midi: number;
23
+ }
24
+
25
+ export type VocalPitchTarget =
26
+ | { mode: 'none' }
27
+ | { mode: 'center'; midi: number }
28
+ | { mode: 'curve'; points: readonly VocalPitchPoint[] };
29
+
30
+ export interface VocalPitchEdit {
31
+ target: VocalPitchTarget;
32
+ amount: number;
33
+ speedMs: number;
34
+ maxCorrectionSemitones: number;
35
+ transposeSemitones: number;
36
+ driftScale: number;
37
+ vibratoScale: number;
38
+ }
39
+
40
+ export type VocalFormantMode = 'preserve' | 'shift';
41
+
42
+ export interface VocalFormantEdit {
43
+ mode: VocalFormantMode;
44
+ shiftSemitones: number;
45
+ }
46
+
47
+ export interface VocalNoteEdit {
48
+ pitch: VocalPitchEdit;
49
+ destinationStartSample: number;
50
+ destinationLengthSamples: number;
51
+ gainDb: number;
52
+ muted: boolean;
53
+ amplitudeEnvelope: readonly number[];
54
+ formant: VocalFormantEdit;
55
+ }
56
+
57
+ export interface VocalNote {
58
+ id: number;
59
+ sourceStartSample: number;
60
+ sourceEndSample: number;
61
+ analysisFrameStart: VocalUint64;
62
+ analysisFrameEnd: VocalUint64;
63
+ hasPitch: boolean;
64
+ medianHz: number;
65
+ centerMidi: number;
66
+ f0Stability: number;
67
+ amplitude: Float32Array;
68
+ edit: VocalNoteEdit;
69
+ }
70
+
71
+ export interface VocalTransition {
72
+ leftNoteId: number;
73
+ rightNoteId: number;
74
+ leftWindowSamples: number;
75
+ rightWindowSamples: number;
76
+ strength: number;
77
+ curve: 'smoothstep';
78
+ }
79
+
80
+ export interface VocalNotesResult {
81
+ notes: VocalNote[];
82
+ transitions: VocalTransition[];
83
+ }
84
+
85
+ export interface VocalAnalysis {
86
+ frameOriginSample: number;
87
+ samplesPerFrame: number;
88
+ frameLengthSamples: number;
89
+ f0Hz: Float32Array;
90
+ voiced: Uint8Array;
91
+ algorithmId: string;
92
+ algorithmVersion: number;
93
+ sourceLengthSamples: number;
94
+ sampleRate: number;
95
+ sourceSha256: string;
96
+ analysisSha256: string;
97
+ fminHz: number;
98
+ fmaxHz: number;
99
+ yinThreshold: number;
100
+ voicedThreshold: number;
101
+ centered: boolean;
102
+ segmentationThresholdCents: number;
103
+ minNoteMs: number;
104
+ referenceHz: number;
105
+ }
106
+
107
+ export interface VocalCapabilities {
108
+ apiVersion: number;
109
+ profileId: number;
110
+ monophonicOnly: true;
111
+ analysisCancellable: boolean;
112
+ minimumFormantShiftSemitones: number;
113
+ maximumFormantShiftSemitones: number;
114
+ }
115
+
116
+ export interface VocalHistory {
117
+ canUndo: boolean;
118
+ canRedo: boolean;
119
+ }
120
+
121
+ export type VocalHistoryState = VocalHistory;
122
+
123
+ export interface VocalSessionLimits {
124
+ maxHistoryBytes?: VocalUint64;
125
+ maxCacheBytes?: VocalUint64;
126
+ maxUndoDepth?: number;
127
+ maxRenderJobs?: number;
128
+ }
129
+
130
+ export interface VocalAnalysisInput {
131
+ frameOriginSample: number;
132
+ samplesPerFrame: number;
133
+ frameLengthSamples: number;
134
+ f0Hz: Float32Array;
135
+ voiced: Uint8Array;
136
+ algorithmId?: string;
137
+ algorithmVersion?: number;
138
+ fminHz?: number;
139
+ fmaxHz?: number;
140
+ yinThreshold?: number;
141
+ voicedThreshold?: number;
142
+ centered?: boolean;
143
+ segmentationThresholdCents?: number;
144
+ minNoteMs?: number;
145
+ referenceHz?: number;
146
+ }
147
+
148
+ export interface VocalCreateOptions {
149
+ outputLengthSamples?: number;
150
+ edgeFadeMs?: number;
151
+ vibratoCutoffHz?: number;
152
+ segmentationThresholdCents?: number;
153
+ minNoteMs?: number;
154
+ frameLengthSamples?: number;
155
+ hopLengthSamples?: number;
156
+ fminHz?: number;
157
+ fmaxHz?: number;
158
+ yinThreshold?: number;
159
+ voicedThreshold?: number;
160
+ centered?: boolean;
161
+ referenceHz?: number;
162
+ limits?: VocalSessionLimits;
163
+ analysis?: VocalAnalysisInput;
164
+ }
165
+
166
+ export interface VocalCreateRequest extends VocalCreateOptions {
167
+ samples: Float32Array;
168
+ sampleRate: number;
169
+ }
170
+
171
+ export interface VocalRestoreRequest {
172
+ samples: Float32Array;
173
+ sampleRate: number;
174
+ state: Uint8Array;
175
+ /** Runtime limits; omitted fields take the same defaults as session creation. */
176
+ limits?: VocalSessionLimits;
177
+ }
178
+
179
+ export interface VocalSetEditOperation {
180
+ kind: 'setEdit';
181
+ noteId: number;
182
+ edit: VocalNoteEdit;
183
+ }
184
+
185
+ export interface VocalSetSourceSpanOperation {
186
+ kind: 'setSourceSpan';
187
+ noteId: number;
188
+ sourceStartSample: number;
189
+ sourceEndSample: number;
190
+ destinationStartSample: number;
191
+ destinationLengthSamples: number;
192
+ }
193
+
194
+ export interface VocalSplitOperation {
195
+ kind: 'split';
196
+ noteId: number;
197
+ sourceSample: number;
198
+ }
199
+
200
+ export interface VocalMergeOperation {
201
+ kind: 'merge';
202
+ noteIds: readonly number[];
203
+ policy?: 'preserve' | 'reset';
204
+ }
205
+
206
+ export interface VocalSetTransitionOperation {
207
+ kind: 'setTransition';
208
+ transition: VocalTransition;
209
+ }
210
+
211
+ export interface VocalRemoveTransitionOperation {
212
+ kind: 'removeTransition';
213
+ leftNoteId: number;
214
+ rightNoteId: number;
215
+ }
216
+
217
+ export interface VocalResetOperation {
218
+ kind: 'reset';
219
+ noteIds: readonly number[];
220
+ }
221
+
222
+ export type VocalEditOperation =
223
+ | VocalSetEditOperation
224
+ | VocalSetSourceSpanOperation
225
+ | VocalSplitOperation
226
+ | VocalMergeOperation
227
+ | VocalSetTransitionOperation
228
+ | VocalRemoveTransitionOperation
229
+ | VocalResetOperation;
230
+
231
+ export interface VocalApplyRequest {
232
+ expectedGeneration: VocalUint64;
233
+ operations: readonly VocalEditOperation[];
234
+ }
235
+
236
+ export interface VocalIdChange {
237
+ operationIndex: number;
238
+ retiredId: number;
239
+ newIds: readonly number[];
240
+ }
241
+
242
+ export interface VocalEditResult {
243
+ token: VocalStateToken;
244
+ dirtyRanges: readonly VocalRange[];
245
+ idChanges: readonly VocalIdChange[];
246
+ }
247
+
248
+ export interface VocalPitchEvaluation {
249
+ sourceSamples: Float64Array;
250
+ measuredMidi: Float64Array;
251
+ targetMidi: Float64Array;
252
+ effectiveMidi: Float64Array;
253
+ voiced: Uint8Array;
254
+ hasTarget: Uint8Array;
255
+ }
256
+
257
+ export interface VocalRenderRequest {
258
+ /** Omit to render the complete destination output. */
259
+ range?: VocalRange;
260
+ requestId?: VocalUint64;
261
+ signal?: AbortSignal;
262
+ }
263
+
264
+ export interface VocalRenderResult {
265
+ samples: Float32Array;
266
+ startSample: number;
267
+ token: VocalStateToken;
268
+ processedRanges: readonly VocalRange[];
269
+ cacheHitUnits: VocalUint64;
270
+ dryPassedFrames: VocalUint64;
271
+ limitedCorrectionFrames: VocalUint64;
272
+ }
273
+
274
+ export interface VocalStateBytes {
275
+ data: Uint8Array;
276
+ }
277
+
278
+ export interface VocalJobProgress {
279
+ complete: boolean;
280
+ }
281
+
282
+ export interface VocalErrorShape {
283
+ readonly reason: number;
284
+ readonly field: string;
285
+ readonly expected: VocalUint64;
286
+ readonly actual: VocalUint64;
287
+ readonly expectedText: string;
288
+ readonly actualText: string;
289
+ }
@@ -0,0 +1,69 @@
1
+ import type { VocalStateToken, VocalUint64 } from './public_types_vocal_edit';
2
+
3
+ /** A full source render and persisted vocal session ready for Project apply. */
4
+ export interface ProjectVocalEditApplyRequest {
5
+ clipId: number;
6
+ /** Zero selects the clip's base source; a non-zero id selects a take. */
7
+ takeId?: number;
8
+ expectedSourceId: number;
9
+ expectedSourceSampleRate: number;
10
+ expectedSourceSampleCount: number;
11
+ /** Canonical source digest as exactly 64 hexadecimal characters. */
12
+ expectedSourceSha256: string;
13
+ expectedClipLengthPpq: number;
14
+ expectedSourceOffsetPpq: number;
15
+ /** Full-source mono render. The v1 Project adapter requires startSample 0. */
16
+ renderedMono: Float32Array;
17
+ renderedSampleRate: number;
18
+ renderedStartSample?: number;
19
+ renderToken: VocalStateToken;
20
+ /** SVE1 state exported from the committed vocal edit session. */
21
+ sve1: Uint8Array;
22
+ }
23
+
24
+ export interface ProjectVocalEditApplyResult {
25
+ clipId: number;
26
+ takeId: number;
27
+ originalSourceId: number;
28
+ derivedSourceId: number;
29
+ committedRevision: VocalUint64;
30
+ profileId: number;
31
+ derivedSourceSha256: string;
32
+ sidecarKey: string;
33
+ }
34
+
35
+ export type ProjectVocalReason = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
36
+
37
+ export interface ProjectVocalEditDependency {
38
+ clipId: number;
39
+ takeId: number;
40
+ originalSourceId: number;
41
+ derivedSourceId: number;
42
+ sourceSampleRate: number;
43
+ profileId: number;
44
+ sourceSampleCount: number;
45
+ committedRevision: VocalUint64;
46
+ originalSourceSha256: string;
47
+ derivedSourceSha256: string;
48
+ originalPcmAvailable: boolean;
49
+ derivedPcmAvailable: boolean;
50
+ reason: ProjectVocalReason | number;
51
+ sidecarKey: string;
52
+ }
53
+
54
+ export interface ProjectVocalOriginalSource {
55
+ sourceId: number;
56
+ mono: Float32Array;
57
+ sampleRate: number;
58
+ }
59
+
60
+ /** Native status values from SonareProjectVocalRehydrateStatus. */
61
+ export type ProjectVocalRehydrateStatus = 0 | 1 | 2;
62
+
63
+ export interface ProjectVocalRehydrateItem {
64
+ clipId: number;
65
+ takeId: number;
66
+ derivedSourceId: number;
67
+ status: ProjectVocalRehydrateStatus;
68
+ reason: ProjectVocalReason | number;
69
+ }
@@ -12,16 +12,24 @@ import type {
12
12
  ControllerBinding,
13
13
  MpeDimension,
14
14
  NoteTracking,
15
+ PartRigInsert,
16
+ PartRigMode,
15
17
  ProjectMidiCcBinding,
16
18
  SynthPatch,
17
19
  } from './project';
18
- import { normalizeSynthInstrument } from './project_internal';
20
+ import type { ProjectTimeline } from './project_class';
21
+ import {
22
+ normalizeSynthInstrument,
23
+ partRigInsertsJson,
24
+ projectTimelineNativeId,
25
+ } from './project_internal';
19
26
  import type {
20
27
  EqBand,
21
28
  PanLawInput,
22
29
  PanMode,
23
30
  SendTiming,
24
31
  SidechainSourceKind,
32
+ SurroundPan,
25
33
  UmpWords,
26
34
  } from './public_types';
27
35
  import type {
@@ -576,6 +584,23 @@ export class RealtimeEngine {
576
584
  this.native.setArticulation(destinationId, channel, articulation);
577
585
  }
578
586
 
587
+ /**
588
+ * Set the rig of one part (0-15), or of the destination's default when `part`
589
+ * is `PART_RIG_ALL_PARTS`, on the instrument bound to `destinationId`. A
590
+ * direct call, not a stored edit: a destination with no instrument is an
591
+ * invalid parameter, and an instrument without part rigs (a builtin, a
592
+ * host-callback instrument) is refused as not implemented rather than
593
+ * succeeding quietly. `'chain'` takes 1-8 `inserts`; no other mode does.
594
+ */
595
+ setPartRig(
596
+ destinationId: number,
597
+ part: number,
598
+ mode: PartRigMode | number,
599
+ inserts?: PartRigInsert[],
600
+ ): void {
601
+ this.native.setPartRig(destinationId, part, mode, partRigInsertsJson(inserts));
602
+ }
603
+
579
604
  /**
580
605
  * Read back {@link setArticulation} as the canonical name. An ordinal this
581
606
  * build cannot spell is handed back as the number, the way every other enum
@@ -1142,11 +1167,44 @@ export class RealtimeEngine {
1142
1167
  /**
1143
1168
  * Keys one insert of a lane strip from another lane's post-strip audio
1144
1169
  * (ducking/sidechainRouter inserts). sourceTrackId 0 removes the binding.
1170
+ * Lanes are processed in key order and the key is delay-compensated to the
1171
+ * destination strip input, so the result depends on neither the lane order
1172
+ * nor the block size. Throws, leaving the bindings unchanged, for a lane
1173
+ * keying itself, a binding that would close a cycle over the lane bindings,
1174
+ * a full binding table and an alignment past the delay ceiling. Not callable
1175
+ * while a block is being processed.
1145
1176
  */
1146
1177
  setLaneSidechain(trackId: number, insertIndex: number, sourceTrackId: number): void {
1147
1178
  this.native.setLaneSidechain(trackId, insertIndex, sourceTrackId);
1148
1179
  }
1149
1180
 
1181
+ /**
1182
+ * Installs a compiled project timeline into this stopped engine, all or
1183
+ * nothing: tempo and time-signature segments, markers, track lanes, track
1184
+ * automation, audio and MIDI clips, and the per-track strips of the project's
1185
+ * mixer scene are replaced in full (a later low-level setter on those domains
1186
+ * is overwritten by the next apply). Instruments, buses, the master strip,
1187
+ * metronome, loop and capture are not touched; bind instruments separately.
1188
+ *
1189
+ * Throws while the transport is playing, for a timeline the engine cannot
1190
+ * hold, and for a scene strip routed from several tracks. A validation
1191
+ * failure leaves the engine unchanged. The engine keeps its own reference, so
1192
+ * {@link ProjectTimeline.dispose} may follow immediately.
1193
+ *
1194
+ * Also throws on an unprepared engine and on a timeline whose sample rate
1195
+ * differs from the engine's. Once a timeline is applied, a later prepare at
1196
+ * another rate is refused until the timeline's clips are cleared.
1197
+ */
1198
+ applyProjectTimeline(timeline: ProjectTimeline): void {
1199
+ // Resolve through the identity registry so no raw native handle crosses the
1200
+ // facade boundary and the realtime bundle needs no value class import.
1201
+ const timelineId = projectTimelineNativeId(timeline);
1202
+ if (timelineId === undefined) {
1203
+ throw new TypeError('timeline must be a ProjectTimeline instance');
1204
+ }
1205
+ this.native.applyProjectTimeline(timelineId);
1206
+ }
1207
+
1150
1208
  setTrackBuses(buses: EngineBus[]): void {
1151
1209
  // Array.isArray guards a caller-fabricated array-like (e.g. `{ length }`)
1152
1210
  // meant to probe the native array-length read: passing it through
@@ -1441,12 +1499,9 @@ export class RealtimeEngine {
1441
1499
  * return `-1`: they resize voice pools or swap DSP topology, which is not
1442
1500
  * audio-thread safe. Rebind the instrument with a new patch instead.
1443
1501
  *
1444
- * `gain`, `busDrive`, `cutoffHz`, `resonanceQ`, `envToCutoffCents`,
1445
- * `lfoToPitchCents` and `pitchOffsetCents` reach voices that are already
1446
- * sounding from the next block; the rest are cached into per-voice state at
1447
- * note-on and take effect from the next note, so a lane that moves one of
1448
- * them under a held note looks inert until the next one speaks — that is the
1449
- * behaviour, not a dropped write.
1502
+ * All automatable parameters of a NativeSynth reach already-sounding voices
1503
+ * from the next processed block. Voices using GM program patches are
1504
+ * unaffected; parameters apply to NativeSynth's own patch only.
1450
1505
  *
1451
1506
  * The id survives an unbind/rebind of the same destination and applies
1452
1507
  * nothing while that destination is unbound.
@@ -1475,6 +1530,17 @@ export class RealtimeEngine {
1475
1530
  this.native.setTrackStripDualPan(trackId, leftPan, rightPan);
1476
1531
  }
1477
1532
 
1533
+ /**
1534
+ * Sets a track lane strip's surround placement in realtime (glitch-free; a
1535
+ * constant-power 5 ms one-pole glide). Used when the destination has more than
1536
+ * two channels. Omitted fields default to a centered point source
1537
+ * (`distance` 1); a `distance` of 0 or less is treated as 1. Throws for an
1538
+ * unknown track, a track without a lane strip, or a non-finite field.
1539
+ */
1540
+ setTrackStripSurroundPan(trackId: number, pan: SurroundPan): void {
1541
+ this.native.setTrackStripSurroundPan(trackId, pan);
1542
+ }
1543
+
1478
1544
  /**
1479
1545
  * Sets a bus strip's output pan position in realtime (glitch-free). Throws
1480
1546
  * for an unknown bus or one wider than stereo.
@@ -1499,8 +1565,9 @@ export class RealtimeEngine {
1499
1565
  }
1500
1566
 
1501
1567
  /**
1502
- * Sets a track lane strip's inter-channel alignment delay (whole samples).
1503
- * Adjusts strip latency, so PDC and reported graph latency are refreshed.
1568
+ * Sets a track lane strip's alignment delay (whole samples), moving this lane
1569
+ * later relative to every other lane. It is not latency: PDC does not
1570
+ * compensate it and the reported graph latency is unchanged.
1504
1571
  */
1505
1572
  setTrackStripChannelDelaySamples(trackId: number, delaySamples: number): void {
1506
1573
  this.native.setTrackStripChannelDelaySamples(trackId, delaySamples);
@@ -1833,6 +1900,16 @@ export class RealtimeEngine {
1833
1900
  return this.native.drainMeterTelemetryWide(maxRecords);
1834
1901
  }
1835
1902
 
1903
+ /**
1904
+ * Per-insert gain reduction in dB (each <= 0) of a meter target's strip from the
1905
+ * last rendered block, in combined pre-to-post insert order. `targetId` uses the
1906
+ * meter-record encoding (0 master, 1..32 lanes, 33..40 buses; 0xFFFF monitor
1907
+ * yields an empty array). Throws for an id outside that range.
1908
+ */
1909
+ meterTargetInsertGainReduction(targetId: number): number[] {
1910
+ return this.native.meterTargetInsertGainReduction(targetId);
1911
+ }
1912
+
1836
1913
  /**
1837
1914
  * Enables per-target spectrum + vectorscope capture. @param intervalFrames is
1838
1915
  * the minimum render-frame gap between snapshots (0 disables). @param bandCount
@@ -19,6 +19,7 @@ export interface DereverbClassicalOptions {
19
19
  threshold?: number;
20
20
  attenuation?: number;
21
21
  nFft?: number;
22
+ /** Hop in samples, in (0, nFft / 2]. */
22
23
  hopLength?: number;
23
24
  t60Sec?: number;
24
25
  lateDelayMs?: number;
@@ -26,6 +26,7 @@ export interface DenoiseClassicalOptions {
26
26
  mode?: DenoiseClassicalMode;
27
27
  noiseEstimator?: DenoiseClassicalNoiseEstimator;
28
28
  nFft?: number;
29
+ /** Hop in samples, in (0, nFft / 2]. */
29
30
  hopLength?: number;
30
31
  ddAlpha?: number;
31
32
  reductionDb?: number;
@@ -25,6 +25,7 @@ import type {
25
25
  SpectralRegionOp,
26
26
  SurroundPan,
27
27
  } from './public_types';
28
+ import type { VocalWasmExports } from './vocal_edit';
28
29
 
29
30
  export interface SonareModuleOptions {
30
31
  locateFile?: (path: string, prefix: string) => string;
@@ -1288,7 +1289,17 @@ export interface WasmEngineBounceOptions {
1288
1289
  totalFrames: number;
1289
1290
  blockSize?: number;
1290
1291
  numChannels?: number;
1292
+ /**
1293
+ * Output sample rate. Omitting it (or `0`) keeps the source rate, so nothing
1294
+ * is resampled; a different rate resamples. The result's `sampleRate`
1295
+ * reports the rate of the returned audio.
1296
+ */
1291
1297
  targetSampleRate?: number;
1298
+ /**
1299
+ * Rate `totalFrames` is counted in. Omitting it (or `0`) means the engine's
1300
+ * prepared rate; a different value throws an `InvalidParameter` `SonareError`,
1301
+ * because the render always runs at the prepared rate.
1302
+ */
1292
1303
  sourceSampleRate?: number;
1293
1304
  normalizeLufs?: boolean;
1294
1305
  /**
@@ -1413,6 +1424,7 @@ export interface WasmRealtimeEngine {
1413
1424
  clipCount: () => number;
1414
1425
  setTrackLanes: (lanes: Array<number | WasmEngineTrackLane>) => void;
1415
1426
  setLaneSidechain: (trackId: number, insertIndex: number, sourceTrackId: number) => void;
1427
+ applyProjectTimeline: (timelineId: number) => void;
1416
1428
  setTrackBuses: (buses: WasmEngineBus[]) => void;
1417
1429
  setBusSidechain: (
1418
1430
  busId: number,
@@ -1506,6 +1518,7 @@ export interface WasmRealtimeEngine {
1506
1518
  setTrackStripPanLaw: (trackId: number, panLaw: number) => void;
1507
1519
  setTrackStripPanMode: (trackId: number, panMode: number) => void;
1508
1520
  setTrackStripDualPan: (trackId: number, leftPan: number, rightPan: number) => void;
1521
+ setTrackStripSurroundPan: (trackId: number, pan: SurroundPan) => void;
1509
1522
  setBusStripPan: (busId: number, pan: number) => void;
1510
1523
  setBusStripPanLaw: (busId: number, panLaw: number) => void;
1511
1524
  setBusStripPanMode: (busId: number, panMode: number) => void;
@@ -1579,6 +1592,12 @@ export interface WasmRealtimeEngine {
1579
1592
  channel: number,
1580
1593
  ) => import('./instrument_types').Articulation | number;
1581
1594
  legatoFallbackCount: (destinationId: number) => number;
1595
+ setPartRig: (
1596
+ destinationId: number,
1597
+ part: number,
1598
+ mode: import('./instrument_types').PartRigMode | number,
1599
+ insertsJson: string | undefined,
1600
+ ) => void;
1582
1601
  setMidiFx: (destinationId: number, configJson: string) => void;
1583
1602
  clearMidiFx: (destinationId: number) => void;
1584
1603
  setMidiInputSource: (destinationId: number) => void;
@@ -1726,6 +1745,7 @@ export interface WasmRealtimeEngine {
1726
1745
  meterScratchInputPeakDbR: () => number;
1727
1746
  drainMeterTelemetry: (maxRecords: number) => WasmEngineMeterTelemetry[];
1728
1747
  drainMeterTelemetryWide: (maxRecords: number) => WasmEngineMeterTelemetryWide[];
1748
+ meterTargetInsertGainReduction: (targetId: number) => number[];
1729
1749
  configureScopeTelemetry: (intervalFrames: number, bandCount: number) => number;
1730
1750
  drainScopeTelemetry: (maxRecords: number) => WasmEngineScopeTelemetry[];
1731
1751
  popScopeTelemetryToScratch: () => boolean;
@@ -1759,6 +1779,39 @@ export interface WasmSynthEnumTables {
1759
1779
  }
1760
1780
 
1761
1781
  export interface SonareModule {
1782
+ vocalEditApiVersion: VocalWasmExports['vocalEditApiVersion'];
1783
+ vocalEditAvailable: VocalWasmExports['vocalEditAvailable'];
1784
+ vocalEditSessionCreate: VocalWasmExports['vocalEditSessionCreate'];
1785
+ vocalEditSessionRestore: VocalWasmExports['vocalEditSessionRestore'];
1786
+ vocalEditSessionDestroy: VocalWasmExports['vocalEditSessionDestroy'];
1787
+ vocalEditSessionNotes: VocalWasmExports['vocalEditSessionNotes'];
1788
+ vocalEditDraftNotes: VocalWasmExports['vocalEditDraftNotes'];
1789
+ vocalEditSessionToken: VocalWasmExports['vocalEditSessionToken'];
1790
+ vocalEditDraftToken: VocalWasmExports['vocalEditDraftToken'];
1791
+ vocalEditSessionAnalysis: VocalWasmExports['vocalEditSessionAnalysis'];
1792
+ vocalEditSessionCapabilities: VocalWasmExports['vocalEditSessionCapabilities'];
1793
+ vocalEditSessionOutputLength: VocalWasmExports['vocalEditSessionOutputLength'];
1794
+ vocalEditSessionHistory: VocalWasmExports['vocalEditSessionHistory'];
1795
+ vocalEditSessionBeginEdit: VocalWasmExports['vocalEditSessionBeginEdit'];
1796
+ vocalEditDraftApply: VocalWasmExports['vocalEditDraftApply'];
1797
+ vocalEditDraftCommit: VocalWasmExports['vocalEditDraftCommit'];
1798
+ vocalEditDraftCancel: VocalWasmExports['vocalEditDraftCancel'];
1799
+ vocalEditDraftDestroy: VocalWasmExports['vocalEditDraftDestroy'];
1800
+ vocalEditSessionApplyHistory: VocalWasmExports['vocalEditSessionApplyHistory'];
1801
+ vocalEditEvaluatePitch: VocalWasmExports['vocalEditEvaluatePitch'];
1802
+ vocalEditMapCoordinate: VocalWasmExports['vocalEditMapCoordinate'];
1803
+ vocalEditCaptureSnapshot: VocalWasmExports['vocalEditCaptureSnapshot'];
1804
+ vocalEditSnapshotDestroy: VocalWasmExports['vocalEditSnapshotDestroy'];
1805
+ vocalEditSnapshotOutputLength: VocalWasmExports['vocalEditSnapshotOutputLength'];
1806
+ vocalEditSnapshotRender: VocalWasmExports['vocalEditSnapshotRender'];
1807
+ vocalEditRenderJobBegin: VocalWasmExports['vocalEditRenderJobBegin'];
1808
+ vocalEditRenderJobNext: VocalWasmExports['vocalEditRenderJobNext'];
1809
+ vocalEditRenderJobFinalize: VocalWasmExports['vocalEditRenderJobFinalize'];
1810
+ vocalEditRenderJobAbort: VocalWasmExports['vocalEditRenderJobAbort'];
1811
+ vocalEditRenderJobDestroy: VocalWasmExports['vocalEditRenderJobDestroy'];
1812
+ vocalEditSessionExportState: VocalWasmExports['vocalEditSessionExportState'];
1813
+ vocalEditLastErrorDetail: VocalWasmExports['vocalEditLastErrorDetail'];
1814
+
1762
1815
  audioFromMemory: (bytes: Uint8Array) => WasmAudioFromMemoryResult;
1763
1816
 
1764
1817
  // Quick API (high-level)