@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
package/NOTICE ADDED
@@ -0,0 +1,178 @@
1
+ libsonare
2
+ Copyright 2024 libsonare contributors
3
+
4
+ This product includes software developed by third parties. Below is the
5
+ attribution for each third-party component whose code reaches a distributed
6
+ binary, and for the project from which algorithms were ported.
7
+
8
+ ================================================================================
9
+ librosa
10
+ ================================================================================
11
+
12
+ Copyright (c) 2013--2023, librosa development team
13
+
14
+ Licensed under the ISC License.
15
+
16
+ libsonare ports audio analysis algorithms from librosa, a Python library for
17
+ music and audio analysis.
18
+
19
+ https://github.com/librosa/librosa
20
+
21
+ ================================================================================
22
+ KissFFT
23
+ ================================================================================
24
+
25
+ Copyright (c) 2003-2010, Mark Borgerding. All rights reserved.
26
+
27
+ Licensed under the BSD 3-Clause License (SPDX: BSD-3-Clause).
28
+
29
+ https://github.com/mborgerding/kissfft
30
+
31
+ Vendored in: third_party/kissfft/
32
+
33
+ ================================================================================
34
+ r8brain-free-src
35
+ ================================================================================
36
+
37
+ Copyright (c) 2013-2025 Aleksey Vaneev
38
+
39
+ Licensed under the MIT License.
40
+
41
+ https://github.com/avaneev/r8brain-free-src
42
+
43
+ Vendored in: third_party/r8brain/
44
+
45
+ r8brain-free-src bundles FFT implementations by other authors under
46
+ third_party/r8brain/fft/. The MIT notice above covers Aleksey Vaneev's work
47
+ only; each bundled implementation keeps its own copyright and terms:
48
+
49
+ Ooura FFT (fft4g.h) — the implementation r8brain's own resampler uses,
50
+ since neither R8B_PFFFT nor R8B_IPP is defined. PFFFT below is compiled
51
+ separately by this project when SONARE_USE_PFFFT is on.
52
+
53
+ Copyright (C) 1996-2001 Takuya OOURA
54
+
55
+ Used with permission granted by the author's license.
56
+
57
+ http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
58
+
59
+ PFFFT and PFFFT DOUBLE (pffft*.c, pffft*.h, simd/pf_*.h)
60
+
61
+ Copyright (c) 2013 Julien Pommier
62
+ Copyright (c) 2020 Hayati Ayguen
63
+ Copyright (c) 2020 Dario Mambro
64
+
65
+ Derived from FFTPACK v4, authored by Dr Paul Swarztrauber of NCAR, and
66
+ distributed under the FFTPACK v5 license (SPDX: BSD-3-Clause):
67
+
68
+ Copyright (c) 2004 the University Corporation for Atmospheric
69
+ Research ("UCAR"). All rights reserved. Developed by NCAR's
70
+ Computational and Information Systems Laboratory, UCAR,
71
+ www.cisl.ucar.edu.
72
+
73
+ https://bitbucket.org/jpommier/pffft
74
+ https://github.com/marton78/pffft
75
+
76
+ AVX-to-NEON translation layer (simd/pf_neon_double_from_avx.h)
77
+
78
+ Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
79
+
80
+ Licensed under the Apache License, Version 2.0 (SPDX: Apache-2.0).
81
+
82
+ https://github.com/kunpengcompute/AvxToNeon
83
+
84
+ ================================================================================
85
+ dr_libs (dr_wav)
86
+ ================================================================================
87
+
88
+ Copyright 2023 David Reid
89
+
90
+ Available as a choice of Public Domain (Unlicense) or MIT No Attribution
91
+ (MIT-0).
92
+
93
+ https://github.com/mackron/dr_libs
94
+
95
+ Vendored in: third_party/dr_libs/
96
+
97
+ ================================================================================
98
+ minimp3
99
+ ================================================================================
100
+
101
+ To the extent possible under law, the author(s) have dedicated all copyright
102
+ and related and neighboring rights to this software to the public domain
103
+ worldwide.
104
+
105
+ Licensed under CC0 1.0 Universal (Public Domain Dedication).
106
+
107
+ https://github.com/lieff/minimp3
108
+
109
+ Vendored in: third_party/minimp3/
110
+
111
+ ================================================================================
112
+ Eigen
113
+ ================================================================================
114
+
115
+ Copyright (c) Benoit Jacob, Gael Guennebaud and the other Eigen contributors
116
+
117
+ Licensed under the Mozilla Public License 2.0 (SPDX: MPL-2.0). Some files in
118
+ the upstream distribution carry BSD or LGPL terms instead; libsonare compiles
119
+ with EIGEN_MPL2_ONLY, which upstream defines as a guarantee that no LGPL file
120
+ is included and makes including one a compilation error.
121
+
122
+ Eigen is header-only and is not vendored: the build uses a system Eigen 3.3 or
123
+ newer where one is installed and otherwise fetches 3.4.1 at configure time.
124
+ Either way its code is compiled into the distributed binaries, which is why it
125
+ is listed here. Source for the version a binary was built against is available
126
+ from the URL below.
127
+
128
+ https://gitlab.com/libeigen/eigen
129
+
130
+ ================================================================================
131
+ SADIE II HRTF Database
132
+ ================================================================================
133
+
134
+ Copyright 2018, University of York.
135
+
136
+ Licensed under the Apache License, Version 2.0 (SPDX: Apache-2.0).
137
+
138
+ libsonare embeds a derived subset of the SADIE II database's subject D1
139
+ (KU100) head-related impulse responses as the playback renderer's default
140
+ HRTF set. The original measurements were reduced to a 5-degree-azimuth by
141
+ 15-degree-elevation grid, converted to 128-tap minimum-phase filters with a
142
+ separately extracted interaural time delay per direction, and quantized to
143
+ int16 in libsonare's own SHRF container format.
144
+
145
+ Citation: Armstrong, C., Thresh, L., Murphy, D., Kearney, G. (2018). "A
146
+ Perceptual Evaluation of Individual and Non-Individual HRTFs: A Case Study
147
+ of the SADIE II Database." Applied Sciences, 8(11), 2029.
148
+
149
+ https://www.york.ac.uk/sadie-project/database.html
150
+
151
+ Embedded as: src/playback/default.shrf
152
+
153
+ The stereo.binaural insert embeds a further reduction of that set's
154
+ elevation-0 row: left/right mirror-averaged 64-tap minimum-phase filters and
155
+ ITDs (src/mastering/stereo/binaural_ring.inc).
156
+
157
+ ================================================================================
158
+ Japanese vowel formant data (Yazawa and Kondo)
159
+ ================================================================================
160
+
161
+ Licensed under CC-BY-4.0. Yazawa, K. and Kondo, M. (2019), Japanese vowel
162
+ length data, Zenodo record 15227304 (https://zenodo.org/records/15227304).
163
+ The male-speaker mean formants of /a e i o u/ set the vowel ratios of the
164
+ effects.filter.vowel table (src/effects/filter/vowel_filter.cpp).
165
+
166
+ ================================================================================
167
+ soundings renderer (GS classic insertion-effect graph)
168
+ ================================================================================
169
+
170
+ Copyright (c) 2026 libraz
171
+
172
+ Licensed under the MIT License.
173
+
174
+ The classic GS insertion-effect realisation (src/midi/synth/gs_classic/)
175
+ ports the node-graph renderer of the soundings measurement project to C++,
176
+ and src/midi/synth/gs_classic_models.inc is generated from that project's
177
+ model files by tools/gs/classic_models.py. The measurements themselves are
178
+ dedicated to the public domain (CC0).
package/README.md CHANGED
@@ -8,22 +8,9 @@
8
8
  [![Docs](https://img.shields.io/badge/docs-libsonare.libraz.net-2563eb)](https://libsonare.libraz.net)
9
9
  [![PyPI](https://img.shields.io/pypi/v/libsonare?label=PyPI)](https://pypi.org/project/libsonare/)
10
10
 
11
- **Turn audio into data and back — entirely in the browser.** Analyze songs
12
- (BPM, key, chords, loudness), master and mix to broadcast loudness, and render
13
- MIDI through built-in instruments, all client-side via WebAssembly — the same
14
- C++ engine that runs natively, with zero dependencies and no Python or model
15
- weights. 88 named mastering DSP processors implemented against published
16
- references (ITU-R BS.1770-4 true-peak limiting, Linkwitz-Riley crossovers,
17
- Vicanek matched-Z biquads, ADAA-antialiased saturation); analysis defaults match
18
- librosa where the two overlap.
11
+ **Turn audio into data and back — entirely in the browser.** Analyze songs (BPM, key, chords, loudness), master and mix to broadcast loudness, and render MIDI through built-in instruments, all client-side via WebAssembly — the same C++ engine that runs natively, with zero dependencies and no model weights. 91 named mastering DSP processors implemented against published references; analysis defaults match librosa where the two overlap.
19
12
 
20
- ## Try it in the browser
21
-
22
- Everything runs client-side — no server, nothing uploaded.
23
-
24
- - 🎧 **[Live demos](https://libsonare.libraz.net/demos)** — analyze a song (BPM / key / chords), master to a target loudness, mix, and render MIDI through the built-in instruments, all in the page.
25
- - 🎛️ **[sonare studio](https://sonare-studio.libraz.net)** — a full browser DAW (multi-track sequencing, piano roll, mixer, mastering, WAV / MP3 / MIDI / MusicXML export) built entirely on this WASM engine. It shows how far one Apache-2.0 engine reaches, from analysis to a playable, exportable arrangement.
26
- - 📖 **[Documentation & getting started](https://libsonare.libraz.net/docs/getting-started)**
13
+ **Guides and the full API reference: [libsonare.libraz.net](https://libsonare.libraz.net)**. Try it without installing anything: the [live demos](https://libsonare.libraz.net/demos), or [sonare studio](https://sonare-studio.libraz.net), a browser DAW whose audio runs on this engine.
27
14
 
28
15
  ## Installation
29
16
 
@@ -31,31 +18,11 @@ Everything runs client-side — no server, nothing uploaded.
31
18
  npm install @libraz/libsonare
32
19
  ```
33
20
 
34
- For BPM/key/chord detection, feature extraction, and metering without the
35
- mastering, mixing, or realtime-engine APIs, import the smaller analysis entry:
36
-
37
- ```typescript
38
- import { detectBpm, init } from '@libraz/libsonare/analysis';
39
- ```
40
-
41
- With emsdk 5.0.2, the analysis binary is 0.91 MiB raw / 368 KiB gzip; the full
42
- entry is 3.88 MiB raw / 1.31 MiB gzip. The analysis entry deliberately has no
43
- `masterAudio`, `mixStereo`, `Project`, `Mixer`, or `RealtimeEngine` export.
21
+ For BPM / key / chord detection, feature extraction and metering without the mastering, mixing or realtime-engine APIs, import the smaller analysis entry: `import { detectBpm, init } from '@libraz/libsonare/analysis'`.
44
22
 
45
23
  ## Quick Start
46
24
 
47
- `init()` loads the WASM module once; every API is available afterwards. Top-level
48
- one-shot functions accept a request object (recommended) or positional arguments.
49
-
50
- > **Audio input:** start with `Audio.fromMemoryWithBrowserFallback(bytes)`. It
51
- > decodes WAV/MP3 in WASM, then uses the browser's `decodeAudioData` for other
52
- > browser-supported formats. Pass a decoded mono `Float32Array` only when one is
53
- > already available.
54
-
55
- > **Platform constraints:** the WebAssembly build is single-threaded (analysis
56
- > runs to completion on the calling thread — there is no non-blocking variant)
57
- > and has no host filesystem access. Drive long-running calls from a Web Worker
58
- > to keep the UI responsive.
25
+ `init()` loads the WASM module once. Start from `Audio.fromMemoryWithBrowserFallback(bytes)`, which decodes WAV / MP3 in WASM and uses the browser's `decodeAudioData` for other formats. The build is single-threaded, so drive long calls from a Web Worker.
59
26
 
60
27
  ```typescript
61
28
  import { Audio, init } from '@libraz/libsonare';
@@ -68,8 +35,7 @@ const { bpm, key } = audio.analyze();
68
35
  console.log(`BPM: ${bpm} Key: ${key.name}`);
69
36
  ```
70
37
 
71
- Render a MIDI arrangement through a built-in instrument with the headless
72
- `Project`. The embind handle is not garbage-collected — call `delete()` when done.
38
+ Render a MIDI arrangement through a built-in instrument with the headless `Project`. The embind handle is not garbage-collected — call `delete()` when done.
73
39
 
74
40
  ```typescript
75
41
  import { init, Project } from '@libraz/libsonare';
@@ -89,173 +55,31 @@ try {
89
55
  }
90
56
  ```
91
57
 
92
- ### Using already-decoded audio
93
-
94
- Use `Float32Array` directly when another API already decoded the audio:
95
-
96
- ```typescript
97
- const audio = Audio.fromBuffer(decoded.getChannelData(0), decoded.sampleRate);
98
- const { bpm, key } = audio.analyze();
99
- ```
100
-
101
- ### Offline Worker for longer audio
102
-
103
- For audio longer than roughly 30 seconds, use `OfflineWorkerClient` to keep
104
- analysis or preset mastering off the UI thread. The published `./worker`
105
- subpath is resolved automatically. It intentionally exposes only one-shot
106
- value APIs (`analyze`, BPM/key/chord detection, and `masterAudio`): native
107
- handles such as `Project`, `Mixer`, and realtime engines stay in their owning
108
- JavaScript realm.
109
-
110
- ```typescript
111
- import { OfflineWorkerClient } from '@libraz/libsonare';
112
-
113
- const offline = new OfflineWorkerClient();
114
- const task = offline.analyze(
115
- { samples, sampleRate },
116
- {
117
- onProgress: ({ progress, stage }) => updateProgress(progress, stage),
118
- // copy: true, // retain `samples`; the default transfers and detaches it
119
- },
120
- );
121
-
122
- cancelButton.onclick = () => task.cancel();
123
- try {
124
- const result = await task;
125
- console.log(result.bpm, result.key.name);
126
- } finally {
127
- offline.dispose();
128
- }
129
- ```
130
-
131
- By default the input `Float32Array` is transferred, so its buffer is detached
132
- on the calling thread. Pass `{ copy: true }` when it must remain usable. Prompt
133
- cancellation of a running synchronous WASM call uses `SharedArrayBuffer`; serve
134
- the page with cross-origin isolation (COOP/COEP) when a cancel button must take
135
- effect immediately. `workerUrl` lets a host point the client at a separately
136
- hosted copy of `@libraz/libsonare/worker`.
137
-
138
- ### Loading the `.wasm` file
139
-
140
- Bundlers that don't auto-resolve the `.wasm` asset need its URL. Pass a
141
- `locateFile` resolver to `init()`:
142
-
143
- ```typescript
144
- import wasmUrl from '@libraz/libsonare/wasm?url'; // Vite; adapt per bundler
145
-
146
- await init({ locateFile: (path) => (path.endsWith('.wasm') ? wasmUrl : path) });
147
- ```
148
-
149
- From a CDN, `import { init } from 'https://esm.sh/@libraz/libsonare'` resolves the
150
- `.wasm` automatically. See the
151
- [getting-started guide](https://libsonare.libraz.net/docs/getting-started) for
152
- per-bundler setup and the AudioWorklet bridge.
153
-
154
- ### Realtime voice changer preset schemas
155
-
156
- The published package includes the JSON Schema documents for third-party voice
157
- changer presets. Resolve them through the package exports rather than copying a
158
- schema from the repository:
159
-
160
- ```text
161
- @libraz/libsonare/schemas/realtime-voice-changer-preset.schema.json
162
- @libraz/libsonare/schemas/realtime-voice-changer-preset-pack.schema.json
163
- ```
164
-
165
- Validate data against the schema before saving it, then pass the JSON text to
166
- `validateRealtimeVoiceChangerPresetJson()` before applying it. The runtime check
167
- is authoritative and also rejects malformed JSON such as duplicate keys.
168
-
169
- ### Bounded-memory OPFS clip streaming
170
-
171
- For long raw float32 clips stored in OPFS, `attachOpfsClipStream` supplies only
172
- the current playback window to WASM. It primes the first page, then fetches page
173
- misses on the main thread and evicts pages outside the configured read-ahead /
174
- retain-behind window. The AudioWorklet path uses the same helper: the worklet
175
- posts a bounded batch of misses, and it outputs silence until a page arrives.
176
-
177
- ```typescript
178
- import { attachOpfsClipStream } from '@libraz/libsonare';
179
- import { SonareEngine } from '@libraz/libsonare/worklet';
180
-
181
- const engine = await SonareEngine.create(audioContext);
182
- const stream = await attachOpfsClipStream(engine, {
183
- path: 'takes/lead.f32',
184
- clipId: 42,
185
- numChannels: 2,
186
- numSamples: 48_000 * 600,
187
- pageFrames: 16_384,
188
- });
189
-
190
- // `clipId` must equal the explicit id supplied here.
191
- engine.addClip(trackId, stream.provider, 0, { id: 42 });
192
-
193
- // Close the returned binding after removing the clip (or when the host closes).
194
- stream.binding.close();
195
- ```
196
-
197
- The bounded-memory guarantee applies only to an OPFS/page-provider source.
198
- Passing a `Float32Array[]` to `addClip` keeps that full array in the JavaScript
199
- heap, so it is appropriate for short clips but does not make long clips bounded.
200
-
201
- ### Cue bus on a second AudioWorklet output
202
-
203
- Per-track PFL/AFL monitoring normally folds the cue into the program output.
204
- Pass `cueOutput` and the node gains a second output carrying the cue alone, so
205
- it can be routed to headphones or a separate device while the program mix stays
206
- untouched.
207
-
208
- ```typescript
209
- import { SonareEngine } from '@libraz/libsonare/worklet';
210
-
211
- const engine = await SonareEngine.create(audioContext, { cueOutput: true });
212
- engine.setTrackMonitorMode(trackId, 'pfl');
213
-
214
- engine.node.connect(audioContext.destination, 0); // program
215
- engine.node.connect(cueDestination, 1); // cue
216
- ```
217
-
218
- Without `cueOutput` the node keeps a single output and the folded mix, sample
219
- for sample. Off the worklet, the same split is available on the zero-copy path
220
- as `prepareMonitorChannels` / `getMonitorChannelBuffer` /
221
- `processPreparedWithMonitor`, and as `processWithMonitor` for a copy-in call.
222
-
223
- ### Mastering preview inside the worklet
224
-
225
- `StreamingMasteringChain` is exported from `@libraz/libsonare/worklet`, so a live
226
- preview can run in the render realm instead of round-tripping audio to the main
227
- thread. Build and `prepare()` it from a message handler — `prepare()` allocates
228
- and must not run inside `process()`. An enabled `loudness` stage needs the
229
- offline-measured `loudnessStaticGainDb`, since whole-signal integrated LUFS
230
- cannot be measured block by block. The chain is a host-side stage: it is outside
231
- the engine's own delay compensation, so aligning it against other engine outputs
232
- is the caller's job.
233
-
234
58
  ## Capabilities
235
59
 
236
- Every area below has runnable examples and the full API in the
237
- [documentation](https://libsonare.libraz.net/docs/wasm).
238
-
239
- - **Analysis** — BPM, key (+ candidates), chords, downbeats, sections, melody, tuning; pitch (YIN / pYIN), timbre, and the full spectral feature set (STFT, mel, MFCC, chroma, CQT/VQT, spectral contrast); metering (true-peak, LUFS, correlation, vectorscope, waveform peaks). → [API](https://libsonare.libraz.net/docs/wasm)
240
- - **Mastering** — 88 named DSP processors, the configurable `masteringChain`, 25 named presets via `masterAudio`, and reference-matching. → [Mastering processors](https://libsonare.libraz.net/docs/mastering-processors)
241
- - **Mixing** — offline `mixStereo` and the block-based `Mixer` with scene presets. → [Mixing](https://libsonare.libraz.net/docs/mixing)
242
- - **Editing DSP** — time-stretch, pitch-shift, HPSS (+ residual), phase vocoder, normalize, trim, remix. → [Editing DSP](https://libsonare.libraz.net/docs/editing-dsp)
243
- - **Room acoustics** — blind RT60 / EDT, impulse-response clarity metrics, RIR synthesis, room estimation and morphing. → [Room acoustics](https://libsonare.libraz.net/docs/acoustic-analysis)
244
- - **Realtime & streaming** — `RealtimeEngine` (transport / MIDI / render, bounded-memory clip streaming), `StreamingMasteringChain` / `StreamingEqualizer` / `StreamingRetune`, `RealtimeVoiceChanger`, and the AudioWorklet bridge. → [Realtime & streaming](https://libsonare.libraz.net/docs/realtime-streaming)
245
- - **Instruments & synthesis** — built-in oscillator synth, patch-driven NativeSynth (15 synthesis engines, incl. physically-modeled piano / strings / winds — being tuned over time), and a GS-compatible SoundFont (SF2) player. → [API](https://libsonare.libraz.net/docs/wasm)
246
- - **Headless DAW** — `Project` arrangement model: audio / MIDI tracks and clips, undo/redo, clip warp, SMF / MIDI 2.0 Clip File I/O, deterministic JSON, offline `bounce`. → [API](https://libsonare.libraz.net/docs/wasm)
247
- - **Conversions** — Hz / mel / MIDI / note, frames / time, resample.
248
-
249
- Native failures throw a `SonareError` carrying a numeric `code` (an `ErrorCode`
250
- value) and its `codeName`; narrow with the `isSonareError` type guard.
60
+ - **Analysis** — BPM, key, chords, downbeats, sections, melody, tuning, pitch, timbre, spectral features and metering. → [Analysis](https://libsonare.libraz.net/docs/wasm)
61
+ - **Stem decomposition and transcription** — `decomposeStems` splits a mix into stems, and `transcribe` turns audio into MIDI events. → [Analysis](https://libsonare.libraz.net/docs/js-api-analysis)
62
+ - **Mastering** — 91 named DSP processors, the configurable `masteringChain`, 30 named presets via `masterAudio`, and reference-matching. → [Mastering processors](https://libsonare.libraz.net/docs/mastering-processors)
63
+ - **Restoration** — five repair-only presets, `vinyl`, `tapeHiss`, `fieldRecording`, `voiceMemo` and `shellac78`. → [Mastering processors](https://libsonare.libraz.net/docs/mastering-processors)
64
+ - **Mixing** — offline `mixStereo`, the block-based `Mixer` with scene presets, and `suggestMixScene`, which suggests a mixer scene with a written explanation without applying it; `sampleRate` is **required** and must be an integer within `[8000, 384000]`. → [Mixing](https://libsonare.libraz.net/docs/mixing), [Mixing assistant](https://libsonare.libraz.net/docs/mixing-assistant)
65
+ - **Editing DSP** — time-stretch, pitch-shift, HPSS, phase vocoder, normalize, trim, remix. → [Editing DSP](https://libsonare.libraz.net/docs/editing-dsp)
66
+ - **Note editing and takes** — edit the notes of monophonic takes (`extractNotes`) and polyphonic material (`analyzePolyphonic`), align a take to a reference with `alignTakeToReference`, and build tuning targets from a MIDI melody with `noteTargetsFromSmf`. → [Project editing](https://libsonare.libraz.net/docs/project-editing-midi), [Recording and takes](https://libsonare.libraz.net/docs/recording-and-takes)
67
+ - **Room acoustics** — blind RT60, impulse-response metrics, RIR synthesis, room estimation and morphing. → [Room acoustics](https://libsonare.libraz.net/docs/acoustic-analysis)
68
+ - **Realtime and streaming** — `RealtimeEngine` with MIDI 1.0 / 2.0 input, bus-to-bus routing with sends, sidechain keys (`setBusSidechain`), `StreamingMasteringChain`, `RealtimeVoiceChanger` and the AudioWorklet bridge. → [Realtime engine](https://libsonare.libraz.net/docs/realtime-engine), [Streaming](https://libsonare.libraz.net/docs/wasm-streaming)
69
+ - **Instruments and synthesis** — built-in synth, the patch-driven NativeSynth, and a GS-compatible SoundFont (SF2) player that receives GS SysEx and offers two GS insertion-effect realisations (`gsEfxRealization`). The acoustic piano is calibrated; the other physical-model voices are still being tuned and will change in 1.8.x patch releases. → [GM and GS](https://libsonare.libraz.net/docs/gm-gs), [Native synth](https://libsonare.libraz.net/docs/native-synth)
70
+ - **Headless DAW** — `Project` with audio and MIDI tracks, undo/redo, SMF and MIDI 2.0 Clip File I/O, and offline `bounce`; `transcribeToClip` writes a transcription into a clip. → [Project editing](https://libsonare.libraz.net/docs/project-editing)
71
+ - **Playback** — `PlaybackRenderer` renders PCM up to 7.1 to speakers or HRTF binaural headphones. → [Playback](https://libsonare.libraz.net/docs/playback)
72
+
73
+ ## Advanced
74
+
75
+ - Offline Worker for long audio (`OfflineWorkerClient`) → [Web Worker usage](https://libsonare.libraz.net/docs/wasm-advanced)
76
+ - Loading the `.wasm` file with `locateFile` → [JavaScript API](https://libsonare.libraz.net/docs/js-api)
77
+ - Realtime voice changer preset schemas → [Realtime voice changer](https://libsonare.libraz.net/docs/realtime-voice-changer)
78
+ - Bounded-memory OPFS clip streaming, the cue bus and mastering preview in the worklet → [Realtime and streaming](https://libsonare.libraz.net/docs/realtime-streaming)
251
79
 
252
80
  ## Documentation
253
81
 
254
- Full API reference, guides, and browser-local demos live at
255
- **[libsonare.libraz.net](https://libsonare.libraz.net)**
256
- ([getting started](https://libsonare.libraz.net/docs/getting-started) ·
257
- [browser / WASM API](https://libsonare.libraz.net/docs/wasm) ·
258
- [demos](https://libsonare.libraz.net/demos)).
82
+ [Getting started](https://libsonare.libraz.net/docs/getting-started) · [Browser / WASM API](https://libsonare.libraz.net/docs/wasm) · [Examples](https://libsonare.libraz.net/docs/examples) · [Binding parity](https://libsonare.libraz.net/docs/binding-parity) · [Demos](https://libsonare.libraz.net/demos).
259
83
 
260
84
  ## Also available
261
85
 
@@ -263,8 +87,7 @@ Full API reference, guides, and browser-local demos live at
263
87
  pip install libsonare # Python bindings with CLI
264
88
  ```
265
89
 
266
- The native Node.js N-API binding (reads files from disk) lives at
267
- [`bindings/node`](https://github.com/libraz/libsonare/tree/main/bindings/node).
90
+ The native Node.js N-API binding (reads files from disk) lives at [`bindings/node`](https://github.com/libraz/libsonare/tree/main/bindings/node).
268
91
 
269
92
  ## License
270
93
 
@@ -0,0 +1,14 @@
1
+ import type { MasteringChainConfig } from './public_types';
2
+ /**
3
+ * Flattens a nested {@link MasteringChainConfig} into the dot-notation
4
+ * `{ "module.processor.param": value }` map the core consumes. Internal helper
5
+ * shared by the mastering-chain / master-audio entry points. The core owns
6
+ * legacy leaf-name aliases, so this remains a structural flattening step.
7
+ *
8
+ * A key the caller already wrote in dot notation carries through untouched, so
9
+ * both spellings a {@link MasteringChainConfig} accepts reach the core as the
10
+ * same parameter — matching what the Python binding documents. An unknown key
11
+ * in either spelling is rejected by the core, not here.
12
+ */
13
+ export declare function flattenChainConfig(config: MasteringChainConfig): Record<string, number | boolean>;
14
+ //# sourceMappingURL=_chain_config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_chain_config.d.ts","sourceRoot":"","sources":["../src/_chain_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAI3D;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAiBjG"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Input conversion the effect families share.
3
+ */
4
+ import type { VoicedFlags } from './public_types';
5
+ export declare function toVoicedFloat32(voiced: VoicedFlags): Float32Array;
6
+ //# sourceMappingURL=_effects_common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_effects_common.d.ts","sourceRoot":"","sources":["../src/_effects_common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAMjE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Input checks the spectrogram and inverse-transform entries share.
3
+ */
4
+ import type { ValidateOptions } from './validation';
5
+ export type GuardedOptions = ValidateOptions;
6
+ export declare function validatePositiveIntegers(fnName: string, values: Record<string, number>): void;
7
+ export declare function validateMelFrequencyRange(fnName: string, fmin: number, fmax: number, sampleRate: number): void;
8
+ //# sourceMappingURL=_feature_validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_feature_validation.d.ts","sourceRoot":"","sources":["../src/_feature_validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;AAE7C,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAI7F;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,IAAI,CAaN"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The facade's single FFT-size/hop domain.
3
+ *
4
+ * This module is deliberately internal: sibling facade modules import it, but
5
+ * nothing re-exports it, so it stays out of the package entry point and out of
6
+ * the C-ABI parity surface (which is defined by the index's re-export closure).
7
+ */
8
+ /**
9
+ * Resolves and validates the `nFft` / `hopLength` pair every STFT-backed entry
10
+ * point takes.
11
+ *
12
+ * The core FFT is mixed-radix, so any even size transforms exactly; only the
13
+ * real one-sided spectrum's `n_fft / 2 + 1` bin layout needs the evenness. A
14
+ * power-of-two restriction rejects sizes the C ABI and the native CLI accept,
15
+ * which is what a second copy of this rule used to do: `hpss({ nFft: 1536 })`
16
+ * worked while `hpssWithResidual({ nFft: 1536 })` threw, with the message
17
+ * asserting a constraint this project had explicitly written down as untrue.
18
+ * One implementation, so the two cannot disagree again.
19
+ */
20
+ export declare function resolveFftOptions(fnName: string, nFft: unknown, hopLength: unknown): {
21
+ nFft: number;
22
+ hopLength: number;
23
+ };
24
+ //# sourceMappingURL=_fft_options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_fft_options.d.ts","sourceRoot":"","sources":["../src/_fft_options.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,OAAO,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAQrC"}
@@ -0,0 +1,50 @@
1
+ import type { AlignTakeToReferenceRequest, AlignTakeToReferenceResult } from './project_types';
2
+ /**
3
+ * Aligns one take to a reference timeline and returns the warp anchors that place
4
+ * the take under it.
5
+ *
6
+ * A chromagram is measured for each signal and the two are aligned, then the
7
+ * alignment is reduced to anchors {@link Project.setWarpMap} accepts: at least
8
+ * two finite, strictly increasing pairs. The reduction is needed rather than
9
+ * decorative — an alignment path advances one axis at a time, so the raw
10
+ * correspondence repeats a coordinate wherever one signal carries more frames
11
+ * than the other, and those pairs are refused as a warp map.
12
+ *
13
+ * **The anchors are oriented for the take's own clip.** `warpSample` is a
14
+ * position on the REFERENCE timeline and `sourceSample` the corresponding
15
+ * position in the TAKE, which is the direction a clip whose source is that take
16
+ * needs. This is why the entry point exists rather than the core alignment
17
+ * primitive being exposed directly: that one names its arguments the other way
18
+ * round, so passing the reference as its reference yields the inverse map and
19
+ * nothing reports it.
20
+ *
21
+ * Both signals are read at `sampleRate`; resample first if they differ, since
22
+ * the alignment does no I/O and no rate conversion.
23
+ *
24
+ * {@link AlignTakeToReferenceResult.alignment} is descriptive only — it says how
25
+ * far the path strayed from a constant rate, so a caller can tell a take the
26
+ * reference genuinely fits from one it does not, and supplies its own threshold.
27
+ *
28
+ * @param request - The two signals, their shared sample rate, and the chroma
29
+ * resolution
30
+ * @returns The anchors and how well the alignment was conditioned
31
+ * @throws {RangeError} on an empty buffer, a non-finite sample, or a `sampleRate`
32
+ * outside `[8000, 384000]`
33
+ * @throws {SonareError} `InvalidParameter` on a non-positive `hopLength` or
34
+ * `binsPerOctave`, on a `binsPerOctave` that is not a multiple of 12, on a
35
+ * signal too short to measure two chroma frames, or when the two signals produce
36
+ * no pair of distinct anchors — which is what an unalignable pair looks like,
37
+ * and is reported rather than answered with a map you cannot use
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const { anchors } = alignTakeToReference({ reference: guide, take, sampleRate });
42
+ * const project = new Project();
43
+ * const trackId = project.addTrack({ kind: 'audio' });
44
+ * const clipId = project.addClip({ trackId, lengthPpq: 64, audio: take, audioSampleRate: sampleRate }); // 16 bars at 4/4, in quarter notes (PPQ)
45
+ * project.setWarpMap({ id: 1, anchors });
46
+ * project.setClipWarpRef(clipId, 1);
47
+ * ```
48
+ */
49
+ export declare function alignTakeToReference(request: AlignTakeToReferenceRequest): AlignTakeToReferenceResult;
50
+ //# sourceMappingURL=align_take.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"align_take.d.ts","sourceRoot":"","sources":["../src/align_take.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAG/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,0BAA0B,CAU5B"}