@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
@@ -0,0 +1,697 @@
1
+ import type { ValidateOptions } from './validation';
2
+ /**
3
+ * Per-frame voicing decision, one entry per `f0Hz` frame. A truthy or non-zero
4
+ * entry marks the frame voiced. The union covers what the analysis side hands
5
+ * back — `PitchResult.voicedFlag` is a `boolean[]` — as well as the typed and
6
+ * plain numeric arrays a caller may build directly, so a pitch track can be fed
7
+ * straight into pitch correction without a conversion step.
8
+ */
9
+ export type VoicedFlags = Int32Array | Uint8Array | Float32Array | readonly number[] | readonly boolean[];
10
+ /** Options for `pitchCorrectTimevarying`. All fields are optional. */
11
+ export interface PitchCorrectOptions extends ValidateOptions {
12
+ /** `'midi'` retunes toward `targetMidi`; `'scale'` snaps to the key. Default `'midi'`. */
13
+ mode?: 'midi' | 'scale';
14
+ /** Fixed target note when `mode` is `'midi'`, in `[0, 127]`. Default 69 (A4). */
15
+ targetMidi?: number;
16
+ /** Scale root pitch class (0=C .. 11=B) when `mode` is `'scale'`. Default 0. */
17
+ scaleRoot?: number;
18
+ /** 12-bit degree mask, bit `i` = semitone `i` above the root enabled. Default C major. */
19
+ scaleModeMask?: number;
20
+ /** Reference MIDI anchoring the scale grid. Default 69 (A4). */
21
+ referenceMidi?: number;
22
+ /** Correction strength in `[0, 1]`; 1 = full snap, 0 = bypass. Default 1. */
23
+ retuneAmount?: number;
24
+ /** Hard clamp on per-frame correction magnitude (semitones). Default 12. */
25
+ maxCorrectionSemitones?: number;
26
+ /** Retune IIR time constant (ms); larger = slower glide. Default 50. */
27
+ retuneSpeedMs?: number;
28
+ /** Corrections below this are bypassed to preserve vibrato (cents). Default 20. */
29
+ vibratoThresholdCents?: number;
30
+ /** Per-frame voiced flags (truthy = voiced); omit to treat all frames as voiced. */
31
+ voiced?: VoicedFlags;
32
+ /** Per-frame voicing probability in `[0, 1]`; omit to derive from `voiced`. */
33
+ voicedProb?: Float32Array;
34
+ }
35
+ /** Options for `noteStretch`. All fields are optional. */
36
+ export interface NoteStretchOptions {
37
+ /** Note onset position in samples (selects the region). Default 0. */
38
+ onsetSample?: number;
39
+ /** Note offset position in samples (selects the region). Defaults to the input length. */
40
+ offsetSample?: number;
41
+ /** Stretch ratio (0.5 = half duration, 2.0 = double duration). Default 1. */
42
+ stretchRatio?: number;
43
+ }
44
+ /** Options for `noteMove`. */
45
+ export interface NoteMoveOptions {
46
+ onsetSample?: number;
47
+ /** Defaults to the input length. */
48
+ offsetSample?: number;
49
+ targetOnsetSample?: number;
50
+ }
51
+ /** Segmentation tuning for `extractNotes`. All fields are optional; 0 or absent takes the default. */
52
+ export interface NoteExtractorOptions {
53
+ /** Cents of pitch change that start a new note. Default 50. */
54
+ segmentationThresholdCents?: number;
55
+ /** Shortest span kept as a note, in ms. Default 30. */
56
+ minNoteMs?: number;
57
+ /** Reference pitch the `medianCents` of each note is measured against. Default 440. */
58
+ referenceHz?: number;
59
+ /**
60
+ * Value of `voicedProb` at or above which a frame counts as voiced, in
61
+ * `[0, 1]`. Read only when `voiced` is omitted. Default 0.5.
62
+ *
63
+ * pYIN's `voicedProb` is a frame's voiced observation mass and rises with F0
64
+ * for a fixed frame length, so this default silently drops low registers —
65
+ * pass `pitchPyin`'s `voicedFlag` through `voiced` instead.
66
+ */
67
+ voicedThreshold?: number;
68
+ }
69
+ /**
70
+ * A pending, non-destructive change to one note. `extractNotes` attaches the
71
+ * identity edit (no move, no transpose, unity gain and stretch, unmuted) to
72
+ * every note it returns; `renderNotes` applies whatever the caller has changed.
73
+ */
74
+ export interface NoteEdit {
75
+ /**
76
+ * Moves the note along the timeline; negative moves it earlier. Where the note
77
+ * lands is not bounds-checked, so a moved note may overwrite a neighbour.
78
+ */
79
+ timeOffsetSamples: number;
80
+ /** Transpose applied to the note's span. */
81
+ pitchShiftSemitones: number;
82
+ /** Level change applied to the note's span. */
83
+ gainDb: number;
84
+ /** `>1` lengthens the note, `<1` shortens it; pitch is preserved. 0 reads as 1. */
85
+ timeStretchRatio: number;
86
+ /**
87
+ * Moves the spectral envelope, in semitones, on top of whatever the pitch
88
+ * shift already did to it.
89
+ *
90
+ * 0 runs no warp at all, so a pitch-only edit is not charged for an LPC
91
+ * analysis-resynthesis round it did not ask for. A pitch shift drags the
92
+ * formants with it, so holding them still is `-pitchShiftSemitones` and the
93
+ * chipmunk is the default. Saturates near -10.3 and +8.7 semitones rather
94
+ * than being rejected.
95
+ */
96
+ formantShiftSemitones: number;
97
+ /**
98
+ * Scales the vibrato measured over the note, stated as a change from it: 0
99
+ * keeps it, -1 flattens it, +1 doubles it.
100
+ *
101
+ * Applying it needs the note's own pitch curve, so `renderNotes` must be given
102
+ * the `f0Hz` track and the note its `frameStart` / `frameEnd` / `medianHz`; a
103
+ * note carrying no usable pitch is rejected rather than left alone. The curve
104
+ * is split at the request's `vibratoCutoffHz`.
105
+ */
106
+ vibratoDepthChange: number;
107
+ /** The same, for the slow drift around the note's centre pitch. */
108
+ driftChange: number;
109
+ /** Silences the note's span; the other fields then do not apply. */
110
+ muted: boolean;
111
+ /**
112
+ * Per-frame linear gain over the note's span, on top of `gainDb`.
113
+ *
114
+ * A set of gain points rather than a signal: it is stretched over whatever
115
+ * length the note renders at, so it survives a time stretch and need not match
116
+ * the note's frame count. One entry is a constant gain, and an empty array is
117
+ * no envelope. Every value must be finite and non-negative.
118
+ */
119
+ amplitudeEnvelope: Float32Array;
120
+ }
121
+ /**
122
+ * A {@link NoteEdit} as supplied to `renderNotes`, `splitNote` or `mergeNotes`.
123
+ * Every field is optional and an omitted one is the identity, so `{}` leaves the
124
+ * note untouched.
125
+ *
126
+ * `amplitudeEnvelope` is the one field that widens on the way in: a host
127
+ * building an envelope in JS naturally ends up with a plain array, and the
128
+ * points are copied into WASM memory either way. What comes back on a
129
+ * {@link NoteEdit} is always a `Float32Array`.
130
+ */
131
+ export type NoteEditInput = Omit<Partial<NoteEdit>, 'amplitudeEnvelope'> & {
132
+ amplitudeEnvelope?: Float32Array | readonly number[];
133
+ };
134
+ /**
135
+ * One editable note, returned by `extractNotes` and by
136
+ * `PolyphonicAnalysis.notes()`.
137
+ *
138
+ * Sample bounds are half-open into the source audio. Frame bounds are half-open
139
+ * into whichever framing found the note: the caller's own `f0Hz` track through
140
+ * `extractNotes`, and the analysis's own STFT framing through a
141
+ * `PolyphonicAnalysis`, whose `f0Hz` curve therefore comes from `noteF0(note)`
142
+ * rather than from an array the caller holds.
143
+ *
144
+ * The per-note F0 curve is deliberately not repeated here — through the by-value
145
+ * door it is `f0Hz.subarray(frameStart, frameEnd)`, and through a handle it has its
146
+ * own accessor.
147
+ *
148
+ * `onsetSample` and `offsetSample` are 64-bit on the core side and arrive as JS
149
+ * numbers, which are exact up to `Number.MAX_SAFE_INTEGER`.
150
+ */
151
+ export interface NoteObject {
152
+ /** First sample of the note's span. */
153
+ onsetSample: number;
154
+ /** One past the last sample of the span. */
155
+ offsetSample: number;
156
+ /** First frame of the span, in the framing that found the note. */
157
+ frameStart: number;
158
+ /** One past the last frame of the span. */
159
+ frameEnd: number;
160
+ /** Median measured pitch over the span, in Hz. */
161
+ medianHz: number;
162
+ /** Median pitch in cents above the request's `referenceHz`. */
163
+ medianCents: number;
164
+ /** Pitch steadiness in `[0, 1]`; 1 is perfectly steady. */
165
+ f0Stability: number;
166
+ /** One RMS value per frame of the span (`frameEnd - frameStart` entries). */
167
+ amplitude: Float32Array;
168
+ /** This note's pending edit; the identity as returned. */
169
+ edit: NoteEdit;
170
+ }
171
+ /**
172
+ * A note handed to `renderNotes`. Only the span, the edit and — for a
173
+ * `vibratoDepthChange` or `driftChange` edit — the frame bounds and the centre
174
+ * are read, so a {@link NoteObject} straight from `extractNotes` can be passed
175
+ * back with its `edit` changed and nothing else.
176
+ */
177
+ export interface NoteObjectInput {
178
+ /** First sample of the note's span. */
179
+ onsetSample: number;
180
+ /** One past the last sample of the span. */
181
+ offsetSample: number;
182
+ /**
183
+ * First frame of the span in the request's `f0Hz` track. Read only when a
184
+ * track is given; a curve edit acts on `f0Hz.subarray(frameStart, frameEnd)`.
185
+ */
186
+ frameStart?: number;
187
+ /** One past the last frame of the span, under the same rule. */
188
+ frameEnd?: number;
189
+ /** The note's centre pitch in Hz, which a curve edit measures its cents against. */
190
+ medianHz?: number;
191
+ /** Omit for the identity edit. */
192
+ edit?: NoteEditInput;
193
+ }
194
+ /**
195
+ * A note handed to `splitNote` or `mergeNotes`. Both re-derive every note in the
196
+ * set from the audio and the track, so only the frame bounds and the edit are
197
+ * read — and the frame bounds are therefore what a note is identified by.
198
+ */
199
+ export interface NoteSetEntry {
200
+ /** First frame of the span in the request's `f0Hz` track. */
201
+ frameStart: number;
202
+ /** One past the last frame of the span. */
203
+ frameEnd: number;
204
+ /** Omit for the identity edit. */
205
+ edit?: NoteEditInput;
206
+ }
207
+ /**
208
+ * One note of a reference melody, as `noteTargetsFromSmf` returns it and
209
+ * `assignNoteTargets` reads it.
210
+ *
211
+ * Times are seconds from the start of the audio the notes being corrected were
212
+ * extracted from — a reference is lined up against a take by its own clock, not
213
+ * by a frame index into either one. Every field must be finite.
214
+ */
215
+ export interface NoteTarget {
216
+ /** First second of the target's span. */
217
+ startSec: number;
218
+ /** One past the last second of the span. */
219
+ endSec: number;
220
+ /** The pitch that stretch of the part is supposed to be, as a MIDI number. */
221
+ targetMidi: number;
222
+ }
223
+ /**
224
+ * What `assignNoteTargets` does with a note that has a measurable pitch and no
225
+ * target.
226
+ *
227
+ * A note carrying no pitch at all is a different case and no policy reaches it:
228
+ * there is nothing to correct from, so it is never assigned and never edited.
229
+ */
230
+ export type NoteTargetUnmatchedPolicy =
231
+ /** Leave the edit alone; the note renders as recorded. Default. */
232
+ 'leave'
233
+ /** Mute the note's span. */
234
+ | 'mute'
235
+ /** Take the nearest target in time, however far away it is. */
236
+ | 'nearest';
237
+ /** What `assignNoteTargets` returns. */
238
+ export interface NoteTargetAssignResult {
239
+ /**
240
+ * The note set with each assigned note's `edit.pitchShiftSemitones` — and,
241
+ * under `'mute'`, its `edit.muted` — rewritten. A new array: the notes handed
242
+ * in are not touched, and every other field of a note comes back as it went.
243
+ */
244
+ notes: NoteObject[];
245
+ /**
246
+ * How many notes received a target. Zero is a legitimate answer — a reference
247
+ * that does not line up with the take — which is why it is reported rather
248
+ * than left for the caller to infer from the edits.
249
+ */
250
+ assignedCount: number;
251
+ }
252
+ /**
253
+ * One note's pitch curve split into a centre, a slow drift and a vibrato by
254
+ * `decomposeNotePitch`.
255
+ *
256
+ * `driftCents[i] + vibratoCents[i]` is the note's own pitch at frame `i`, in
257
+ * cents above `centreHz`, to within float rounding, so the three parts
258
+ * reconstruct the curve. The drift filter is zero phase, so neither curve is
259
+ * shifted in time against the audio.
260
+ */
261
+ export interface PitchDecompositionResult {
262
+ /**
263
+ * The note's steady pitch in Hz. 0 when the note carries no usable pitch, and
264
+ * then both curves are empty.
265
+ */
266
+ centreHz: number;
267
+ /** Slow deviation from `centreHz` in cents, one entry per frame. */
268
+ driftCents: Float32Array;
269
+ /** Fast deviation in cents, over the same frames. */
270
+ vibratoCents: Float32Array;
271
+ }
272
+ /**
273
+ * Tuning for `analyzePolyphonic`. Every field is optional and 0 or absent takes
274
+ * the documented default.
275
+ *
276
+ * Four fields accept 0 as a value as well as reading it as their default, and are
277
+ * marked below: **pass a negative number to select 0 on those**. Each rejects a
278
+ * negative otherwise, so the two meanings cannot collide.
279
+ *
280
+ * The window function and the centred framing are not settable. Every span, claim
281
+ * and mask offset in this chain is derived against one framing, so a second way to
282
+ * state it would be a second thing to keep in agreement.
283
+ */
284
+ export interface PolyphonicAnalysisOptions {
285
+ /** STFT size the whole chain runs in. Default 4096, the size it is tuned at. */
286
+ nFft?: number;
287
+ /** STFT hop in samples. Default 512. */
288
+ hopLength?: number;
289
+ /** Window length in samples. Defaults to `nFft`. */
290
+ winLength?: number;
291
+ /** Bottom of the cent axis the salience is folded onto, in Hz. Default 55. */
292
+ centRefHz?: number;
293
+ /** Cent-axis resolution. Default 100/3; finer than 1 cent is rejected. */
294
+ centsPerBin?: number;
295
+ /** Top of the cent axis, in Hz. Default 8000. */
296
+ centMaxHz?: number;
297
+ /** Stops weighting bins by tonality, which is on. Default `false`. */
298
+ tonalityOff?: boolean;
299
+ /** Partials summed per F0 candidate. Default 20, at most 128. */
300
+ salienceHarmonics?: number;
301
+ /** Lowest F0 a candidate may take, in Hz. Default 55. */
302
+ f0MinHz?: number;
303
+ /** Highest F0 a candidate may take, in Hz. Default 1760. */
304
+ f0MaxHz?: number;
305
+ /** Harmonic weighting offset, in Hz. Default 27. */
306
+ salienceAlphaHz?: number;
307
+ /** Harmonic weighting scale, in Hz. Default 320. */
308
+ salienceBetaHz?: number;
309
+ /**
310
+ * Partial-series stretch assumed while scoring a candidate, `B` in
311
+ * `f_h = h*f0*sqrt(1 + B*h^2)`. 0 is the default and also a stretch of zero, so
312
+ * it needs no sentinel.
313
+ */
314
+ salienceInharmonicity?: number;
315
+ /** Voices one frame may hold. Default 4, at most 64. */
316
+ maxPolyphony?: number;
317
+ /**
318
+ * Stops the per-frame iteration below this share of the frame's first peak.
319
+ * Default 0.20; **negative selects 0**.
320
+ */
321
+ minFramePeakRatio?: number;
322
+ /** Closest two candidates of one frame may sit. Default 50; **negative selects 0**. */
323
+ minSeparationCents?: number;
324
+ /** Share of a found voice removed before the next iteration. Default 1. */
325
+ subtractionFactor?: number;
326
+ /** A larger move between two frames breaks the ridge. Default 50 cents. */
327
+ maxJumpCents?: number;
328
+ /**
329
+ * A fade below this share of the ridge's own running peak breaks it. Default
330
+ * 0.10; **negative selects 0**.
331
+ */
332
+ minRidgePeakRatio?: number;
333
+ /** Shorter ridges are dropped. Default 140 ms; **negative selects 0**. */
334
+ minRidgeDurationMs?: number;
335
+ /** Partials claimed per note. Default 20, at most 128. */
336
+ maskHarmonics?: number;
337
+ /** Claim half-width in Hann main lobes. Default 1. */
338
+ claimLobes?: number;
339
+ /**
340
+ * Stretch of the claimed partial series, `B` in `f_h = h*f0*sqrt(1 + B*h^2)`.
341
+ * Default 0, which is also a value.
342
+ *
343
+ * Leaving it at 0 for stretched material costs more than a widened claim would:
344
+ * at a piano's `1e-4` the highest partial of a twenty-harmonic claim sits
345
+ * outside the claim entirely, and a partial outside every claim is residual —
346
+ * carried unedited, so it keeps sounding at the old pitch after its note moves.
347
+ */
348
+ inharmonicity?: number;
349
+ /**
350
+ * Fits a stretch per note from the spectrum instead of spending
351
+ * {@link PolyphonicAnalysisOptions.inharmonicity} on every one of them. Default
352
+ * `false`.
353
+ *
354
+ * Off by default because of what it reaches rather than what it costs: at the
355
+ * default framing the fit takes an isolated note in the middle register and
356
+ * refuses a chord. A refused note keeps the declared stretch, so the fit only
357
+ * ever replaces a guess with a measurement —
358
+ * `PolyphonicAnalysis.noteInharmonicity()` reports which notes it reached.
359
+ */
360
+ estimateInharmonicity?: boolean;
361
+ /** Usable partials one fit needs before its result is believed. Default 3. */
362
+ inharmonicityMinPartials?: number;
363
+ /** Largest per-partial misfit a fit may leave, in STFT bins. Default 0.5. */
364
+ inharmonicityMaxResidualBins?: number;
365
+ /** A fitted stretch above this is refused. Default 0.03125. */
366
+ inharmonicityMaxStretch?: number;
367
+ /** Frames per apportionment fit. Default 8, between 4 and 64. */
368
+ windowFrames?: number;
369
+ /** Radians per frame two claimed partials must differ by to be fitted. Default 0.01. */
370
+ minPartialSeparation?: number;
371
+ /** Relative misfit ceiling above which the fit refuses the bin. Default 0.02. */
372
+ maxFitResidual?: number;
373
+ /**
374
+ * Ceiling on one weight's modulus. A weight is a fitted component over the
375
+ * observed bin, so where two partials nearly cancel it exceeds one and the
376
+ * residual carries several times the input there. While every edit is identity
377
+ * that is inaudible — the notes and the residual still sum to the input.
378
+ * Lowering it trades separation for a quieter residual. Default 8.
379
+ */
380
+ maxWeightModulus?: number;
381
+ /** Highest partial usable to refine an F0, in Hz. Default 0, which derives one. */
382
+ maxRefineHz?: number;
383
+ /** Worst F0 error tolerated by the fit, in cents. Default 50. */
384
+ f0ToleranceCents?: number;
385
+ /**
386
+ * Scales each note's reported `f0Stability` only. Every tracked ridge is one
387
+ * note, so a mid-ridge pitch jump is never split into two. Default 50.
388
+ */
389
+ segmentationThresholdCents?: number;
390
+ /**
391
+ * Not read: every tracked ridge is one note, so nothing filters a short note
392
+ * here. Use `minRidgeDurationMs` to drop short ridges instead. Default 30.
393
+ */
394
+ minNoteMs?: number;
395
+ /** Reference pitch each note's `medianCents` is measured against. Default 440. */
396
+ referenceHz?: number;
397
+ }
398
+ /** Options for `PolyphonicAnalysis.render`. All fields are optional. */
399
+ export interface PolyphonicRenderOptions {
400
+ /**
401
+ * Equal-power cross-fade at each edited note's edges. Default 5 ms; a hard cut
402
+ * is deliberately not selectable, because the seam it leaves is a click.
403
+ */
404
+ fadeMs?: number;
405
+ /**
406
+ * Boundary between the drift and the vibrato that `vibratoDepthChange` and
407
+ * `driftChange` act on, in Hz. Default 3 Hz, and it has to be whatever a curve
408
+ * edit was drawn at.
409
+ */
410
+ vibratoCutoffHz?: number;
411
+ }
412
+ /**
413
+ * A pending, non-destructive change to one percussive event.
414
+ * `extractPercussiveEvents` attaches the identity edit (no move, unity gain,
415
+ * unmuted) to every event it returns; `renderPercussiveEvents` applies whatever
416
+ * the caller has changed.
417
+ *
418
+ * A struck sound has no steady pitch to edit, so the axes are time and amplitude
419
+ * and there is deliberately nothing else here.
420
+ */
421
+ export interface PercussiveEventEdit {
422
+ /**
423
+ * Moves the hit along the timeline; negative moves it earlier. Where the hit
424
+ * lands is not bounds-checked, so a moved event may be written over a
425
+ * neighbour, and a shift past either end is truncated there.
426
+ */
427
+ timeOffsetSamples: number;
428
+ /** Level change applied to the hit, which is the span's percussive component. */
429
+ gainDb: number;
430
+ /** Silences the hit; the other fields then do not apply. */
431
+ muted: boolean;
432
+ }
433
+ /**
434
+ * A {@link PercussiveEventEdit} as supplied to `renderPercussiveEvents`. Every
435
+ * field is optional and an omitted one is the identity, so `{}` leaves the event
436
+ * untouched.
437
+ */
438
+ export type PercussiveEventEditInput = Partial<PercussiveEventEdit>;
439
+ /**
440
+ * One editable percussive event returned by `extractPercussiveEvents`.
441
+ *
442
+ * A struck sound located in time: a span in source samples, three measured
443
+ * figures, and a pending edit. It carries no pitch and is never associated with
444
+ * a {@link NoteObject} — the two models are produced by separate calls and do
445
+ * not refer to each other.
446
+ *
447
+ * `onsetSample` and `offsetSample` are 64-bit on the core side and arrive as JS
448
+ * numbers, which are exact up to `Number.MAX_SAFE_INTEGER`.
449
+ */
450
+ export interface PercussiveEvent {
451
+ /** First sample of the span, backtracked to in front of the transient. */
452
+ onsetSample: number;
453
+ /** One past the last sample of the span; the next onset, or the cap. */
454
+ offsetSample: number;
455
+ /**
456
+ * Detector strength at the onset, on the onset envelope's own scale. It orders
457
+ * events against each other and carries no absolute meaning.
458
+ */
459
+ strength: number;
460
+ /**
461
+ * Peak absolute sample of the percussive component over the span, linear.
462
+ * Measured on the signal `gainDb` scales rather than on the source.
463
+ */
464
+ peakAmplitude: number;
465
+ /**
466
+ * Share of the span's energy the separation assigned to percussion, in
467
+ * `[0, 1]`; 0 when the span is silent.
468
+ *
469
+ * It describes the span rather than the onset that opened it. An isolated hit
470
+ * sits near 1, but a real hit over a loud sustain sits near 0, because the
471
+ * sustain owns the span's energy. So it separates a hit from a note attack
472
+ * only where nothing is sustaining through both, and it is not a test for
473
+ * whether a hit is there.
474
+ */
475
+ percussiveRatio: number;
476
+ /** This event's pending edit; the identity as returned. */
477
+ edit: PercussiveEventEdit;
478
+ }
479
+ /**
480
+ * An event handed to `renderPercussiveEvents`. Only the span and the edit are
481
+ * read — the three measured figures are ignored — so a {@link PercussiveEvent}
482
+ * straight from `extractPercussiveEvents` can be passed back with its `edit`
483
+ * changed and nothing else.
484
+ */
485
+ export interface PercussiveEventInput {
486
+ /** First sample of the span. */
487
+ onsetSample: number;
488
+ /** One past the last sample of the span. */
489
+ offsetSample: number;
490
+ /** Omit for the identity edit. */
491
+ edit?: PercussiveEventEditInput;
492
+ }
493
+ /** How a `spectralEdit` region op modifies the masked bins. */
494
+ export type SpectralEditMode = 'gain' | 'attenuate' | 'mute' | 'heal';
495
+ /** Analysis/synthesis window used by `spectralEdit`. */
496
+ export type SpectralEditWindow = 'hann' | 'hamming' | 'blackman' | 'rectangular' | 'rect';
497
+ /** One time x frequency rectangle edit op for `spectralEdit`. */
498
+ export interface SpectralRegionOp {
499
+ /** Region time start (input samples); clamped to [0, length]. Default 0. */
500
+ startSample?: number;
501
+ /** Region time end, exclusive (input samples); clamped to [0, length]. Default = signal length. */
502
+ endSample?: number;
503
+ /** Region frequency low edge in Hz; clamped to [0, nyquist]. Default 0. */
504
+ lowHz?: number;
505
+ /** Region frequency high edge in Hz; <=0 or >= nyquist means nyquist. Default 0. */
506
+ highHz?: number;
507
+ /** Linear gain in dB for 'gain'/'attenuate'; ignored by 'mute'/'heal'. Default 0. */
508
+ gainDb?: number;
509
+ /** Edit mode. Default 'gain'. */
510
+ mode?: SpectralEditMode;
511
+ }
512
+ /** STFT + heal parameters for `spectralEdit`. All fields are optional. */
513
+ export interface SpectralEditOptions {
514
+ /** FFT size; a power of two in `[2, 262144]`. Default 2048. */
515
+ nFft?: number;
516
+ /** Hop length; must satisfy 0 < hop <= nFft/2. Default 512. */
517
+ hopLength?: number;
518
+ /** Analysis + synthesis window. Default 'hann'. */
519
+ window?: SpectralEditWindow;
520
+ /** Neighbour frames each side used by 'heal' (>= 1). Default 2. */
521
+ healRadiusFrames?: number;
522
+ }
523
+ /**
524
+ * Constant-Q / Variable-Q transform magnitude result (mirrors the C
525
+ * `SonareCqtResult`).
526
+ */
527
+ export interface CqtResult {
528
+ /** Number of frequency bins. */
529
+ nBins: number;
530
+ /** Number of time frames. */
531
+ nFrames: number;
532
+ /** Hop length in samples. */
533
+ hopLength: number;
534
+ /** Sample rate in Hz. */
535
+ sampleRate: number;
536
+ /** Row-major `[nBins x nFrames]` magnitude matrix. */
537
+ magnitude: Float32Array;
538
+ /** Center frequency (Hz) of each of the `nBins` bins. */
539
+ frequencies: Float32Array;
540
+ }
541
+ /**
542
+ * Multi-band onset strength matrix result.
543
+ */
544
+ export interface OnsetStrengthMultiResult {
545
+ nBands: number;
546
+ nFrames: number;
547
+ data: Float32Array;
548
+ }
549
+ /**
550
+ * STFT (Short-Time Fourier Transform) result
551
+ */
552
+ export interface StftResult {
553
+ nBins: number;
554
+ nFrames: number;
555
+ nFft: number;
556
+ hopLength: number;
557
+ sampleRate: number;
558
+ magnitude: Float32Array;
559
+ power: Float32Array;
560
+ }
561
+ /**
562
+ * Mel spectrogram result
563
+ */
564
+ export interface MelSpectrogramResult {
565
+ nMels: number;
566
+ nFrames: number;
567
+ sampleRate: number;
568
+ hopLength: number;
569
+ power: Float32Array;
570
+ db: Float32Array;
571
+ }
572
+ /**
573
+ * MFCC result
574
+ */
575
+ export interface MfccResult {
576
+ nMfcc: number;
577
+ nFrames: number;
578
+ coefficients: Float32Array;
579
+ }
580
+ /**
581
+ * STFT power spectrogram result (from inverse Mel reconstruction)
582
+ */
583
+ export interface StftPowerResult {
584
+ nBins: number;
585
+ nFrames: number;
586
+ power: Float32Array;
587
+ }
588
+ /**
589
+ * Mel power spectrogram result (from inverse MFCC reconstruction)
590
+ */
591
+ export interface MelPowerResult {
592
+ nMels: number;
593
+ nFrames: number;
594
+ power: Float32Array;
595
+ }
596
+ /**
597
+ * Chroma features result
598
+ */
599
+ export interface ChromaResult {
600
+ nChroma: number;
601
+ nFrames: number;
602
+ sampleRate: number;
603
+ hopLength: number;
604
+ features: Float32Array;
605
+ meanEnergy: number[];
606
+ }
607
+ /**
608
+ * Pitch detection result
609
+ */
610
+ export interface PitchResult {
611
+ f0: Float32Array;
612
+ /**
613
+ * pYIN's per-frame voiced **observation mass**, exactly as librosa returns
614
+ * it: the summed probability of the frame's voiced pitch hypotheses.
615
+ *
616
+ * This is NOT a signal-quality confidence and NOT a correction weight. The
617
+ * mass depends on how many periods of the pitch fit inside `frameLength`,
618
+ * because the CMNDF troughs of a long period measured over a short frame are
619
+ * shallower. For a fixed `frameLength` it therefore rises with F0 even when
620
+ * the signal is unchanged: a steady three-harmonic tone at 2048 samples /
621
+ * 48 kHz averages well under 0.1 at C2 and about 0.5 at C5, with every frame
622
+ * flagged voiced throughout.
623
+ *
624
+ * Use {@link voicedFlag} for any voicing decision. In particular, thresholding
625
+ * this value at a fixed 0.5 (`noteSegments`' default) drops entire low
626
+ * registers.
627
+ */
628
+ voicedProb: Float32Array;
629
+ /** Per-frame voicing decision from the Viterbi path — the voicing oracle. */
630
+ voicedFlag: boolean[];
631
+ nFrames: number;
632
+ medianF0: number;
633
+ meanF0: number;
634
+ }
635
+ /** Per-bin pitch candidates and peak magnitudes from spectral piptrack. */
636
+ export interface PiptrackResult {
637
+ nBins: number;
638
+ nFrames: number;
639
+ pitches: Float32Array;
640
+ magnitudes: Float32Array;
641
+ }
642
+ /** Magnitude and reassigned time/frequency coordinates for every STFT bin. */
643
+ export interface ReassignedSpectrogramResult {
644
+ nBins: number;
645
+ nFrames: number;
646
+ magnitude: Float32Array;
647
+ times: Float32Array;
648
+ frequencies: Float32Array;
649
+ }
650
+ /** Row-major matrix returned by librosa.segment-compatible APIs. */
651
+ export interface SegmentMatrix {
652
+ rows: number;
653
+ cols: number;
654
+ values: Float32Array;
655
+ }
656
+ /** One stable monophonic note region segmented from an F0 track. */
657
+ export interface NoteSegment {
658
+ frameStart: number;
659
+ frameEnd: number;
660
+ startSeconds: number;
661
+ endSeconds: number;
662
+ medianCents: number;
663
+ }
664
+ /**
665
+ * Loudness measurement result (EBU R128 / ITU-R BS.1770)
666
+ */
667
+ export interface LufsResult {
668
+ integratedLufs: number;
669
+ /** Final complete 400 ms window, not Max-M. */
670
+ momentaryLufs: number;
671
+ /** Final complete 3 s window, not Max-S. */
672
+ shortTermLufs: number;
673
+ /** Maximum 400 ms window (EBU R128 Max-M). */
674
+ maxMomentaryLufs: number;
675
+ /** Maximum 3 s window (EBU R128 Max-S). */
676
+ maxShortTermLufs: number;
677
+ loudnessRange: number;
678
+ }
679
+ /**
680
+ * The two per-block loudness series a multi-channel measurement builds, in
681
+ * LUFS. A signal shorter than a window yields an empty series for it.
682
+ */
683
+ export interface LufsSeriesResult {
684
+ /** 400 ms momentary series. */
685
+ momentary: Float32Array;
686
+ /** 3 s short-term series. */
687
+ shortTerm: Float32Array;
688
+ }
689
+ /**
690
+ * HPSS (Harmonic-Percussive Source Separation) result
691
+ */
692
+ export interface HpssResult {
693
+ harmonic: Float32Array;
694
+ percussive: Float32Array;
695
+ sampleRate: number;
696
+ }
697
+ //# sourceMappingURL=public_types_spectral.d.ts.map