@libraz/libsonare 1.7.2 → 1.8.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.
Files changed (303) hide show
  1. package/NOTICE +178 -0
  2. package/README.md +26 -203
  3. package/dist/_chain_config.d.ts +14 -0
  4. package/dist/_chain_config.d.ts.map +1 -0
  5. package/dist/_effects_common.d.ts +6 -0
  6. package/dist/_effects_common.d.ts.map +1 -0
  7. package/dist/_feature_validation.d.ts +8 -0
  8. package/dist/_feature_validation.d.ts.map +1 -0
  9. package/dist/_fft_options.d.ts +24 -0
  10. package/dist/_fft_options.d.ts.map +1 -0
  11. package/dist/align_take.d.ts +50 -0
  12. package/dist/align_take.d.ts.map +1 -0
  13. package/dist/analysis.d.ts +29 -5840
  14. package/dist/analysis.d.ts.map +1 -0
  15. package/dist/analysis.js +873 -722
  16. package/dist/analysis.js.map +1 -1
  17. package/dist/analysis_helpers.d.ts +9 -0
  18. package/dist/analysis_helpers.d.ts.map +1 -0
  19. package/dist/audio.d.ts +163 -0
  20. package/dist/audio.d.ts.map +1 -0
  21. package/dist/clip_page_streamer.d.ts +133 -0
  22. package/dist/clip_page_streamer.d.ts.map +1 -0
  23. package/dist/codes.d.ts +44 -0
  24. package/dist/codes.d.ts.map +1 -0
  25. package/dist/effects_mastering.d.ts +23 -0
  26. package/dist/effects_mastering.d.ts.map +1 -0
  27. package/dist/effects_note_ops.d.ts +477 -0
  28. package/dist/effects_note_ops.d.ts.map +1 -0
  29. package/dist/effects_percussive.d.ts +185 -0
  30. package/dist/effects_percussive.d.ts.map +1 -0
  31. package/dist/effects_separation.d.ts +65 -0
  32. package/dist/effects_separation.d.ts.map +1 -0
  33. package/dist/effects_spectral.d.ts +28 -0
  34. package/dist/effects_spectral.d.ts.map +1 -0
  35. package/dist/effects_timepitch.d.ts +129 -0
  36. package/dist/effects_timepitch.d.ts.map +1 -0
  37. package/dist/effects_voice_change.d.ts +53 -0
  38. package/dist/effects_voice_change.d.ts.map +1 -0
  39. package/dist/errors.d.ts +51 -0
  40. package/dist/errors.d.ts.map +1 -0
  41. package/dist/feature_core.d.ts +341 -0
  42. package/dist/feature_core.d.ts.map +1 -0
  43. package/dist/feature_decompose.d.ts +278 -0
  44. package/dist/feature_decompose.d.ts.map +1 -0
  45. package/dist/feature_inverse.d.ts +128 -0
  46. package/dist/feature_inverse.d.ts.map +1 -0
  47. package/dist/feature_loudness.d.ts +66 -0
  48. package/dist/feature_loudness.d.ts.map +1 -0
  49. package/dist/feature_music.d.ts +307 -0
  50. package/dist/feature_music.d.ts.map +1 -0
  51. package/dist/feature_pitch.d.ts +108 -0
  52. package/dist/feature_pitch.d.ts.map +1 -0
  53. package/dist/feature_resample.d.ts +16 -0
  54. package/dist/feature_resample.d.ts.map +1 -0
  55. package/dist/feature_spectral.d.ts +137 -0
  56. package/dist/feature_spectral.d.ts.map +1 -0
  57. package/dist/feature_spectrogram.d.ts +198 -0
  58. package/dist/feature_spectrogram.d.ts.map +1 -0
  59. package/dist/features.d.ts +10 -0
  60. package/dist/features.d.ts.map +1 -0
  61. package/dist/hrtf/default.shrf +0 -0
  62. package/dist/index.d.ts +74 -7431
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +3758 -1362
  65. package/dist/index.js.map +1 -1
  66. package/dist/instrument_types.d.ts +517 -0
  67. package/dist/instrument_types.d.ts.map +1 -0
  68. package/dist/live_audio.d.ts +35 -0
  69. package/dist/live_audio.d.ts.map +1 -0
  70. package/dist/mastering_chain.d.ts +213 -0
  71. package/dist/mastering_chain.d.ts.map +1 -0
  72. package/dist/mastering_core.d.ts +457 -0
  73. package/dist/mastering_core.d.ts.map +1 -0
  74. package/dist/mastering_dynamics.d.ts +80 -0
  75. package/dist/mastering_dynamics.d.ts.map +1 -0
  76. package/dist/metering.d.ts +287 -0
  77. package/dist/metering.d.ts.map +1 -0
  78. package/dist/mixer.d.ts +464 -0
  79. package/dist/mixer.d.ts.map +1 -0
  80. package/dist/mixing_assistant.d.ts +62 -0
  81. package/dist/mixing_assistant.d.ts.map +1 -0
  82. package/dist/mixing_oneshot.d.ts +40 -0
  83. package/dist/mixing_oneshot.d.ts.map +1 -0
  84. package/dist/module_state.d.ts +15 -0
  85. package/dist/module_state.d.ts.map +1 -0
  86. package/dist/opfs_clip_pages.d.ts +28 -0
  87. package/dist/opfs_clip_pages.d.ts.map +1 -0
  88. package/dist/playback_renderer.d.ts +128 -0
  89. package/dist/playback_renderer.d.ts.map +1 -0
  90. package/dist/polyphony.d.ts +202 -0
  91. package/dist/polyphony.d.ts.map +1 -0
  92. package/dist/project.d.ts +8 -0
  93. package/dist/project.d.ts.map +1 -0
  94. package/dist/project_class.d.ts +562 -0
  95. package/dist/project_class.d.ts.map +1 -0
  96. package/dist/project_internal.d.ts +194 -0
  97. package/dist/project_internal.d.ts.map +1 -0
  98. package/dist/project_synth.d.ts +74 -0
  99. package/dist/project_synth.d.ts.map +1 -0
  100. package/dist/project_types.d.ts +652 -0
  101. package/dist/project_types.d.ts.map +1 -0
  102. package/dist/public_types.d.ts +185 -0
  103. package/dist/public_types.d.ts.map +1 -0
  104. package/dist/public_types_acoustic.d.ts +215 -0
  105. package/dist/public_types_acoustic.d.ts.map +1 -0
  106. package/dist/public_types_mastering.d.ts +510 -0
  107. package/dist/public_types_mastering.d.ts.map +1 -0
  108. package/dist/public_types_mixing.d.ts +436 -0
  109. package/dist/public_types_mixing.d.ts.map +1 -0
  110. package/dist/public_types_music.d.ts +619 -0
  111. package/dist/public_types_music.d.ts.map +1 -0
  112. package/dist/public_types_playback.d.ts +164 -0
  113. package/dist/public_types_playback.d.ts.map +1 -0
  114. package/dist/public_types_realtime.d.ts +174 -0
  115. package/dist/public_types_realtime.d.ts.map +1 -0
  116. package/dist/public_types_repair.d.ts +424 -0
  117. package/dist/public_types_repair.d.ts.map +1 -0
  118. package/dist/public_types_spectral.d.ts +697 -0
  119. package/dist/public_types_spectral.d.ts.map +1 -0
  120. package/dist/quick_analysis.d.ts +445 -0
  121. package/dist/quick_analysis.d.ts.map +1 -0
  122. package/dist/realtime_engine.d.ts +850 -0
  123. package/dist/realtime_engine.d.ts.map +1 -0
  124. package/dist/realtime_voice_changer.d.ts +158 -0
  125. package/dist/realtime_voice_changer.d.ts.map +1 -0
  126. package/dist/repair_dereverb.d.ts +187 -0
  127. package/dist/repair_dereverb.d.ts.map +1 -0
  128. package/dist/repair_impulsive.d.ts +186 -0
  129. package/dist/repair_impulsive.d.ts.map +1 -0
  130. package/dist/repair_noise.d.ts +239 -0
  131. package/dist/repair_noise.d.ts.map +1 -0
  132. package/dist/repair_trim.d.ts +123 -0
  133. package/dist/repair_trim.d.ts.map +1 -0
  134. package/dist/sample_bank.d.ts +84 -0
  135. package/dist/sample_bank.d.ts.map +1 -0
  136. package/dist/scale.d.ts +10 -0
  137. package/dist/scale.d.ts.map +1 -0
  138. package/dist/schemas/mixer-scene.schema.json +393 -0
  139. package/dist/schemas/playback-renderer-config.schema.json +392 -0
  140. package/dist/sonare-analysis.d.ts +8 -0
  141. package/dist/sonare-analysis.js +2 -2
  142. package/dist/sonare-analysis.wasm +0 -0
  143. package/dist/sonare.d.ts +3909 -0
  144. package/dist/sonare.js +2 -2
  145. package/dist/sonare.wasm +0 -0
  146. package/dist/stream_analyzer.d.ts +163 -0
  147. package/dist/stream_analyzer.d.ts.map +1 -0
  148. package/dist/stream_types.d.ts +214 -0
  149. package/dist/stream_types.d.ts.map +1 -0
  150. package/dist/streaming_mixing.d.ts +6 -0
  151. package/dist/streaming_mixing.d.ts.map +1 -0
  152. package/dist/streaming_processors.d.ts +335 -0
  153. package/dist/streaming_processors.d.ts.map +1 -0
  154. package/dist/transcribe.d.ts +77 -0
  155. package/dist/transcribe.d.ts.map +1 -0
  156. package/dist/validation.d.ts +140 -0
  157. package/dist/validation.d.ts.map +1 -0
  158. package/dist/web_midi.d.ts +77 -0
  159. package/dist/web_midi.d.ts.map +1 -0
  160. package/dist/worker.d.ts +5 -48
  161. package/dist/worker.d.ts.map +1 -0
  162. package/dist/worker.js +94 -41
  163. package/dist/worker.js.map +1 -1
  164. package/dist/worker_client.d.ts +96 -0
  165. package/dist/worker_client.d.ts.map +1 -0
  166. package/dist/worker_protocol.d.ts +43 -0
  167. package/dist/worker_protocol.d.ts.map +1 -0
  168. package/dist/worklet/audio_types.d.ts +21 -0
  169. package/dist/worklet/audio_types.d.ts.map +1 -0
  170. package/dist/worklet/engine-automation.d.ts +29 -0
  171. package/dist/worklet/engine-automation.d.ts.map +1 -0
  172. package/dist/worklet/engine-capture-facade.d.ts +35 -0
  173. package/dist/worklet/engine-capture-facade.d.ts.map +1 -0
  174. package/dist/worklet/engine-clips.d.ts +23 -0
  175. package/dist/worklet/engine-clips.d.ts.map +1 -0
  176. package/dist/worklet/engine-markers.d.ts +40 -0
  177. package/dist/worklet/engine-markers.d.ts.map +1 -0
  178. package/dist/worklet/engine-mixer-facade.d.ts +128 -0
  179. package/dist/worklet/engine-mixer-facade.d.ts.map +1 -0
  180. package/dist/worklet/engine-node.d.ts +81 -0
  181. package/dist/worklet/engine-node.d.ts.map +1 -0
  182. package/dist/worklet/engine-offline.d.ts +81 -0
  183. package/dist/worklet/engine-offline.d.ts.map +1 -0
  184. package/dist/worklet/engine-options.d.ts +12 -0
  185. package/dist/worklet/engine-options.d.ts.map +1 -0
  186. package/dist/worklet/engine-parameter-facade.d.ts +106 -0
  187. package/dist/worklet/engine-parameter-facade.d.ts.map +1 -0
  188. package/dist/worklet/engine-processor.d.ts +68 -0
  189. package/dist/worklet/engine-processor.d.ts.map +1 -0
  190. package/dist/worklet/engine-register.d.ts +2 -0
  191. package/dist/worklet/engine-register.d.ts.map +1 -0
  192. package/dist/worklet/engine-strips.d.ts +73 -0
  193. package/dist/worklet/engine-strips.d.ts.map +1 -0
  194. package/dist/worklet/engine-sync.d.ts +37 -0
  195. package/dist/worklet/engine-sync.d.ts.map +1 -0
  196. package/dist/worklet/engine-tempo-facade.d.ts +48 -0
  197. package/dist/worklet/engine-tempo-facade.d.ts.map +1 -0
  198. package/dist/worklet/engine.d.ts +397 -0
  199. package/dist/worklet/engine.d.ts.map +1 -0
  200. package/dist/worklet/guards.d.ts +47 -0
  201. package/dist/worklet/guards.d.ts.map +1 -0
  202. package/dist/worklet/messages.d.ts +710 -0
  203. package/dist/worklet/messages.d.ts.map +1 -0
  204. package/dist/worklet/mixer-processor.d.ts +46 -0
  205. package/dist/worklet/mixer-processor.d.ts.map +1 -0
  206. package/dist/worklet/playback-processor.d.ts +62 -0
  207. package/dist/worklet/playback-processor.d.ts.map +1 -0
  208. package/dist/worklet/protocol.d.ts +323 -0
  209. package/dist/worklet/protocol.d.ts.map +1 -0
  210. package/dist/worklet/voice-changer-processor.d.ts +41 -0
  211. package/dist/worklet/voice-changer-processor.d.ts.map +1 -0
  212. package/dist/worklet.d.ts +16 -2515
  213. package/dist/worklet.d.ts.map +1 -0
  214. package/dist/worklet.js +2763 -501
  215. package/dist/worklet.js.map +1 -1
  216. package/package.json +23 -12
  217. package/src/_effects_common.ts +17 -0
  218. package/src/_feature_validation.ts +34 -0
  219. package/src/_fft_options.ts +39 -0
  220. package/src/align_take.ts +64 -0
  221. package/src/analysis.ts +56 -3
  222. package/src/analysis_helpers.ts +7 -0
  223. package/src/audio.ts +106 -3
  224. package/src/codes.ts +39 -2
  225. package/src/effects_mastering.ts +97 -22
  226. package/src/effects_note_ops.ts +635 -0
  227. package/src/effects_percussive.ts +217 -0
  228. package/src/effects_separation.ts +150 -0
  229. package/src/effects_spectral.ts +60 -0
  230. package/src/effects_timepitch.ts +377 -0
  231. package/src/errors.ts +23 -1
  232. package/src/feature_core.ts +127 -2
  233. package/src/feature_decompose.ts +633 -0
  234. package/src/feature_inverse.ts +454 -0
  235. package/src/feature_loudness.ts +125 -0
  236. package/src/feature_music.ts +107 -14
  237. package/src/feature_pitch.ts +96 -1
  238. package/src/feature_spectral.ts +16 -611
  239. package/src/feature_spectrogram.ts +63 -450
  240. package/src/features.ts +36 -22
  241. package/src/index.ts +282 -30
  242. package/src/instrument_types.ts +645 -0
  243. package/src/live_audio.ts +27 -1
  244. package/src/mastering_chain.ts +184 -0
  245. package/src/mastering_core.ts +346 -32
  246. package/src/mastering_dynamics.ts +22 -11
  247. package/src/metering.ts +67 -24
  248. package/src/mixer.ts +212 -3
  249. package/src/mixing_assistant.ts +138 -0
  250. package/src/mixing_oneshot.ts +10 -5
  251. package/src/module_state.ts +24 -2
  252. package/src/playback_renderer.ts +252 -0
  253. package/src/polyphony.ts +279 -0
  254. package/src/project.ts +61 -24
  255. package/src/project_class.ts +450 -27
  256. package/src/project_internal.ts +149 -42
  257. package/src/project_synth.ts +67 -1
  258. package/src/project_types.ts +268 -270
  259. package/src/public_types.ts +122 -3
  260. package/src/public_types_acoustic.ts +112 -3
  261. package/src/public_types_mastering.ts +254 -73
  262. package/src/public_types_mixing.ts +363 -1
  263. package/src/public_types_music.ts +312 -2
  264. package/src/public_types_playback.ts +195 -0
  265. package/src/public_types_realtime.ts +39 -7
  266. package/src/public_types_repair.ts +446 -0
  267. package/src/public_types_spectral.ts +487 -1
  268. package/src/quick_analysis.ts +203 -26
  269. package/src/realtime_engine.ts +711 -28
  270. package/src/realtime_voice_changer.ts +55 -1
  271. package/src/repair_dereverb.ts +299 -0
  272. package/src/repair_impulsive.ts +395 -0
  273. package/src/repair_noise.ts +425 -0
  274. package/src/repair_trim.ts +226 -0
  275. package/src/sample_bank.ts +113 -0
  276. package/src/sonare.js.d.ts +1122 -30
  277. package/src/stream_analyzer.ts +36 -4
  278. package/src/stream_types.ts +37 -0
  279. package/src/streaming_mixing.ts +1 -1
  280. package/src/streaming_processors.ts +194 -10
  281. package/src/transcribe.ts +89 -0
  282. package/src/validation.ts +285 -11
  283. package/src/web_midi.ts +1 -6
  284. package/src/worker.ts +18 -2
  285. package/src/worklet/audio_types.ts +37 -0
  286. package/src/worklet/engine-mixer-facade.ts +444 -10
  287. package/src/worklet/engine-node.ts +78 -26
  288. package/src/worklet/engine-offline.ts +14 -8
  289. package/src/worklet/engine-parameter-facade.ts +21 -0
  290. package/src/worklet/engine-processor.ts +272 -83
  291. package/src/worklet/engine-register.ts +32 -18
  292. package/src/worklet/engine-strips.ts +280 -9
  293. package/src/worklet/engine-sync.ts +14 -6
  294. package/src/worklet/engine.ts +365 -31
  295. package/src/worklet/guards.ts +140 -44
  296. package/src/worklet/messages.ts +227 -2
  297. package/src/worklet/mixer-processor.ts +109 -47
  298. package/src/worklet/playback-processor.ts +300 -0
  299. package/src/worklet/protocol.ts +53 -3
  300. package/src/worklet/voice-changer-processor.ts +17 -11
  301. package/src/worklet.ts +17 -0
  302. package/src/effects_transform.ts +0 -718
  303. package/src/mastering_repair.ts +0 -273
@@ -1,3 +1,5 @@
1
+ import type { EqBand } from './public_types_realtime';
2
+
1
3
  export type PanMode =
2
4
  | 'balance'
3
5
  | 'pan'
@@ -48,8 +50,18 @@ export interface MixMeterSnapshot {
48
50
  shortTermLufs: number;
49
51
  integratedLufs: number;
50
52
  gainReductionDb: number;
53
+ /**
54
+ * Left-channel inter-sample (true) peak in dB, from the ITU-R BS.1770-4
55
+ * polyphase reconstruction at 4x. A streaming measurement: the centered
56
+ * reconstruction stencil needs a few future samples a realtime path does not
57
+ * have, so each block's last samples read marginally low (about 0.1 dB across
58
+ * 64..8192-sample blocks on a near-Nyquist tone, always under-reading). Use
59
+ * `meteringTruePeakDb` over the whole signal for an exact dBTP number.
60
+ */
51
61
  truePeakDbL: number;
62
+ /** Right-channel inter-sample (true) peak in dB. See {@link truePeakDbL}. */
52
63
  truePeakDbR: number;
64
+ /** Maximum inter-sample peak across channels in dB. See {@link truePeakDbL}. */
53
65
  maxTruePeakDb: number;
54
66
  seq: number;
55
67
  /** Number of valid surround planes (5.1/7.1); 0 before the meter sees audio. */
@@ -58,7 +70,10 @@ export interface MixMeterSnapshot {
58
70
  peakDb: number[];
59
71
  /** Per-plane RMS dB, length channelCount; [0]/[1] mirror rmsDbL/rmsDbR. */
60
72
  rmsDb: number[];
61
- /** Per-plane true-peak dB, length channelCount; [0]/[1] mirror truePeakDbL/R. */
73
+ /**
74
+ * Per-plane true-peak dB, length channelCount; [0]/[1] mirror
75
+ * {@link truePeakDbL}/R and carry the same streaming caveat.
76
+ */
62
77
  truePeakDb: number[];
63
78
  }
64
79
 
@@ -115,8 +130,355 @@ export type MeterTap = 'preFader' | 'postFader';
115
130
  /** Pre/post-fader send timing (see {@link Mixer.addSend}). */
116
131
  export type SendTiming = 'preFader' | 'postFader';
117
132
 
133
+ /**
134
+ * Source a bus or master insert's sidechain key is taken from: a track lane's
135
+ * post-strip signal, or a bus's signal before its `gainDb`.
136
+ */
137
+ export type SidechainSourceKind = 'track' | 'bus';
138
+
118
139
  /** A single goniometer (left/right) sample returned by {@link Mixer.readGoniometerLatest}. */
119
140
  export interface GoniometerPoint {
120
141
  left: number;
121
142
  right: number;
122
143
  }
144
+
145
+ /** One analysis band of the mixing assistant's shared 7-band split. */
146
+ export type MixAnalysisBand = 'sub' | 'low' | 'lowMid' | 'mid' | 'highMid' | 'high' | 'air';
147
+
148
+ /** Share of a track's energy in each analysis band; sums to 1, or to 0 when silent. */
149
+ export type MixBandOccupancy = Record<MixAnalysisBand, number>;
150
+
151
+ /**
152
+ * One track handed to {@link suggestMixScene}.
153
+ *
154
+ * Planar and per-track: tracks in one call may differ in length, and each is
155
+ * mono (`right` omitted) or stereo independently of the others. A stereo
156
+ * track's `right` must be the same length as its `left`.
157
+ */
158
+ export interface MixAssistantTrack {
159
+ /** Strip id the suggestion is written against. Must be unique and non-empty. */
160
+ id: string;
161
+ /**
162
+ * Optional display name, used as a source-classification hint.
163
+ *
164
+ * Naming the class the classifier measured raises its confidence. Naming
165
+ * another class switches to it when the measurement does not contradict it:
166
+ * a class the classifier measures needs its own feature rule satisfied by the
167
+ * track, and one it cannot measure needs the track not to have been measured
168
+ * as a drum (a drum is never renamed `keys` or `vocal`). For the six classes
169
+ * it cannot separate by measurement — `keys`, `strings`, `lead`, `vocal`,
170
+ * `backing` and `fx` — the name is the only thing that can supply the class,
171
+ * so an unnamed voice, pad or lead line comes back `unknown`. A compound name
172
+ * states its last hint word (`'Lead Vox'` is `vocal`, `'Synth Lead'` is
173
+ * `lead`); hint words joined by anything else (`'Strings and Keys'`) state
174
+ * none.
175
+ */
176
+ name?: string;
177
+ /** Left/mono plane. */
178
+ left: Float32Array;
179
+ /** Right plane; omit for a mono track. */
180
+ right?: Float32Array;
181
+ }
182
+
183
+ /**
184
+ * Tunables for {@link suggestMixScene}. Every field is optional and falls back
185
+ * to the core default noted on it; the same field names and defaults are used
186
+ * by the Node and Python surfaces.
187
+ */
188
+ export interface MixAssistantOptions {
189
+ /** Absolute integrated-loudness target each track is staged towards, in LUFS. Defaults to -18. */
190
+ targetTrackLufs?: number;
191
+ /**
192
+ * Overall strength of the suggestion in `[0, 1]`, scaling every level-like
193
+ * decision: trims, fader offsets, send levels, EQ cut depths, compression
194
+ * ratios and ranges, and how far a track is spread from the centre. Defaults
195
+ * to 1.
196
+ *
197
+ * `0` is not an empty suggestion. It is every one of those taken and set to
198
+ * zero, plus the decisions that are not levels and so do not scale: the bus
199
+ * topology and routing, and the physical corrections for a measured
200
+ * cancellation (polarity, alignment delay, low-end mono fold). To suggest
201
+ * nothing, switch the domains off instead — that also skips the work.
202
+ */
203
+ suggestionStrength?: number;
204
+ /** Largest cut a single suggested EQ band may apply, in dB. Defaults to 4. */
205
+ eqMaxCutDb?: number;
206
+ /** Headroom the summed mix is left with on the master bus, in dBTP. Defaults to -6. */
207
+ mixBusHeadroomDbtp?: number;
208
+ /**
209
+ * Tempo the suggested delay times are voiced against, in BPM.
210
+ *
211
+ * Defaults to 0, which selects the transport's own fallback tempo: the
212
+ * assistant is handed bare stems and cannot measure a tempo the set as a
213
+ * whole agrees on. Pass the song's tempo and the delay lands on the beat.
214
+ *
215
+ * A positive value outside 20–400 BPM is rejected rather than clamped.
216
+ */
217
+ tempoBpm?: number;
218
+ /** Evaluate the structure domain. Defaults to true. */
219
+ enableStructure?: boolean;
220
+ /** Evaluate the gain-staging domain. Defaults to true. */
221
+ enableGain?: boolean;
222
+ /** Evaluate the balance domain. Defaults to true. */
223
+ enableBalance?: boolean;
224
+ /** Evaluate the EQ domain. Defaults to true. */
225
+ enableEq?: boolean;
226
+ /** Evaluate the dynamics domain. Defaults to true. */
227
+ enableDynamics?: boolean;
228
+ /** Evaluate the stereo-image domain. Defaults to true. */
229
+ enableImage?: boolean;
230
+ /**
231
+ * Suggest a high-pass filter on tracks carrying residue below their register.
232
+ * Defaults to false.
233
+ *
234
+ * Off by default: a survey of mixing best practices found the rule that every
235
+ * track without low-frequency content should be high-passed to be seldom used
236
+ * in studio mixing and unsupported by subjective testing. Switched on, the
237
+ * filter is proposed from the track's measured low-frequency content rather
238
+ * than from its source class, so a part playing below its class's usual
239
+ * register keeps what it plays.
240
+ */
241
+ enableHighPass?: boolean;
242
+ /** Shared STFT size for every track. Defaults to 2048. */
243
+ nFft?: number;
244
+ /** Shared STFT hop for every track. Defaults to 512. */
245
+ hopLength?: number;
246
+ }
247
+
248
+ /** One processor slot on a scene strip or bus. */
249
+ export interface MixSceneInsert {
250
+ slot: string;
251
+ processor: string;
252
+ /**
253
+ * Processor parameters, keyed by the parameter name the processor's catalog
254
+ * entry declares. Numbers and booleans throughout, except for the two keys a
255
+ * processor reads itself: a string for a named rig or an embedded impulse
256
+ * response, and a per-band array for the acoustic room morph.
257
+ */
258
+ params: Record<string, number | boolean | string | number[]>;
259
+ /** Present only when the insert is keyed off another strip. */
260
+ sidechainKey?: string;
261
+ }
262
+
263
+ /** A strip send to a destination bus. */
264
+ export interface MixSceneSend {
265
+ id: string;
266
+ destinationBusId: string;
267
+ sendDb: number;
268
+ /** Send tap point; one of {@link SendTiming}. */
269
+ timing: string;
270
+ }
271
+
272
+ /** A channel strip in a mixer scene. */
273
+ export interface MixSceneStrip {
274
+ id: string;
275
+ inputTrimDb: number;
276
+ faderDb: number;
277
+ vcaOffsetDb: number;
278
+ pan: number;
279
+ width: number;
280
+ muted: boolean;
281
+ soloed: boolean;
282
+ soloSafe: boolean;
283
+ /** Pan mode as its raw ordinal; the named forms are {@link PanMode}. */
284
+ panMode: number;
285
+ dualPanLeft: number;
286
+ dualPanRight: number;
287
+ polarityInvertLeft: boolean;
288
+ polarityInvertRight: boolean;
289
+ /** Pan law as its raw ordinal; the named forms are {@link PanLaw}. */
290
+ panLaw: number;
291
+ channelDelaySamples: number;
292
+ /** Present only for a non-stereo source. */
293
+ sourceLayout?: string;
294
+ /** Present only when the surround pan has moved off its centered default. */
295
+ surroundPan?: {
296
+ azimuth: number;
297
+ elevation: number;
298
+ divergence: number;
299
+ lfe: number;
300
+ distance: number;
301
+ };
302
+ /**
303
+ * Meter configuration for this strip's pre/post taps. Present only when the
304
+ * strip has opted out of some of its metering; absent means the full default
305
+ * (LUFS + true peak at 4x).
306
+ *
307
+ * Fixed when the mixer is built from the scene: a strip's meters size their
308
+ * buffers up front, so there is no setter for this. A full meter costs about
309
+ * 646 KB at 48 kHz and a strip carries two, so `lufs: false` (about 83 KB per
310
+ * meter) or `enabled: false` (about 145 KB for the whole strip instead of
311
+ * 1.4 MB) is worth setting for strips whose meters are never read.
312
+ */
313
+ metering?: {
314
+ enabled: boolean;
315
+ lufs: boolean;
316
+ truePeak: boolean;
317
+ /** Requested factor; the meter resolves it to the nearest of 2x / 4x / 8x. */
318
+ truePeakOversample: number;
319
+ };
320
+ inserts: MixSceneInsert[];
321
+ sends: MixSceneSend[];
322
+ /**
323
+ * This strip's dedicated equalizer. Present only when it carries something
324
+ * other than the identity (enabled with no bands set), so an existing scene
325
+ * that never touched its EQ stays byte-identical.
326
+ */
327
+ eq?: {
328
+ enabled?: boolean;
329
+ bands: EqBand[];
330
+ };
331
+ }
332
+
333
+ /** A bus in a mixer scene. Defaulted fields are omitted from the document. */
334
+ export interface MixSceneBus {
335
+ id: string;
336
+ role: string;
337
+ layout?: string;
338
+ inputTrimDb?: number;
339
+ width?: number;
340
+ polarityInvertLeft?: boolean;
341
+ polarityInvertRight?: boolean;
342
+ /**
343
+ * Pan, same field names/defaults/ranges as a strip's. Rejected rather than
344
+ * stored when this bus's layout carries more than two channels: a surround
345
+ * bus has no pan of its own.
346
+ */
347
+ pan?: number;
348
+ panMode?: number;
349
+ dualPanLeft?: number;
350
+ dualPanRight?: number;
351
+ panLaw?: number;
352
+ inserts: MixSceneInsert[];
353
+ /** This bus's dedicated equalizer, applied before its inserts. See {@link MixSceneStrip.eq}. */
354
+ eq?: {
355
+ enabled?: boolean;
356
+ bands: EqBand[];
357
+ };
358
+ }
359
+
360
+ /** A VCA group in a mixer scene. */
361
+ export interface MixSceneVcaGroup {
362
+ id: string;
363
+ gainDb: number;
364
+ members: string[];
365
+ }
366
+
367
+ /** A routing edge in a mixer scene. */
368
+ export interface MixSceneConnection {
369
+ source: string;
370
+ destination: string;
371
+ }
372
+
373
+ /**
374
+ * A mixer scene document, in the schema {@link Mixer.fromSceneJson} reads.
375
+ * {@link suggestMixSceneJson} returns the same document as its JSON text.
376
+ */
377
+ export interface MixSceneDocument {
378
+ version: number;
379
+ strips: MixSceneStrip[];
380
+ buses: MixSceneBus[];
381
+ vcaGroups: MixSceneVcaGroup[];
382
+ connections: MixSceneConnection[];
383
+ }
384
+
385
+ /** What the assistant measured about one input track. */
386
+ export interface MixAssistantTrackProfile {
387
+ stripId: string;
388
+ name: string;
389
+ /** Source class identifier; one of {@link mixSourceClassNames}. */
390
+ source: string;
391
+ /** Classifier confidence in `[0, 1]`. */
392
+ sourceConfidence: number;
393
+ /**
394
+ * False when the track could not be measured: it has no samples, a
395
+ * non-positive sample rate, a NaN or Inf sample, is shorter than a gated
396
+ * loudness needs, is silent, or has no energy in the analysis bands. An
397
+ * excluded track gets no suggestions at all rather than suggestions of zero,
398
+ * and the call still succeeds — {@link exclusionReason} names which it was.
399
+ * A non-finite sample is reported as itself rather than as silence, so the
400
+ * reason describes the buffer instead of the material.
401
+ */
402
+ usable: boolean;
403
+ /** Why the track was excluded; empty when {@link usable} is true. */
404
+ exclusionReason: string;
405
+ channelCount: number;
406
+ durationSec: number;
407
+ /**
408
+ * BS.1770 integrated loudness in LUFS, or `null` for a track with no gated
409
+ * block to measure — a silent stem, or one muted before it was handed over.
410
+ * The measurement is `-Infinity` there, which JSON has no number for, so the
411
+ * document carries `null` rather than a finite value that would read as a
412
+ * real level. Such a track always carries an `exclusionReason` as well.
413
+ */
414
+ integratedLufs: number | null;
415
+ truePeakDb: number;
416
+ crestFactorDb: number;
417
+ spectralCentroidHz: number;
418
+ spectralFlatness: number;
419
+ attackDensity: number;
420
+ sustainRatio: number;
421
+ bandOccupancy: MixBandOccupancy;
422
+ }
423
+
424
+ /** One informative band-masking relationship between two tracks. */
425
+ export interface MixBandDominance {
426
+ /** Strip id of the masking track. */
427
+ masker: string;
428
+ /** Strip id of the masked track. */
429
+ maskee: string;
430
+ band: MixAnalysisBand;
431
+ ratio: number;
432
+ validFrames: number;
433
+ }
434
+
435
+ /** A time/polarity relationship between two related tracks. */
436
+ export interface MixTrackAlignment {
437
+ reference: string;
438
+ target: string;
439
+ lagSamples: number;
440
+ correlation: number;
441
+ polarityOpposed: boolean;
442
+ }
443
+
444
+ /** A band several tracks are competing for. */
445
+ export interface MixCrowdedBand {
446
+ band: MixAnalysisBand;
447
+ crowding: number;
448
+ }
449
+
450
+ /** A track whose stereo treatment risks collapsing in mono. */
451
+ export interface MixMonoRisk {
452
+ stripId: string;
453
+ correlation: number;
454
+ width: number;
455
+ wideLowEnd: boolean;
456
+ }
457
+
458
+ /** Cross-track measurements the suggestions were made from. */
459
+ export interface MixAssistantMixProfile {
460
+ trackCount: number;
461
+ bandDominance: MixBandDominance[];
462
+ alignment: MixTrackAlignment[];
463
+ crowdedBands: MixCrowdedBand[];
464
+ monoRisks: MixMonoRisk[];
465
+ }
466
+
467
+ /**
468
+ * What {@link suggestMixScene} produces. Nothing has been applied: feeding
469
+ * `scene` to {@link Mixer.fromSceneJson} is the caller's separate step, and
470
+ * {@link suggestMixSceneJson} returns it already serialized for that.
471
+ */
472
+ export interface MixAssistantResult {
473
+ /** The suggested scene, in the schema {@link Mixer.fromSceneJson} reads. */
474
+ scene: MixSceneDocument;
475
+ /** One entry per input track, in input order. */
476
+ tracks: MixAssistantTrackProfile[];
477
+ mix: MixAssistantMixProfile;
478
+ /**
479
+ * Human-readable reasons in the order the changes were applied; reading it
480
+ * top to bottom retraces how the scene was built. Empty when nothing was
481
+ * suggested (no usable tracks, or every domain switched off).
482
+ */
483
+ explanation: string[];
484
+ }