@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,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,103 @@ 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.modulation.autoWah',
84
+ 'effects.modulation.chorus',
85
+ 'effects.modulation.ensemble',
86
+ 'effects.modulation.flanger',
87
+ 'effects.modulation.phaser',
88
+ 'effects.modulation.pitchShifter',
89
+ 'effects.modulation.ringModulator',
90
+ 'effects.modulation.rotary',
91
+ 'effects.modulation.wah',
92
+ 'effects.reverb.convolution',
93
+ 'effects.reverb.dattorro',
94
+ 'effects.reverb.fdn',
95
+ 'effects.reverb.plate',
96
+ 'effects.reverb.room',
97
+ 'effects.reverb.velvet',
98
+ 'eq.apiStyle',
99
+ 'eq.bandPass',
100
+ 'eq.cutFilter',
101
+ 'eq.dynamic',
102
+ 'eq.equalizer',
103
+ 'eq.graphic',
104
+ 'eq.linearPhase',
105
+ 'eq.midSide',
106
+ 'eq.minimumPhase',
107
+ 'eq.parametric',
108
+ 'eq.pultec',
109
+ 'eq.shelving',
110
+ 'eq.tilt',
111
+ 'final.bitDepth',
112
+ 'final.dither',
113
+ 'final.outputChain',
114
+ 'maximizer.adaptiveRelease',
115
+ 'maximizer.loudnessOptimize',
116
+ 'maximizer.maximizer',
117
+ 'maximizer.softKneeMax',
118
+ 'maximizer.truePeakLimiter',
119
+ 'multiband.compressor',
120
+ 'multiband.dynamicEq',
121
+ 'multiband.expander',
122
+ 'multiband.imager',
123
+ 'multiband.limiter',
124
+ 'multiband.saturation',
125
+ 'repair.declick',
126
+ 'repair.declip',
127
+ 'repair.decrackle',
128
+ 'repair.dehum',
129
+ 'repair.denoiseClassical',
130
+ 'repair.dereverbClassical',
131
+ 'repair.trimSilence',
132
+ 'saturation.ampSim',
133
+ 'saturation.bitcrusher',
134
+ 'saturation.exciter',
135
+ 'saturation.hardClipper',
136
+ 'saturation.multibandExciter',
137
+ 'saturation.softClipper',
138
+ 'saturation.tape',
139
+ 'saturation.transformer',
140
+ 'saturation.tube',
141
+ 'saturation.waveshaper',
142
+ 'spectral.airBand',
143
+ 'spectral.lowEndFocus',
144
+ 'spectral.presenceEnhancer',
145
+ 'spectral.spectralShaper',
146
+ 'stereo.autoPan',
147
+ 'stereo.binaural',
148
+ 'stereo.haasEnhancer',
149
+ 'stereo.imager',
150
+ 'stereo.monoMaker',
151
+ 'stereo.phaseAlign',
152
+ 'stereo.stereoBalance',
153
+ 'utility.gain',
154
+ ] as const;
155
+
156
+ export type SoloProcessor = (typeof SOLO_PROCESSORS)[number];
157
+ // END GENERATED SoloProcessor
102
158
 
103
159
  export type PairProcessor =
104
160
  | 'match.applyMatchEq'
@@ -129,6 +185,34 @@ export interface MasteringOptions {
129
185
  applyGainAtInputRate?: boolean;
130
186
  }
131
187
 
188
+ /** What gain-matching one take to another's loudness took, and produced. */
189
+ export interface LoudnessMatchResult {
190
+ /** The source take at the reference's loudness. */
191
+ samples: Float32Array;
192
+ sampleRate: number;
193
+ /**
194
+ * The reference take's BS.1770 integrated loudness. Non-finite for a silent
195
+ * or below-gate take — the documented outcome, not a failure.
196
+ */
197
+ referenceLufs: number;
198
+ /** The matched take's, before the gain. Non-finite in the same case. */
199
+ sourceLufs: number;
200
+ /**
201
+ * `referenceLufs - sourceLufs`. Applied with no upper bound, and 0 whenever
202
+ * either loudness is non-finite.
203
+ */
204
+ appliedGainDb: number;
205
+ /**
206
+ * The matched take's true peak after the gain, in dBTP.
207
+ *
208
+ * The match does not cap the gain, so this can sit above 0 dBTP: clamping to
209
+ * headroom would leave a near-full-scale source at its own loudness, which is
210
+ * the one thing a loudness match must not do. Limit downstream if the peak
211
+ * matters more than the match.
212
+ */
213
+ matchedTruePeakDbtp: number;
214
+ }
215
+
132
216
  /**
133
217
  * Mastering loudness/true-peak processing result
134
218
  */
@@ -141,10 +225,48 @@ export interface MasteringResult {
141
225
  /** True when peak headroom prevented the requested LUFS target. */
142
226
  loudnessTargetLimited?: boolean;
143
227
  latencySamples?: number;
228
+ /**
229
+ * Samples the named processor replaced with a finite in-domain one,
230
+ * keeping the output finite and in range.
231
+ *
232
+ * A non-finite sample supplied by the caller is rejected before the
233
+ * processor runs, so a replacement is always of a value the processor
234
+ * itself produced.
235
+ *
236
+ * Whether this can be non-zero depends on which processor was named: one
237
+ * that does not substitute reports zero because it has nothing to replace
238
+ * with, not because nothing needed replacing. The counter saturates rather
239
+ * than wrapping, because a wrapped total could read as the one value zero
240
+ * is reserved for.
241
+ *
242
+ * @example
243
+ * ```ts
244
+ * const result = masteringProcess({
245
+ * processorName: 'maximizer.truePeakLimiter',
246
+ * samples,
247
+ * sampleRate,
248
+ * });
249
+ * if (result.nonFiniteSubstitutionCount > 0) {
250
+ * // `result.samples` is not derived from `samples` everywhere
251
+ * }
252
+ * ```
253
+ */
254
+ nonFiniteSubstitutionCount: number;
144
255
  }
145
256
 
146
257
  export type MasteringProcessorParams = Record<string, number | boolean>;
147
258
 
259
+ /**
260
+ * Params accepted by the assistant entry points. Every key is numeric except
261
+ * two NAMES: `targetPlatform`, a delivery target (`'broadcast'`, `'podcast'`,
262
+ * `'club'`, ...), and `preset`, the mastering preset the suggestion starts from
263
+ * (default `'streaming'`; restoration presets are refused). The assistant never
264
+ * picks a preset from the audio. A number is rejected for either: the numeric
265
+ * index the C ABI carries is a transport detail for callers that cannot pass a
266
+ * string, not part of the JavaScript vocabulary.
267
+ */
268
+ export type MasteringAssistantParams = Record<string, number | boolean | string>;
269
+
148
270
  /**
149
271
  * Nested mastering-chain configuration. A boolean toggles a module/processor's
150
272
  * `enabled` flag; setting any field implicitly enables its module unless
@@ -163,9 +285,15 @@ export interface MasteringChainConfig {
163
285
  | boolean
164
286
  | {
165
287
  enabled?: boolean;
288
+ /** 0 = log-MMSE, 1 = MMSE-STSA, 2 = spectral subtraction. */
289
+ mode?: number;
290
+ /** 0 = quantile, 1 = MCRA, 2 = IMCRA, 3 = speech-presence probability. */
291
+ noiseEstimator?: number;
166
292
  nFft?: number;
167
293
  hopLength?: number;
168
294
  ddAlpha?: number;
295
+ reductionDb?: number;
296
+ /** @deprecated Use `reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
169
297
  gainFloor?: number;
170
298
  overSubtraction?: number;
171
299
  spectralFloor?: number;
@@ -176,6 +304,8 @@ export interface MasteringChainConfig {
176
304
  nFft?: number;
177
305
  hopLength?: number;
178
306
  ddAlpha?: number;
307
+ reductionDb?: number;
308
+ /** @deprecated Use `denoise.reductionDb`; converted to it (dB = -20*log10(gainFloor)). */
179
309
  gainFloor?: number;
180
310
  declip?: {
181
311
  enabled?: boolean;
@@ -201,6 +331,8 @@ export interface MasteringChainConfig {
201
331
  adaptation?: number;
202
332
  frameSize?: number;
203
333
  pllBandwidth?: number;
334
+ /** 0 = subtract the tracked harmonics, 1 = cascaded notches. */
335
+ mode?: number;
204
336
  };
205
337
  declick?: {
206
338
  enabled?: boolean;
@@ -301,6 +433,8 @@ export interface MasteringChainConfig {
301
433
  headBumpDb?: number;
302
434
  bias?: number;
303
435
  gapLoss?: number;
436
+ /** Jiles-Atherton core oversampling: 1 (default), 2, or 4. */
437
+ oversampleFactor?: number;
304
438
  };
305
439
  exciter?: {
306
440
  enabled?: boolean;
@@ -309,6 +443,12 @@ export interface MasteringChainConfig {
309
443
  amount?: number;
310
444
  q?: number;
311
445
  evenOddMix?: number;
446
+ /**
447
+ * Antialiasing mode ordinal: 0 = none, 3 = 4x oversampling. The ADAA
448
+ * modes (1, 2) name a member the exciter does not implement and are
449
+ * rejected; an ordinal outside 0-3 is rejected as out of range.
450
+ */
451
+ aliasing?: number;
312
452
  };
313
453
  };
314
454
  spectral?: {
@@ -351,6 +491,14 @@ export interface MasteringChainConfig {
351
491
  truePeakOversample?: number;
352
492
  releaseMs?: number;
353
493
  applyGainAtInputRate?: boolean;
494
+ /**
495
+ * How deep, in dB, the stage may drive its post-gain true-peak limiter to
496
+ * reach {@link targetLufs}. Default 12. The static normalization gain may
497
+ * exceed the peak headroom toward `ceilingDb` by this much; `0` restores a
498
+ * strict headroom clamp, under which peak-normalized input keeps its input
499
+ * loudness whatever target is asked for. `ceilingDb` holds at every setting.
500
+ */
501
+ maxLimiterGainReductionDb?: number;
354
502
  };
355
503
  /**
356
504
  * Dot-notation spelling of any leaf above, e.g. `'loudness.targetLufs': -20`
@@ -385,7 +533,8 @@ export interface StreamingMasteringChainConfig extends MasteringChainConfig {
385
533
  /**
386
534
  * Offline-measured true-peak (dBFS) of the source the static gain was
387
535
  * computed for. When provided, the static gain is clamped to
388
- * `loudness.ceilingDb - loudnessStaticGainPeakDb` so the streaming preview
536
+ * `(loudness.ceilingDb - loudnessStaticGainPeakDb) +
537
+ * max(loudness.maxLimiterGainReductionDb, 0)` so the streaming preview
389
538
  * does not drive the loudness limiter harder than the offline chain. When
390
539
  * omitted (the default) the static gain is applied verbatim.
391
540
  */
@@ -432,15 +581,35 @@ export interface MasteringChainResult {
432
581
  appliedGainDb: number;
433
582
  stages: string[];
434
583
  /**
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.
584
+ * ITU-R BS.1770-4 true peak of the output (dBTP). Lets callers verify a
585
+ * preset ceiling was met without a second oversampled scan.
586
+ *
587
+ * The oversample factor follows the peak-limiting stage the chain actually
588
+ * applied, so it is not fixed: the loudness stage's true-peak oversample
589
+ * (default 4x) when loudness is enabled, and the maximizer true-peak
590
+ * limiter's own oversample factor when loudness is disabled but that stage
591
+ * ran. The two disagree by roughly 0.02 dB between 4x and 8x, so comparing
592
+ * this against an independently measured peak needs the same factor.
438
593
  */
439
594
  outputTruePeakDbtp: number;
440
595
  /** EBU Tech 3342 Loudness Range of the output (LU). */
441
596
  outputLra: number;
442
597
  /** True when peak headroom prevented the requested LUFS target. */
443
598
  loudnessTargetLimited: boolean;
599
+ /**
600
+ * Samples a stage replaced with a finite in-domain one, keeping the
601
+ * output finite and in range.
602
+ *
603
+ * A non-finite sample supplied by the caller is rejected before any stage
604
+ * runs, so a replacement is always of a value a stage itself produced.
605
+ *
606
+ * Only the true-peak limiters replace anything, so with the maximizer's
607
+ * limiter and the loudness stage both disabled a zero here means no stage
608
+ * was able to replace anything rather than that nothing needed replacing.
609
+ * Aggregated, so it does not identify which one substituted; run a limiter
610
+ * individually through {@link masteringProcess} to attribute a non-zero count.
611
+ */
612
+ nonFiniteSubstitutionCount: number;
444
613
  /** Per-stage gain reductions for the dynamics/maximizer stages (a subset of `stages`). */
445
614
  stageGainReductions: StageGainReduction[];
446
615
  report: MasteringReport;
@@ -458,6 +627,11 @@ export interface MasteringChainStereoResult {
458
627
  outputTruePeakDbtp: number;
459
628
  outputLra: number;
460
629
  loudnessTargetLimited: boolean;
630
+ /**
631
+ * See {@link MasteringChainResult.nonFiniteSubstitutionCount}. Aggregated
632
+ * over both channels, so it does not identify which channel substituted.
633
+ */
634
+ nonFiniteSubstitutionCount: number;
461
635
  stageGainReductions: StageGainReduction[];
462
636
  report: MasteringReport;
463
637
  }
@@ -477,4 +651,11 @@ export interface MasteringStereoResult {
477
651
  outputLufs: number;
478
652
  appliedGainDb: number;
479
653
  latencySamples: number;
654
+ /** True when peak headroom prevented the requested LUFS target. */
655
+ loudnessTargetLimited: boolean;
656
+ /**
657
+ * See {@link MasteringResult.nonFiniteSubstitutionCount}. Aggregated over both
658
+ * channels, so it does not identify which channel substituted.
659
+ */
660
+ nonFiniteSubstitutionCount: number;
480
661
  }