@libraz/libsonare 1.7.2 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +7 -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 +874 -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 +502 -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 +134 -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 +4173 -1621
  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 +483 -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 +654 -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 +528 -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 +165 -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 +893 -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 +3945 -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 +340 -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 +164 -0
  179. package/dist/worklet/engine-mixer-facade.d.ts.map +1 -0
  180. package/dist/worklet/engine-node.d.ts +83 -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 +72 -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 +75 -0
  193. package/dist/worklet/engine-strips.d.ts.map +1 -0
  194. package/dist/worklet/engine-sync.d.ts +39 -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 +418 -0
  199. package/dist/worklet/engine.d.ts.map +1 -0
  200. package/dist/worklet/guards.d.ts +53 -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 +331 -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 +3200 -541
  215. package/dist/worklet.js.map +1 -1
  216. package/package.json +23 -12
  217. package/src/_effects_common.ts +47 -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 +101 -22
  226. package/src/effects_note_ops.ts +683 -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 +388 -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 +288 -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 +441 -32
  246. package/src/mastering_dynamics.ts +22 -11
  247. package/src/metering.ts +67 -24
  248. package/src/mixer.ts +251 -22
  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 +271 -271
  259. package/src/public_types.ts +122 -3
  260. package/src/public_types_acoustic.ts +112 -3
  261. package/src/public_types_mastering.ts +275 -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 +196 -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 +491 -5
  268. package/src/quick_analysis.ts +203 -26
  269. package/src/realtime_engine.ts +773 -34
  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 +1158 -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 +202 -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 +800 -32
  287. package/src/worklet/engine-node.ts +99 -29
  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 +332 -93
  291. package/src/worklet/engine-register.ts +32 -18
  292. package/src/worklet/engine-strips.ts +275 -9
  293. package/src/worklet/engine-sync.ts +20 -7
  294. package/src/worklet/engine.ts +394 -48
  295. package/src/worklet/guards.ts +195 -44
  296. package/src/worklet/messages.ts +229 -2
  297. package/src/worklet/mixer-processor.ts +117 -48
  298. package/src/worklet/playback-processor.ts +300 -0
  299. package/src/worklet/protocol.ts +82 -11
  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,25 @@
1
+ /**
2
+ * Built-in mastering presets. The restoration presets — `vinyl`, `tapeHiss`,
3
+ * `fieldRecording`, `voiceMemo` and `shellac78` — enable repair stages only and
4
+ * leave level alone. Every other preset carries an integrated-loudness target
5
+ * and a true-peak ceiling, which are not equally binding: the ceiling always
6
+ * holds, while the loudness target is what one normalization pass aims at.
7
+ *
8
+ * Reaching a target above the input's loudness costs gain the input's peak
9
+ * headroom may not have, so the stage drives its true-peak limiter up to
10
+ * `loudness.maxLimiterGainReductionDb` (12 dB by default) to close the distance
11
+ * and stops there. Material needing more limiting than that — and material where
12
+ * the limiter's own gain reduction takes back part of the applied gain, which a
13
+ * single pass does not re-measure — finishes below target with
14
+ * `loudnessTargetLimited` set on the result. Peak-normalized input, whose
15
+ * headroom is ~0 dB, is the common case for both. Read `outputLufs` for what was
16
+ * achieved rather than assuming the preset's target.
17
+ *
18
+ * The restoration presets' repair stages, like every classical denoise
19
+ * configuration, can mistake a steady tone -- a calibration tone, a drone, a
20
+ * long held note -- for noise and pull it down by the configured reduction
21
+ * depth. Check for musical sustained tones before applying one.
22
+ */
1
23
  export type MasteringPreset =
2
24
  | 'pop'
3
25
  | 'edm'
@@ -23,7 +45,12 @@ export type MasteringPreset =
23
45
  | 'jazz'
24
46
  | 'kpop'
25
47
  | 'trance'
26
- | 'gameOst';
48
+ | 'gameOst'
49
+ | 'vinyl'
50
+ | 'tapeHiss'
51
+ | 'fieldRecording'
52
+ | 'voiceMemo'
53
+ | 'shellac78';
27
54
 
28
55
  export interface StreamingPlatform {
29
56
  name: string;
@@ -31,74 +58,104 @@ export interface StreamingPlatform {
31
58
  ceilingDb: number;
32
59
  }
33
60
 
34
- export type SoloProcessor =
35
- | 'dynamics.brickwallLimiter'
36
- | 'dynamics.compressor'
37
- | 'dynamics.deesser'
38
- | 'dynamics.expander'
39
- | 'dynamics.gate'
40
- | 'dynamics.limiter'
41
- | 'dynamics.parallelComp'
42
- | 'dynamics.sidechainRouter'
43
- | 'dynamics.duckingProcessor'
44
- | 'dynamics.transientShaper'
45
- | 'dynamics.upwardCompressor'
46
- | 'dynamics.upwardExpander'
47
- | 'dynamics.vocalRider'
48
- | 'eq.apiStyle'
49
- | 'eq.bandPass'
50
- | 'eq.cutFilter'
51
- | 'eq.dynamic'
52
- | 'eq.equalizer'
53
- | 'eq.graphic'
54
- | 'eq.linearPhase'
55
- | 'eq.midSide'
56
- | 'eq.minimumPhase'
57
- | 'eq.parametric'
58
- | 'eq.pultec'
59
- | 'eq.shelving'
60
- | 'eq.tilt'
61
- | 'final.bitDepth'
62
- | 'final.dither'
63
- | 'final.outputChain'
64
- | 'maximizer.adaptiveRelease'
65
- | 'maximizer.loudnessOptimize'
66
- | 'maximizer.maximizer'
67
- | 'maximizer.softKneeMax'
68
- | 'maximizer.truePeakLimiter'
69
- | 'multiband.compressor'
70
- | 'multiband.dynamicEq'
71
- | 'multiband.expander'
72
- | 'multiband.imager'
73
- | 'multiband.limiter'
74
- | 'multiband.saturation'
75
- | 'repair.declick'
76
- | 'repair.declip'
77
- | 'repair.decrackle'
78
- | 'repair.dehum'
79
- | 'repair.denoiseClassical'
80
- | 'repair.dereverbClassical'
81
- | 'repair.trimSilence'
82
- | 'saturation.bitcrusher'
83
- | 'saturation.exciter'
84
- | 'saturation.hardClipper'
85
- | 'saturation.multibandExciter'
86
- | 'saturation.ampSim'
87
- | 'saturation.softClipper'
88
- | 'saturation.tape'
89
- | 'saturation.transformer'
90
- | 'saturation.tube'
91
- | 'saturation.waveshaper'
92
- | 'spectral.airBand'
93
- | 'spectral.lowEndFocus'
94
- | 'spectral.presenceEnhancer'
95
- | 'spectral.spectralShaper'
96
- | 'stereo.autoPan'
97
- | 'stereo.haasEnhancer'
98
- | 'stereo.imager'
99
- | 'stereo.monoMaker'
100
- | 'stereo.phaseAlign'
101
- | 'stereo.stereoBalance';
61
+ // BEGIN GENERATED SoloProcessor (make processor-types)
62
+ /**
63
+ * Every processor name `masteringProcessorNames()` can return, and therefore
64
+ * every name `masteringProcess` / `masteringProcessStereo` accept.
65
+ */
66
+ export const SOLO_PROCESSORS = [
67
+ 'dynamics.brickwallLimiter',
68
+ 'dynamics.compressor',
69
+ 'dynamics.deesser',
70
+ 'dynamics.duckingProcessor',
71
+ 'dynamics.expander',
72
+ 'dynamics.gate',
73
+ 'dynamics.limiter',
74
+ 'dynamics.parallelComp',
75
+ 'dynamics.sidechainRouter',
76
+ 'dynamics.transientShaper',
77
+ 'dynamics.upwardCompressor',
78
+ 'dynamics.upwardExpander',
79
+ 'dynamics.vocalRider',
80
+ 'effects.acoustic.roomMorph',
81
+ 'effects.delay.stereo',
82
+ 'effects.filter.vowel',
83
+ 'effects.gsEfx',
84
+ 'effects.modulation.autoWah',
85
+ 'effects.modulation.chorus',
86
+ 'effects.modulation.ensemble',
87
+ 'effects.modulation.flanger',
88
+ 'effects.modulation.phaser',
89
+ 'effects.modulation.pitchShifter',
90
+ 'effects.modulation.ringModulator',
91
+ 'effects.modulation.rotary',
92
+ 'effects.modulation.wah',
93
+ 'effects.reverb.convolution',
94
+ 'effects.reverb.dattorro',
95
+ 'effects.reverb.fdn',
96
+ 'effects.reverb.plate',
97
+ 'effects.reverb.room',
98
+ 'effects.reverb.velvet',
99
+ 'eq.apiStyle',
100
+ 'eq.bandPass',
101
+ 'eq.cutFilter',
102
+ 'eq.dynamic',
103
+ 'eq.equalizer',
104
+ 'eq.graphic',
105
+ 'eq.linearPhase',
106
+ 'eq.midSide',
107
+ 'eq.minimumPhase',
108
+ 'eq.parametric',
109
+ 'eq.pultec',
110
+ 'eq.shelving',
111
+ 'eq.tilt',
112
+ 'final.bitDepth',
113
+ 'final.dither',
114
+ 'final.outputChain',
115
+ 'maximizer.adaptiveRelease',
116
+ 'maximizer.loudnessOptimize',
117
+ 'maximizer.maximizer',
118
+ 'maximizer.softKneeMax',
119
+ 'maximizer.truePeakLimiter',
120
+ 'multiband.compressor',
121
+ 'multiband.dynamicEq',
122
+ 'multiband.expander',
123
+ 'multiband.imager',
124
+ 'multiband.limiter',
125
+ 'multiband.saturation',
126
+ 'repair.declick',
127
+ 'repair.declip',
128
+ 'repair.decrackle',
129
+ 'repair.dehum',
130
+ 'repair.denoiseClassical',
131
+ 'repair.dereverbClassical',
132
+ 'repair.trimSilence',
133
+ 'saturation.ampSim',
134
+ 'saturation.bitcrusher',
135
+ 'saturation.exciter',
136
+ 'saturation.hardClipper',
137
+ 'saturation.multibandExciter',
138
+ 'saturation.softClipper',
139
+ 'saturation.tape',
140
+ 'saturation.transformer',
141
+ 'saturation.tube',
142
+ 'saturation.waveshaper',
143
+ 'spectral.airBand',
144
+ 'spectral.lowEndFocus',
145
+ 'spectral.presenceEnhancer',
146
+ 'spectral.spectralShaper',
147
+ 'stereo.autoPan',
148
+ 'stereo.binaural',
149
+ 'stereo.haasEnhancer',
150
+ 'stereo.imager',
151
+ 'stereo.monoMaker',
152
+ 'stereo.phaseAlign',
153
+ 'stereo.stereoBalance',
154
+ 'utility.gain',
155
+ ] as const;
156
+
157
+ export type SoloProcessor = (typeof SOLO_PROCESSORS)[number];
158
+ // END GENERATED SoloProcessor
102
159
 
103
160
  export type PairProcessor =
104
161
  | 'match.applyMatchEq'
@@ -106,6 +163,9 @@ export type PairProcessor =
106
163
  | 'match.abSwitch'
107
164
  | 'match.abCrossfade';
108
165
 
166
+ /** Pair processors with a stereo entry point. */
167
+ export type StereoPairProcessor = 'match.abCrossfade';
168
+
109
169
  export type PairAnalysis =
110
170
  | 'match.referenceLoudness'
111
171
  | 'match.tonalBalance'
@@ -129,6 +189,51 @@ export interface MasteringOptions {
129
189
  applyGainAtInputRate?: boolean;
130
190
  }
131
191
 
192
+ /** What gain-matching one take to another's loudness took, and produced. */
193
+ export interface LoudnessMatchResult {
194
+ /** The source take at the reference's loudness. */
195
+ samples: Float32Array;
196
+ sampleRate: number;
197
+ /**
198
+ * The reference take's BS.1770 integrated loudness. Non-finite for a silent
199
+ * or below-gate take — the documented outcome, not a failure.
200
+ */
201
+ referenceLufs: number;
202
+ /** The matched take's, before the gain. Non-finite in the same case. */
203
+ sourceLufs: number;
204
+ /**
205
+ * `referenceLufs - sourceLufs`. Applied with no upper bound, and 0 whenever
206
+ * either loudness is non-finite.
207
+ */
208
+ appliedGainDb: number;
209
+ /**
210
+ * The matched take's true peak after the gain, in dBTP.
211
+ *
212
+ * The match does not cap the gain, so this can sit above 0 dBTP: clamping to
213
+ * headroom would leave a near-full-scale source at its own loudness, which is
214
+ * the one thing a loudness match must not do. Limit downstream if the peak
215
+ * matters more than the match.
216
+ */
217
+ matchedTruePeakDbtp: number;
218
+ }
219
+
220
+ /** Stereo counterpart of {@link LoudnessMatchResult}. */
221
+ export interface LoudnessMatchStereoResult {
222
+ /** The left source channel, gain-matched to the reference loudness. */
223
+ left: Float32Array;
224
+ /** The right source channel, gain-matched with the same gain as `left`. */
225
+ right: Float32Array;
226
+ sampleRate: number;
227
+ /** The reference program's BS.1770 integrated loudness. */
228
+ referenceLufs: number;
229
+ /** The stereo source program's loudness before the gain. */
230
+ sourceLufs: number;
231
+ /** One gain applied to both source channels, in dB. */
232
+ appliedGainDb: number;
233
+ /** Maximum true peak across the matched left and right channels, in dBTP. */
234
+ matchedTruePeakDbtp: number;
235
+ }
236
+
132
237
  /**
133
238
  * Mastering loudness/true-peak processing result
134
239
  */
@@ -141,10 +246,48 @@ export interface MasteringResult {
141
246
  /** True when peak headroom prevented the requested LUFS target. */
142
247
  loudnessTargetLimited?: boolean;
143
248
  latencySamples?: number;
249
+ /**
250
+ * Samples the named processor replaced with a finite in-domain one,
251
+ * keeping the output finite and in range.
252
+ *
253
+ * A non-finite sample supplied by the caller is rejected before the
254
+ * processor runs, so a replacement is always of a value the processor
255
+ * itself produced.
256
+ *
257
+ * Whether this can be non-zero depends on which processor was named: one
258
+ * that does not substitute reports zero because it has nothing to replace
259
+ * with, not because nothing needed replacing. The counter saturates rather
260
+ * than wrapping, because a wrapped total could read as the one value zero
261
+ * is reserved for.
262
+ *
263
+ * @example
264
+ * ```ts
265
+ * const result = masteringProcess({
266
+ * processorName: 'maximizer.truePeakLimiter',
267
+ * samples,
268
+ * sampleRate,
269
+ * });
270
+ * if (result.nonFiniteSubstitutionCount > 0) {
271
+ * // `result.samples` is not derived from `samples` everywhere
272
+ * }
273
+ * ```
274
+ */
275
+ nonFiniteSubstitutionCount: number;
144
276
  }
145
277
 
146
278
  export type MasteringProcessorParams = Record<string, number | boolean>;
147
279
 
280
+ /**
281
+ * Params accepted by the assistant entry points. Every key is numeric except
282
+ * two NAMES: `targetPlatform`, a delivery target (`'broadcast'`, `'podcast'`,
283
+ * `'club'`, ...), and `preset`, the mastering preset the suggestion starts from
284
+ * (default `'streaming'`; restoration presets are refused). The assistant never
285
+ * picks a preset from the audio. A number is rejected for either: the numeric
286
+ * index the C ABI carries is a transport detail for callers that cannot pass a
287
+ * string, not part of the JavaScript vocabulary.
288
+ */
289
+ export type MasteringAssistantParams = Record<string, number | boolean | string>;
290
+
148
291
  /**
149
292
  * Nested mastering-chain configuration. A boolean toggles a module/processor's
150
293
  * `enabled` flag; setting any field implicitly enables its module unless
@@ -163,9 +306,15 @@ export interface MasteringChainConfig {
163
306
  | boolean
164
307
  | {
165
308
  enabled?: boolean;
309
+ /** 0 = log-MMSE, 1 = MMSE-STSA, 2 = spectral subtraction. */
310
+ mode?: number;
311
+ /** 0 = quantile, 1 = MCRA, 2 = IMCRA, 3 = speech-presence probability. */
312
+ noiseEstimator?: number;
166
313
  nFft?: number;
167
314
  hopLength?: number;
168
315
  ddAlpha?: number;
316
+ reductionDb?: number;
317
+ /** @deprecated Use `reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
169
318
  gainFloor?: number;
170
319
  overSubtraction?: number;
171
320
  spectralFloor?: number;
@@ -176,6 +325,8 @@ export interface MasteringChainConfig {
176
325
  nFft?: number;
177
326
  hopLength?: number;
178
327
  ddAlpha?: number;
328
+ reductionDb?: number;
329
+ /** @deprecated Use `denoise.reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
179
330
  gainFloor?: number;
180
331
  declip?: {
181
332
  enabled?: boolean;
@@ -201,6 +352,8 @@ export interface MasteringChainConfig {
201
352
  adaptation?: number;
202
353
  frameSize?: number;
203
354
  pllBandwidth?: number;
355
+ /** 0 = subtract the tracked harmonics, 1 = cascaded notches. */
356
+ mode?: number;
204
357
  };
205
358
  declick?: {
206
359
  enabled?: boolean;
@@ -301,6 +454,8 @@ export interface MasteringChainConfig {
301
454
  headBumpDb?: number;
302
455
  bias?: number;
303
456
  gapLoss?: number;
457
+ /** Jiles-Atherton core oversampling: 1 (default), 2, or 4. */
458
+ oversampleFactor?: number;
304
459
  };
305
460
  exciter?: {
306
461
  enabled?: boolean;
@@ -309,6 +464,12 @@ export interface MasteringChainConfig {
309
464
  amount?: number;
310
465
  q?: number;
311
466
  evenOddMix?: number;
467
+ /**
468
+ * Antialiasing mode ordinal: 0 = none, 3 = 4x oversampling. The ADAA
469
+ * modes (1, 2) name a member the exciter does not implement and are
470
+ * rejected; an ordinal outside 0-3 is rejected as out of range.
471
+ */
472
+ aliasing?: number;
312
473
  };
313
474
  };
314
475
  spectral?: {
@@ -351,6 +512,14 @@ export interface MasteringChainConfig {
351
512
  truePeakOversample?: number;
352
513
  releaseMs?: number;
353
514
  applyGainAtInputRate?: boolean;
515
+ /**
516
+ * How deep, in dB, the stage may drive its post-gain true-peak limiter to
517
+ * reach {@link targetLufs}. Default 12. The static normalization gain may
518
+ * exceed the peak headroom toward `ceilingDb` by this much; `0` restores a
519
+ * strict headroom clamp, under which peak-normalized input keeps its input
520
+ * loudness whatever target is asked for. `ceilingDb` holds at every setting.
521
+ */
522
+ maxLimiterGainReductionDb?: number;
354
523
  };
355
524
  /**
356
525
  * Dot-notation spelling of any leaf above, e.g. `'loudness.targetLufs': -20`
@@ -385,7 +554,8 @@ export interface StreamingMasteringChainConfig extends MasteringChainConfig {
385
554
  /**
386
555
  * Offline-measured true-peak (dBFS) of the source the static gain was
387
556
  * computed for. When provided, the static gain is clamped to
388
- * `loudness.ceilingDb - loudnessStaticGainPeakDb` so the streaming preview
557
+ * `(loudness.ceilingDb - loudnessStaticGainPeakDb) +
558
+ * max(loudness.maxLimiterGainReductionDb, 0)` so the streaming preview
389
559
  * does not drive the loudness limiter harder than the offline chain. When
390
560
  * omitted (the default) the static gain is applied verbatim.
391
561
  */
@@ -432,15 +602,35 @@ export interface MasteringChainResult {
432
602
  appliedGainDb: number;
433
603
  stages: string[];
434
604
  /**
435
- * ITU-R BS.1770-4 true peak of the output (dBTP), measured with the chain's
436
- * configured loudness true-peak oversample factor (default 4x). Lets callers
437
- * verify a preset ceiling was met without a second oversampled scan.
605
+ * ITU-R BS.1770-4 true peak of the output (dBTP). Lets callers verify a
606
+ * preset ceiling was met without a second oversampled scan.
607
+ *
608
+ * The oversample factor follows the peak-limiting stage the chain actually
609
+ * applied, so it is not fixed: the loudness stage's true-peak oversample
610
+ * (default 4x) when loudness is enabled, and the maximizer true-peak
611
+ * limiter's own oversample factor when loudness is disabled but that stage
612
+ * ran. The two disagree by roughly 0.02 dB between 4x and 8x, so comparing
613
+ * this against an independently measured peak needs the same factor.
438
614
  */
439
615
  outputTruePeakDbtp: number;
440
616
  /** EBU Tech 3342 Loudness Range of the output (LU). */
441
617
  outputLra: number;
442
618
  /** True when peak headroom prevented the requested LUFS target. */
443
619
  loudnessTargetLimited: boolean;
620
+ /**
621
+ * Samples a stage replaced with a finite in-domain one, keeping the
622
+ * output finite and in range.
623
+ *
624
+ * A non-finite sample supplied by the caller is rejected before any stage
625
+ * runs, so a replacement is always of a value a stage itself produced.
626
+ *
627
+ * Only the true-peak limiters replace anything, so with the maximizer's
628
+ * limiter and the loudness stage both disabled a zero here means no stage
629
+ * was able to replace anything rather than that nothing needed replacing.
630
+ * Aggregated, so it does not identify which one substituted; run a limiter
631
+ * individually through {@link masteringProcess} to attribute a non-zero count.
632
+ */
633
+ nonFiniteSubstitutionCount: number;
444
634
  /** Per-stage gain reductions for the dynamics/maximizer stages (a subset of `stages`). */
445
635
  stageGainReductions: StageGainReduction[];
446
636
  report: MasteringReport;
@@ -458,6 +648,11 @@ export interface MasteringChainStereoResult {
458
648
  outputTruePeakDbtp: number;
459
649
  outputLra: number;
460
650
  loudnessTargetLimited: boolean;
651
+ /**
652
+ * See {@link MasteringChainResult.nonFiniteSubstitutionCount}. Aggregated
653
+ * over both channels, so it does not identify which channel substituted.
654
+ */
655
+ nonFiniteSubstitutionCount: number;
461
656
  stageGainReductions: StageGainReduction[];
462
657
  report: MasteringReport;
463
658
  }
@@ -477,4 +672,11 @@ export interface MasteringStereoResult {
477
672
  outputLufs: number;
478
673
  appliedGainDb: number;
479
674
  latencySamples: number;
675
+ /** True when peak headroom prevented the requested LUFS target. */
676
+ loudnessTargetLimited: boolean;
677
+ /**
678
+ * See {@link MasteringResult.nonFiniteSubstitutionCount}. Aggregated over both
679
+ * channels, so it does not identify which channel substituted.
680
+ */
681
+ nonFiniteSubstitutionCount: number;
480
682
  }