playlist-data-engine 1.1.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 (345) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +352 -0
  3. package/dist/__vite-browser-external-DYxpcVy9.js +4 -0
  4. package/dist/constants/DefaultClasses.d.ts +46 -0
  5. package/dist/constants/DefaultClasses.d.ts.map +1 -0
  6. package/dist/constants/DefaultEnchantments.d.ts +337 -0
  7. package/dist/constants/DefaultEnchantments.d.ts.map +1 -0
  8. package/dist/constants/DefaultEnemies.d.ts +83 -0
  9. package/dist/constants/DefaultEnemies.d.ts.map +1 -0
  10. package/dist/constants/DefaultEquipment.d.ts +23 -0
  11. package/dist/constants/DefaultEquipment.d.ts.map +1 -0
  12. package/dist/constants/DefaultFeatures.d.ts +22 -0
  13. package/dist/constants/DefaultFeatures.d.ts.map +1 -0
  14. package/dist/constants/DefaultRaces.d.ts +102 -0
  15. package/dist/constants/DefaultRaces.d.ts.map +1 -0
  16. package/dist/constants/DefaultSkills.d.ts +26 -0
  17. package/dist/constants/DefaultSkills.d.ts.map +1 -0
  18. package/dist/constants/DefaultSpells.d.ts +41 -0
  19. package/dist/constants/DefaultSpells.d.ts.map +1 -0
  20. package/dist/constants/EncounterBalance.d.ts +208 -0
  21. package/dist/constants/EncounterBalance.d.ts.map +1 -0
  22. package/dist/constants/EnemyEquipment.d.ts +71 -0
  23. package/dist/constants/EnemyEquipment.d.ts.map +1 -0
  24. package/dist/constants/EnemyRarity.d.ts +79 -0
  25. package/dist/constants/EnemyRarity.d.ts.map +1 -0
  26. package/dist/constants/EnemyTemplates/Construct.d.ts +63 -0
  27. package/dist/constants/EnemyTemplates/Construct.d.ts.map +1 -0
  28. package/dist/constants/EnemyTemplates/Dragon.d.ts +68 -0
  29. package/dist/constants/EnemyTemplates/Dragon.d.ts.map +1 -0
  30. package/dist/constants/EnemyTemplates/Elemental.d.ts +64 -0
  31. package/dist/constants/EnemyTemplates/Elemental.d.ts.map +1 -0
  32. package/dist/constants/EnemyTemplates/Fiend.d.ts +62 -0
  33. package/dist/constants/EnemyTemplates/Fiend.d.ts.map +1 -0
  34. package/dist/constants/EnemyTemplates/Monstrosity.d.ts +63 -0
  35. package/dist/constants/EnemyTemplates/Monstrosity.d.ts.map +1 -0
  36. package/dist/constants/EnemyTemplates/Undead.d.ts +61 -0
  37. package/dist/constants/EnemyTemplates/Undead.d.ts.map +1 -0
  38. package/dist/constants/ItemTemplates.d.ts +40 -0
  39. package/dist/constants/ItemTemplates.d.ts.map +1 -0
  40. package/dist/constants/MagicItems.d.ts +30 -0
  41. package/dist/constants/MagicItems.d.ts.map +1 -0
  42. package/dist/constants/SpellSlots.d.ts +30 -0
  43. package/dist/constants/SpellSlots.d.ts.map +1 -0
  44. package/dist/constants/StatScaling.d.ts +113 -0
  45. package/dist/constants/StatScaling.d.ts.map +1 -0
  46. package/dist/core/analysis/AudioAnalyzer.d.ts +599 -0
  47. package/dist/core/analysis/AudioAnalyzer.d.ts.map +1 -0
  48. package/dist/core/analysis/ColorExtractor.d.ts +64 -0
  49. package/dist/core/analysis/ColorExtractor.d.ts.map +1 -0
  50. package/dist/core/analysis/EssentiaPitchDetector.d.ts +282 -0
  51. package/dist/core/analysis/EssentiaPitchDetector.d.ts.map +1 -0
  52. package/dist/core/analysis/LevelSerializer.d.ts +265 -0
  53. package/dist/core/analysis/LevelSerializer.d.ts.map +1 -0
  54. package/dist/core/analysis/MelodyContourAnalyzer.d.ts +283 -0
  55. package/dist/core/analysis/MelodyContourAnalyzer.d.ts.map +1 -0
  56. package/dist/core/analysis/MultiBandAnalyzer.d.ts +214 -0
  57. package/dist/core/analysis/MultiBandAnalyzer.d.ts.map +1 -0
  58. package/dist/core/analysis/MusicClassifier.d.ts +524 -0
  59. package/dist/core/analysis/MusicClassifier.d.ts.map +1 -0
  60. package/dist/core/analysis/PitchAnalyzer.d.ts +266 -0
  61. package/dist/core/analysis/PitchAnalyzer.d.ts.map +1 -0
  62. package/dist/core/analysis/PitchDetector.d.ts +251 -0
  63. package/dist/core/analysis/PitchDetector.d.ts.map +1 -0
  64. package/dist/core/analysis/SpectrumScanner.d.ts +52 -0
  65. package/dist/core/analysis/SpectrumScanner.d.ts.map +1 -0
  66. package/dist/core/analysis/beat/BeatInterpolator.d.ts +477 -0
  67. package/dist/core/analysis/beat/BeatInterpolator.d.ts.map +1 -0
  68. package/dist/core/analysis/beat/BeatMapGenerator.d.ts +170 -0
  69. package/dist/core/analysis/beat/BeatMapGenerator.d.ts.map +1 -0
  70. package/dist/core/analysis/beat/BeatStream.d.ts +316 -0
  71. package/dist/core/analysis/beat/BeatStream.d.ts.map +1 -0
  72. package/dist/core/analysis/beat/BeatSubdivider.d.ts +205 -0
  73. package/dist/core/analysis/beat/BeatSubdivider.d.ts.map +1 -0
  74. package/dist/core/analysis/beat/BeatTracker.d.ts +137 -0
  75. package/dist/core/analysis/beat/BeatTracker.d.ts.map +1 -0
  76. package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts +180 -0
  77. package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts.map +1 -0
  78. package/dist/core/analysis/beat/DensityAnalyzer.d.ts +246 -0
  79. package/dist/core/analysis/beat/DensityAnalyzer.d.ts.map +1 -0
  80. package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts +1082 -0
  81. package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts.map +1 -0
  82. package/dist/core/analysis/beat/GrooveAnalyzer.d.ts +192 -0
  83. package/dist/core/analysis/beat/GrooveAnalyzer.d.ts.map +1 -0
  84. package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts +133 -0
  85. package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts.map +1 -0
  86. package/dist/core/analysis/beat/PhraseAnalyzer.d.ts +230 -0
  87. package/dist/core/analysis/beat/PhraseAnalyzer.d.ts.map +1 -0
  88. package/dist/core/analysis/beat/RhythmQuantizer.d.ts +399 -0
  89. package/dist/core/analysis/beat/RhythmQuantizer.d.ts.map +1 -0
  90. package/dist/core/analysis/beat/RhythmicBalancer.d.ts +262 -0
  91. package/dist/core/analysis/beat/RhythmicBalancer.d.ts.map +1 -0
  92. package/dist/core/analysis/beat/StreamScorer.d.ts +275 -0
  93. package/dist/core/analysis/beat/StreamScorer.d.ts.map +1 -0
  94. package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts +256 -0
  95. package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts.map +1 -0
  96. package/dist/core/analysis/beat/TempoDetector.d.ts +220 -0
  97. package/dist/core/analysis/beat/TempoDetector.d.ts.map +1 -0
  98. package/dist/core/analysis/beat/TransientDetector.d.ts +303 -0
  99. package/dist/core/analysis/beat/TransientDetector.d.ts.map +1 -0
  100. package/dist/core/analysis/beat/beatKeyHelpers.d.ts +180 -0
  101. package/dist/core/analysis/beat/beatKeyHelpers.d.ts.map +1 -0
  102. package/dist/core/analysis/beat/index.d.ts +41 -0
  103. package/dist/core/analysis/beat/index.d.ts.map +1 -0
  104. package/dist/core/analysis/beat/utils/audioUtils.d.ts +204 -0
  105. package/dist/core/analysis/beat/utils/audioUtils.d.ts.map +1 -0
  106. package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts +404 -0
  107. package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts.map +1 -0
  108. package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts +61 -0
  109. package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts.map +1 -0
  110. package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts +33 -0
  111. package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts.map +1 -0
  112. package/dist/core/analysis/index.d.ts +18 -0
  113. package/dist/core/analysis/index.d.ts.map +1 -0
  114. package/dist/core/combat/AI/AICombatRunner.d.ts +108 -0
  115. package/dist/core/combat/AI/AICombatRunner.d.ts.map +1 -0
  116. package/dist/core/combat/AI/CombatAI.d.ts +179 -0
  117. package/dist/core/combat/AI/CombatAI.d.ts.map +1 -0
  118. package/dist/core/combat/AI/CombatMetricsTracker.d.ts +30 -0
  119. package/dist/core/combat/AI/CombatMetricsTracker.d.ts.map +1 -0
  120. package/dist/core/combat/Analysis/BalanceValidator.d.ts +170 -0
  121. package/dist/core/combat/Analysis/BalanceValidator.d.ts.map +1 -0
  122. package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts +231 -0
  123. package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts.map +1 -0
  124. package/dist/core/combat/Analysis/DifficultyCalculator.d.ts +203 -0
  125. package/dist/core/combat/Analysis/DifficultyCalculator.d.ts.map +1 -0
  126. package/dist/core/combat/Analysis/ParameterSweep.d.ts +201 -0
  127. package/dist/core/combat/Analysis/ParameterSweep.d.ts.map +1 -0
  128. package/dist/core/combat/AttackResolver.d.ts +220 -0
  129. package/dist/core/combat/AttackResolver.d.ts.map +1 -0
  130. package/dist/core/combat/CombatEngine.d.ts +388 -0
  131. package/dist/core/combat/CombatEngine.d.ts.map +1 -0
  132. package/dist/core/combat/DiceRoller.d.ts +115 -0
  133. package/dist/core/combat/DiceRoller.d.ts.map +1 -0
  134. package/dist/core/combat/InitiativeRoller.d.ts +62 -0
  135. package/dist/core/combat/InitiativeRoller.d.ts.map +1 -0
  136. package/dist/core/combat/PartyAnalyzer.d.ts +215 -0
  137. package/dist/core/combat/PartyAnalyzer.d.ts.map +1 -0
  138. package/dist/core/combat/SeededDiceRoller.d.ts +120 -0
  139. package/dist/core/combat/SeededDiceRoller.d.ts.map +1 -0
  140. package/dist/core/combat/Simulation/CombatSimulator.d.ts +366 -0
  141. package/dist/core/combat/Simulation/CombatSimulator.d.ts.map +1 -0
  142. package/dist/core/combat/SpellCaster.d.ts +113 -0
  143. package/dist/core/combat/SpellCaster.d.ts.map +1 -0
  144. package/dist/core/config/index.d.ts +24 -0
  145. package/dist/core/config/index.d.ts.map +1 -0
  146. package/dist/core/config/progressionConfig.d.ts +73 -0
  147. package/dist/core/config/progressionConfig.d.ts.map +1 -0
  148. package/dist/core/config/sensorConfig.d.ts +134 -0
  149. package/dist/core/config/sensorConfig.d.ts.map +1 -0
  150. package/dist/core/equipment/BoxOpener.d.ts +175 -0
  151. package/dist/core/equipment/BoxOpener.d.ts.map +1 -0
  152. package/dist/core/equipment/EquipmentEffectApplier.d.ts +189 -0
  153. package/dist/core/equipment/EquipmentEffectApplier.d.ts.map +1 -0
  154. package/dist/core/equipment/EquipmentModifier.d.ts +327 -0
  155. package/dist/core/equipment/EquipmentModifier.d.ts.map +1 -0
  156. package/dist/core/equipment/EquipmentSpawnHelper.d.ts +246 -0
  157. package/dist/core/equipment/EquipmentSpawnHelper.d.ts.map +1 -0
  158. package/dist/core/equipment/EquipmentValidator.d.ts +173 -0
  159. package/dist/core/equipment/EquipmentValidator.d.ts.map +1 -0
  160. package/dist/core/extensions/ExtensionManager.d.ts +517 -0
  161. package/dist/core/extensions/ExtensionManager.d.ts.map +1 -0
  162. package/dist/core/extensions/WeightedSelector.d.ts +156 -0
  163. package/dist/core/extensions/WeightedSelector.d.ts.map +1 -0
  164. package/dist/core/extensions/index.d.ts +11 -0
  165. package/dist/core/extensions/index.d.ts.map +1 -0
  166. package/dist/core/extensions/initializeDefaults.d.ts +170 -0
  167. package/dist/core/extensions/initializeDefaults.d.ts.map +1 -0
  168. package/dist/core/features/FeatureEffectApplier.d.ts +102 -0
  169. package/dist/core/features/FeatureEffectApplier.d.ts.map +1 -0
  170. package/dist/core/features/FeatureQuery.d.ts +368 -0
  171. package/dist/core/features/FeatureQuery.d.ts.map +1 -0
  172. package/dist/core/features/FeatureTypes.d.ts +199 -0
  173. package/dist/core/features/FeatureTypes.d.ts.map +1 -0
  174. package/dist/core/features/FeatureValidator.d.ts +149 -0
  175. package/dist/core/features/FeatureValidator.d.ts.map +1 -0
  176. package/dist/core/features/index.d.ts +12 -0
  177. package/dist/core/features/index.d.ts.map +1 -0
  178. package/dist/core/generation/AbilityScoreCalculator.d.ts +83 -0
  179. package/dist/core/generation/AbilityScoreCalculator.d.ts.map +1 -0
  180. package/dist/core/generation/AppearanceGenerator.d.ts +32 -0
  181. package/dist/core/generation/AppearanceGenerator.d.ts.map +1 -0
  182. package/dist/core/generation/BeatConverter.d.ts +127 -0
  183. package/dist/core/generation/BeatConverter.d.ts.map +1 -0
  184. package/dist/core/generation/ButtonMapper.d.ts +346 -0
  185. package/dist/core/generation/ButtonMapper.d.ts.map +1 -0
  186. package/dist/core/generation/ButtonPatternLibrary.d.ts +92 -0
  187. package/dist/core/generation/ButtonPatternLibrary.d.ts.map +1 -0
  188. package/dist/core/generation/CRLevelConverter.d.ts +242 -0
  189. package/dist/core/generation/CRLevelConverter.d.ts.map +1 -0
  190. package/dist/core/generation/CharacterGenerator.d.ts +194 -0
  191. package/dist/core/generation/CharacterGenerator.d.ts.map +1 -0
  192. package/dist/core/generation/ClassSuggester.d.ts +184 -0
  193. package/dist/core/generation/ClassSuggester.d.ts.map +1 -0
  194. package/dist/core/generation/EnemyEquipmentGenerator.d.ts +151 -0
  195. package/dist/core/generation/EnemyEquipmentGenerator.d.ts.map +1 -0
  196. package/dist/core/generation/EnemyGenerator.d.ts +595 -0
  197. package/dist/core/generation/EnemyGenerator.d.ts.map +1 -0
  198. package/dist/core/generation/EquipmentGenerator.d.ts +204 -0
  199. package/dist/core/generation/EquipmentGenerator.d.ts.map +1 -0
  200. package/dist/core/generation/LegendaryGenerator.d.ts +213 -0
  201. package/dist/core/generation/LegendaryGenerator.d.ts.map +1 -0
  202. package/dist/core/generation/LevelGenerator.d.ts +390 -0
  203. package/dist/core/generation/LevelGenerator.d.ts.map +1 -0
  204. package/dist/core/generation/NamingEngine.d.ts +136 -0
  205. package/dist/core/generation/NamingEngine.d.ts.map +1 -0
  206. package/dist/core/generation/PitchBeatLinker.d.ts +150 -0
  207. package/dist/core/generation/PitchBeatLinker.d.ts.map +1 -0
  208. package/dist/core/generation/RaceSelector.d.ts +58 -0
  209. package/dist/core/generation/RaceSelector.d.ts.map +1 -0
  210. package/dist/core/generation/RhythmGenerator.d.ts +597 -0
  211. package/dist/core/generation/RhythmGenerator.d.ts.map +1 -0
  212. package/dist/core/generation/SkillAssigner.d.ts +78 -0
  213. package/dist/core/generation/SkillAssigner.d.ts.map +1 -0
  214. package/dist/core/generation/SpellManager.d.ts +132 -0
  215. package/dist/core/generation/SpellManager.d.ts.map +1 -0
  216. package/dist/core/generation/SpellcastingGenerator.d.ts +255 -0
  217. package/dist/core/generation/SpellcastingGenerator.d.ts.map +1 -0
  218. package/dist/core/generation/index.d.ts +41 -0
  219. package/dist/core/generation/index.d.ts.map +1 -0
  220. package/dist/core/parser/MetadataExtractor.d.ts +66 -0
  221. package/dist/core/parser/MetadataExtractor.d.ts.map +1 -0
  222. package/dist/core/parser/PlaylistParser.d.ts +45 -0
  223. package/dist/core/parser/PlaylistParser.d.ts.map +1 -0
  224. package/dist/core/playback/SubdivisionPlaybackController.d.ts +333 -0
  225. package/dist/core/playback/SubdivisionPlaybackController.d.ts.map +1 -0
  226. package/dist/core/playback/index.d.ts +5 -0
  227. package/dist/core/playback/index.d.ts.map +1 -0
  228. package/dist/core/progression/CharacterUpdater.d.ts +203 -0
  229. package/dist/core/progression/CharacterUpdater.d.ts.map +1 -0
  230. package/dist/core/progression/LevelUpProcessor.d.ts +234 -0
  231. package/dist/core/progression/LevelUpProcessor.d.ts.map +1 -0
  232. package/dist/core/progression/PrestigeSystem.d.ts +217 -0
  233. package/dist/core/progression/PrestigeSystem.d.ts.map +1 -0
  234. package/dist/core/progression/RhythmXPCalculator.d.ts +182 -0
  235. package/dist/core/progression/RhythmXPCalculator.d.ts.map +1 -0
  236. package/dist/core/progression/SessionTracker.d.ts +169 -0
  237. package/dist/core/progression/SessionTracker.d.ts.map +1 -0
  238. package/dist/core/progression/XPCalculator.d.ts +128 -0
  239. package/dist/core/progression/XPCalculator.d.ts.map +1 -0
  240. package/dist/core/progression/stat/StatIncreaseStrategy.d.ts +97 -0
  241. package/dist/core/progression/stat/StatIncreaseStrategy.d.ts.map +1 -0
  242. package/dist/core/progression/stat/StatManager.d.ts +179 -0
  243. package/dist/core/progression/stat/StatManager.d.ts.map +1 -0
  244. package/dist/core/sensors/EnvironmentalSensors.d.ts +301 -0
  245. package/dist/core/sensors/EnvironmentalSensors.d.ts.map +1 -0
  246. package/dist/core/sensors/GamingPlatformSensors.d.ts +162 -0
  247. package/dist/core/sensors/GamingPlatformSensors.d.ts.map +1 -0
  248. package/dist/core/sensors/GeolocationProvider.d.ts +156 -0
  249. package/dist/core/sensors/GeolocationProvider.d.ts.map +1 -0
  250. package/dist/core/sensors/MotionDetector.d.ts +58 -0
  251. package/dist/core/sensors/MotionDetector.d.ts.map +1 -0
  252. package/dist/core/sensors/SteamAPIClient.d.ts +108 -0
  253. package/dist/core/sensors/SteamAPIClient.d.ts.map +1 -0
  254. package/dist/core/sensors/WeatherAPIClient.d.ts +360 -0
  255. package/dist/core/sensors/WeatherAPIClient.d.ts.map +1 -0
  256. package/dist/core/sensors/schemas/weather.schema.d.ts +144 -0
  257. package/dist/core/sensors/schemas/weather.schema.d.ts.map +1 -0
  258. package/dist/core/skills/SkillQuery.d.ts +159 -0
  259. package/dist/core/skills/SkillQuery.d.ts.map +1 -0
  260. package/dist/core/skills/SkillTypes.d.ts +233 -0
  261. package/dist/core/skills/SkillTypes.d.ts.map +1 -0
  262. package/dist/core/skills/SkillValidator.d.ts +146 -0
  263. package/dist/core/skills/SkillValidator.d.ts.map +1 -0
  264. package/dist/core/skills/index.d.ts +11 -0
  265. package/dist/core/skills/index.d.ts.map +1 -0
  266. package/dist/core/spells/SpellQuery.d.ts +194 -0
  267. package/dist/core/spells/SpellQuery.d.ts.map +1 -0
  268. package/dist/core/spells/SpellTypes.d.ts +71 -0
  269. package/dist/core/spells/SpellTypes.d.ts.map +1 -0
  270. package/dist/core/spells/SpellValidator.d.ts +129 -0
  271. package/dist/core/spells/SpellValidator.d.ts.map +1 -0
  272. package/dist/core/spells/index.d.ts +11 -0
  273. package/dist/core/spells/index.d.ts.map +1 -0
  274. package/dist/core/types/AudioProfile.d.ts +143 -0
  275. package/dist/core/types/AudioProfile.d.ts.map +1 -0
  276. package/dist/core/types/BeatMap.d.ts +1825 -0
  277. package/dist/core/types/BeatMap.d.ts.map +1 -0
  278. package/dist/core/types/ButtonMapping.d.ts +345 -0
  279. package/dist/core/types/ButtonMapping.d.ts.map +1 -0
  280. package/dist/core/types/Character.d.ts +397 -0
  281. package/dist/core/types/Character.d.ts.map +1 -0
  282. package/dist/core/types/ChartedBeatMap.d.ts +169 -0
  283. package/dist/core/types/ChartedBeatMap.d.ts.map +1 -0
  284. package/dist/core/types/Combat.d.ts +268 -0
  285. package/dist/core/types/Combat.d.ts.map +1 -0
  286. package/dist/core/types/CombatAI.d.ts +143 -0
  287. package/dist/core/types/CombatAI.d.ts.map +1 -0
  288. package/dist/core/types/Enemy.d.ts +447 -0
  289. package/dist/core/types/Enemy.d.ts.map +1 -0
  290. package/dist/core/types/Environmental.d.ts +213 -0
  291. package/dist/core/types/Environmental.d.ts.map +1 -0
  292. package/dist/core/types/Equipment.d.ts +309 -0
  293. package/dist/core/types/Equipment.d.ts.map +1 -0
  294. package/dist/core/types/ISessionTracker.d.ts +48 -0
  295. package/dist/core/types/ISessionTracker.d.ts.map +1 -0
  296. package/dist/core/types/LevelExport.d.ts +366 -0
  297. package/dist/core/types/LevelExport.d.ts.map +1 -0
  298. package/dist/core/types/Playlist.d.ts +70 -0
  299. package/dist/core/types/Playlist.d.ts.map +1 -0
  300. package/dist/core/types/Prestige.d.ts +94 -0
  301. package/dist/core/types/Prestige.d.ts.map +1 -0
  302. package/dist/core/types/Progression.d.ts +214 -0
  303. package/dist/core/types/Progression.d.ts.map +1 -0
  304. package/dist/core/types/RhythmXP.d.ts +398 -0
  305. package/dist/core/types/RhythmXP.d.ts.map +1 -0
  306. package/dist/core/utils/AbilityConstants.d.ts +31 -0
  307. package/dist/core/utils/AbilityConstants.d.ts.map +1 -0
  308. package/dist/core/utils/EffectApplierUtils.d.ts +56 -0
  309. package/dist/core/utils/EffectApplierUtils.d.ts.map +1 -0
  310. package/dist/core/utils/ImageValidator.d.ts +66 -0
  311. package/dist/core/utils/ImageValidator.d.ts.map +1 -0
  312. package/dist/core/utils/PrerequisiteValidator.d.ts +88 -0
  313. package/dist/core/utils/PrerequisiteValidator.d.ts.map +1 -0
  314. package/dist/essentia-wasm.es-BUEnKUts.js +2990 -0
  315. package/dist/essentia.js-model.es-CGA0xotH.js +306 -0
  316. package/dist/index.d.ts +176 -0
  317. package/dist/index.d.ts.map +1 -0
  318. package/dist/playlist-data-engine.js +124 -0
  319. package/dist/playlist-data-engine.mjs +49251 -0
  320. package/dist/utils/EnchantmentLibrary.d.ts +378 -0
  321. package/dist/utils/EnchantmentLibrary.d.ts.map +1 -0
  322. package/dist/utils/arweaveGatewayManager.d.ts +485 -0
  323. package/dist/utils/arweaveGatewayManager.d.ts.map +1 -0
  324. package/dist/utils/arweaveUtils.d.ts +118 -0
  325. package/dist/utils/arweaveUtils.d.ts.map +1 -0
  326. package/dist/utils/constants.d.ts +439 -0
  327. package/dist/utils/constants.d.ts.map +1 -0
  328. package/dist/utils/equipmentConstants.d.ts +60 -0
  329. package/dist/utils/equipmentConstants.d.ts.map +1 -0
  330. package/dist/utils/hash.d.ts +33 -0
  331. package/dist/utils/hash.d.ts.map +1 -0
  332. package/dist/utils/logger.d.ts +192 -0
  333. package/dist/utils/logger.d.ts.map +1 -0
  334. package/dist/utils/magicItemExamples.d.ts +46 -0
  335. package/dist/utils/magicItemExamples.d.ts.map +1 -0
  336. package/dist/utils/playlistUtils.d.ts +149 -0
  337. package/dist/utils/playlistUtils.d.ts.map +1 -0
  338. package/dist/utils/random.d.ts +34 -0
  339. package/dist/utils/random.d.ts.map +1 -0
  340. package/dist/utils/sensorDashboard.d.ts +60 -0
  341. package/dist/utils/sensorDashboard.d.ts.map +1 -0
  342. package/dist/utils/validators.d.ts +189 -0
  343. package/dist/utils/validators.d.ts.map +1 -0
  344. package/dist/vite.svg +1 -0
  345. package/package.json +82 -0
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Beat Key Helper Functions
3
+ *
4
+ * Utility functions for assigning and managing required keys on beat maps.
5
+ * Used for rhythm game chart creation where specific keys must be pressed
6
+ * for specific beats.
7
+ *
8
+ * @module beatKeyHelpers
9
+ */
10
+ import type { BeatMap, InterpolatedBeatMap, UnifiedBeatMap, SubdividedBeatMap } from '../../types/BeatMap.js';
11
+ /**
12
+ * Union type of all beat map types that support key assignment
13
+ */
14
+ export type KeyAssignableBeatMap = BeatMap | InterpolatedBeatMap | UnifiedBeatMap | SubdividedBeatMap;
15
+ /**
16
+ * Assignment for bulk key operations
17
+ */
18
+ export interface KeyAssignment {
19
+ /** Index of the beat to assign the key to */
20
+ beatIndex: number;
21
+ /** Key to assign (string to set, null to remove) */
22
+ key: string | null;
23
+ }
24
+ /**
25
+ * Assign a required key to a single beat in a beat map
26
+ *
27
+ * Returns a new beat map with the updated beat (immutable operation).
28
+ * Pass `null` as the key to remove an existing required key assignment.
29
+ *
30
+ * @param beatMap - The beat map to modify (BeatMap, InterpolatedBeatMap, UnifiedBeatMap, or SubdividedBeatMap)
31
+ * @param beatIndex - Index of the beat to update
32
+ * @param key - Key to assign (e.g., 'up', 'down', 'left', 'right') or null to remove
33
+ * @returns New beat map with the updated beat
34
+ * @throws Error if beatIndex is out of bounds
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * import { assignKeyToBeat } from 'playlist-data-engine';
39
+ *
40
+ * // Assign a key to a beat
41
+ * const updatedMap = assignKeyToBeat(subdividedMap, 0, 'left');
42
+ *
43
+ * // Remove a key from a beat
44
+ * const clearedMap = assignKeyToBeat(updatedMap, 0, null);
45
+ * ```
46
+ */
47
+ export declare function assignKeyToBeat<T extends KeyAssignableBeatMap>(beatMap: T, beatIndex: number, key: string | null): T;
48
+ /**
49
+ * Assign required keys to multiple beats in a single operation
50
+ *
51
+ * More efficient than calling assignKeyToBeat multiple times for bulk updates.
52
+ * Useful for chart creation UI with "paint/brush" mode.
53
+ *
54
+ * @param beatMap - The beat map to modify
55
+ * @param assignments - Array of key assignments to apply
56
+ * @returns New beat map with all updates applied
57
+ * @throws Error if any beatIndex is out of bounds
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * import { assignKeysToBeats } from 'playlist-data-engine';
62
+ *
63
+ * const chartMap = assignKeysToBeats(subdividedMap, [
64
+ * { beatIndex: 0, key: 'left' },
65
+ * { beatIndex: 1, key: 'down' },
66
+ * { beatIndex: 2, key: 'up' },
67
+ * { beatIndex: 3, key: 'right' },
68
+ * ]);
69
+ * ```
70
+ */
71
+ export declare function assignKeysToBeats<T extends KeyAssignableBeatMap>(beatMap: T, assignments: KeyAssignment[]): T;
72
+ /**
73
+ * Extract a map of beat indices to required keys
74
+ *
75
+ * Returns a Map containing only the beats that have required keys assigned.
76
+ * Useful for serialization, UI display, and debugging.
77
+ *
78
+ * @param beatMap - The beat map to extract keys from
79
+ * @returns Map of beatIndex → requiredKey for beats with keys assigned
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * import { extractKeyMap } from 'playlist-data-engine';
84
+ *
85
+ * const keyMap = extractKeyMap(chartMap);
86
+ *
87
+ * // Iterate over assigned keys
88
+ * for (const [beatIndex, key] of keyMap) {
89
+ * console.log(`Beat ${beatIndex}: ${key}`);
90
+ * }
91
+ *
92
+ * // Check if any keys are assigned
93
+ * if (keyMap.size === 0) {
94
+ * console.log('No keys assigned - not a chart');
95
+ * }
96
+ *
97
+ * // Convert to plain object for JSON
98
+ * const keyObject = Object.fromEntries(keyMap);
99
+ * // { "0": "left", "1": "down", "2": "up" }
100
+ * ```
101
+ */
102
+ export declare function extractKeyMap(beatMap: KeyAssignableBeatMap): Map<number, string>;
103
+ /**
104
+ * Remove all required key assignments from a beat map
105
+ *
106
+ * Returns a new beat map with all requiredKey properties removed.
107
+ * Useful for resetting a chart back to a plain beat map.
108
+ *
109
+ * @param beatMap - The beat map to clear keys from
110
+ * @returns New beat map with all keys removed
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * import { clearAllKeys } from 'playlist-data-engine';
115
+ *
116
+ * // Reset a chart to a plain beat map
117
+ * const plainMap = clearAllKeys(chartMap);
118
+ *
119
+ * // Verify no keys remain
120
+ * const keyMap = extractKeyMap(plainMap);
121
+ * console.log(keyMap.size); // 0
122
+ * ```
123
+ */
124
+ export declare function clearAllKeys<T extends KeyAssignableBeatMap>(beatMap: T): T;
125
+ /**
126
+ * Check if a beat map has any required keys assigned
127
+ *
128
+ * @param beatMap - The beat map to check
129
+ * @returns true if any beat has a required key assigned
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * import { hasRequiredKeys } from 'playlist-data-engine';
134
+ *
135
+ * if (hasRequiredKeys(beatMap)) {
136
+ * console.log('This is a chart with key requirements');
137
+ * } else {
138
+ * console.log('This is a plain beat map');
139
+ * }
140
+ * ```
141
+ */
142
+ export declare function hasRequiredKeys(beatMap: KeyAssignableBeatMap): boolean;
143
+ /**
144
+ * Get the count of beats with required keys assigned
145
+ *
146
+ * @param beatMap - The beat map to count keys from
147
+ * @returns Number of beats with required keys
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * import { getKeyCount } from 'playlist-data-engine';
152
+ *
153
+ * const keyCount = getKeyCount(chartMap);
154
+ * console.log(`${keyCount} beats have key requirements`);
155
+ * ```
156
+ */
157
+ export declare function getKeyCount(beatMap: KeyAssignableBeatMap): number;
158
+ /**
159
+ * Get all unique keys used in a beat map
160
+ *
161
+ * Useful for determining which input buttons are needed for gameplay.
162
+ *
163
+ * @param beatMap - The beat map to get keys from
164
+ * @returns Array of unique key strings (sorted alphabetically)
165
+ *
166
+ * @example
167
+ * ```typescript
168
+ * import { getUsedKeys } from 'playlist-data-engine';
169
+ *
170
+ * const usedKeys = getUsedKeys(chartMap);
171
+ * // ['down', 'left', 'right', 'up']
172
+ *
173
+ * // Set up game controls for only the needed keys
174
+ * for (const key of usedKeys) {
175
+ * setupKeyHandler(key);
176
+ * }
177
+ * ```
178
+ */
179
+ export declare function getUsedKeys(beatMap: KeyAssignableBeatMap): string[];
180
+ //# sourceMappingURL=beatKeyHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beatKeyHelpers.d.ts","sourceRoot":"","sources":["../../../../src/core/analysis/beat/beatKeyHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAER,OAAO,EACP,mBAAmB,EACnB,cAAc,EAEd,iBAAiB,EACpB,MAAM,wBAAwB,CAAC;AAMhC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,mBAAmB,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAEtG;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAgDD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,oBAAoB,EAC1D,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GAAG,IAAI,GACnB,CAAC,CA4BH;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,oBAAoB,EAC5D,OAAO,EAAE,CAAC,EACV,WAAW,EAAE,aAAa,EAAE,GAC7B,CAAC,CAyCH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAYhF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,oBAAoB,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAa1E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAGtE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAGjE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAWnE"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Beat Detection Module
3
+ *
4
+ * Exports for the Ellis Dynamic Programming beat tracking system.
5
+ */
6
+ export type { Beat, BeatMap, BeatMapMetadata, BeatEvent, BeatEventType, BeatStreamCallback, AudioSyncState, BeatMapGeneratorOptions, BeatStreamOptions, BeatMapJSON, BeatAccuracy, ButtonPressResult, TempoEstimate, OSEConfig, BeatTrackerConfig, TempoDetectorConfig, BeatMapGenerationProgress, AccuracyThresholds, DifficultyPreset, ThresholdValidationResult, TimeSignatureConfig, DownbeatSegment, DownbeatConfig, BeatSource, BeatWithSource, QuarterNoteDetection, GapAnalysis, InterpolationMetadata, InterpolatedBeatMap, BeatInterpolationOptions, BeatWithSourceJSON, QuarterNoteDetectionJSON, GapAnalysisJSON, InterpolationMetadataJSON, InterpolatedBeatMapJSON, UnifiedBeatMap, SubdivisionType, SubdivisionConfig, SubdividedBeat, SubdividedBeatMap, SubdivisionMetadata, GrooveDirection, GrooveResult, GrooveState, GrooveAnalyzerOptions, } from '../../types/BeatMap.js';
7
+ export { DEFAULT_BEATMAP_GENERATOR_OPTIONS, DEFAULT_BEATSTREAM_OPTIONS, BEAT_ACCURACY_THRESHOLDS, BEAT_DETECTION_VERSION, BEAT_DETECTION_ALGORITHM, EASY_ACCURACY_THRESHOLDS, MEDIUM_ACCURACY_THRESHOLDS, HARD_ACCURACY_THRESHOLDS, getAccuracyThresholdsForPreset, validateThresholds, DEFAULT_BEAT_INTERPOLATION_OPTIONS, DEFAULT_TIME_SIGNATURE, DEFAULT_DOWNBEAT_CONFIG, MIN_BEATS_PER_MEASURE, MAX_BEATS_PER_MEASURE, validateDownbeatConfig, validateDownbeatConfigAgainstBeats, DEFAULT_SUBDIVISION_CONFIG, MAX_SUBDIVISION_DENSITY, VALID_SUBDIVISION_TYPES, isValidSubdivisionType, getSubdivisionDensity, validateSubdivisionConfig, validateSubdivisionConfigAgainstBeats, validateSubdivisionDensity, DEFAULT_GROOVE_OPTIONS, } from '../../types/BeatMap.js';
8
+ export { OnsetStrengthEnvelope, type OSEResult } from './OnsetStrengthEnvelope.js';
9
+ export { TempoDetector } from './TempoDetector.js';
10
+ export { BeatTracker, type BeatTrackingResult } from './BeatTracker.js';
11
+ export { BeatMapGenerator, type ProgressCallback } from './BeatMapGenerator.js';
12
+ export { BeatStream } from './BeatStream.js';
13
+ export { BeatInterpolator } from './BeatInterpolator.js';
14
+ export { BeatSubdivider, type BeatSubdividerOptions } from './BeatSubdivider.js';
15
+ export { GrooveAnalyzer } from './GrooveAnalyzer.js';
16
+ export { unifyBeatMap } from './utils/unifyBeatMap.js';
17
+ export { subdivideBeatMap } from './utils/subdivideBeatMap.js';
18
+ export { generateDebugReport, collectHistogramData, collectGapDetails, collectBeatDebugInfo, collectTempoDriftData, formatDebugReportToConsole, formatDebugReportToJSON, generateTempoDriftVisualization, generateConfidenceVisualization, BeatInterpolationDebug, DEFAULT_DEBUG_OUTPUT_OPTIONS, } from './utils/beatInterpolationDebug.js';
19
+ export type { HistogramEntry, GapDetail, TempoDriftPoint, BeatDebugInfo, InterpolationDebugReport, DebugOutputOptions, } from './utils/beatInterpolationDebug.js';
20
+ export { hzToMel, melToHz, resampleAudio, createMelFilterbank, highPassFilter, gaussianSmooth, calculateStdDev, performFFT, performSTFT, type ResampledAudio, type STFTResult, } from './utils/audioUtils.js';
21
+ export { TransientDetector } from './TransientDetector.js';
22
+ export type { TransientResult, TransientAnalysis, TransientDetectorConfig, TransientDetectionMethod, } from './TransientDetector.js';
23
+ export { RhythmQuantizer } from './RhythmQuantizer.js';
24
+ export type { QuantizationConfig, QuantizedBandStreams, DensityValidationConfig, DensityValidationResult, GridType, GridDecision, GeneratedBeat, GeneratedRhythmMap, GridDecider, } from './RhythmQuantizer.js';
25
+ export { TempoAwareQuantizer, HighBpmGridRestrictionRule, DEFAULT_TEMPO_AWARE_CONFIG, } from './TempoAwareQuantizer.js';
26
+ export type { TempoQuantizationRule, TempoRuleContext, TempoAwareQuantizerConfig, HighBpmGridRestrictionConfig, } from './TempoAwareQuantizer.js';
27
+ export { PhraseAnalyzer } from './PhraseAnalyzer.js';
28
+ export type { PhraseOccurrence, RhythmicPhrase, BandPhraseAnalysis, PhraseAnalysisResult, PhraseAnalyzerConfig, } from './PhraseAnalyzer.js';
29
+ export { DensityAnalyzer } from './DensityAnalyzer.js';
30
+ export type { DensityCategory, NaturalDifficulty, BeatDensityMetrics, SectionDensityMetrics, BandDensityMetrics, DensityAnalysisResult, DensityAnalyzerConfig, } from './DensityAnalyzer.js';
31
+ export { StreamScorer } from './StreamScorer.js';
32
+ export type { Band, ScoringFactors, SectionScore, StreamScoringResult, SectionWinner, StreamScorerConfig, BandBiasWeights, } from './StreamScorer.js';
33
+ export { CompositeStreamGenerator } from './CompositeStreamGenerator.js';
34
+ export type { CompositeSection, CompositeBeat, CompositeStream, CompositeStreamConfig, } from './CompositeStreamGenerator.js';
35
+ export { DifficultyVariantGenerator, SUBDIVISION_LIMITS, ALL_GRID_TYPES, isGridTypeAllowed, getAllowedGridTypes, convertToAllowedGridType, naturalDifficultyToLevel, validateSubdivisionLimits, getTempoAwareAllowedGridTypes, MEDIUM_RESTRICT_BPM, HARD_RESTRICT_BPM, EASY_QUARTER_NOTE_BPM, } from './DifficultyVariantGenerator.js';
36
+ export type { ExtendedGridType, DifficultyLevel, PresetDifficultyLevel, MaxSubdivision, SubdivisionLimitConfig, EditType, VariantBeat, DifficultyVariant, SubdivisionConversionMetadata, SubdivisionValidationResult, SubdivisionViolation, DifficultyVariantConfig, DensityTargetStrategy, BeatCountTarget, VariantDensityValidationResult, } from './DifficultyVariantGenerator.js';
37
+ export { assignKeyToBeat, assignKeysToBeats, extractKeyMap, clearAllKeys, hasRequiredKeys, getKeyCount, getUsedKeys, type KeyAssignableBeatMap, type KeyAssignment, } from './beatKeyHelpers.js';
38
+ export { RhythmicBalancer } from './RhythmicBalancer.js';
39
+ export type { RhythmicBalanceConfig, StrongBeatEmphasis, BalancerAction, BalanceStats, BalanceResult, } from './RhythmicBalancer.js';
40
+ export { DEFAULT_RHYTHMIC_BALANCE_CONFIG, getMetricGroupSize, isMetricStrongBeat, isMetricWeakBeat, findActiveSegment, isStrongBeatForEmphasis, } from './RhythmicBalancer.js';
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/analysis/beat/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACR,IAAI,EACJ,OAAO,EACP,eAAe,EACf,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EAEzB,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EAEzB,mBAAmB,EACnB,eAAe,EACf,cAAc,EAEd,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EAExB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EAEvB,cAAc,EAEd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EAEnB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,qBAAqB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACH,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,wBA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AM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EACR,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,qBAAqB,GACxB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACxB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACR,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,8BAA8B,GACjC,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,aAAa,GACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACR,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,aAAa,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACH,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,GAC1B,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Audio utility functions for beat detection
3
+ *
4
+ * These utilities support the Ellis Dynamic Programming beat tracking algorithm
5
+ * by providing audio preprocessing, Mel filterbank generation, and signal processing.
6
+ */
7
+ /**
8
+ * Convert frequency in Hz to Mel scale
9
+ * Formula: m = 2595 * log10(1 + f/700)
10
+ *
11
+ * @param hz - Frequency in Hz
12
+ * @returns Mel scale value
13
+ */
14
+ export declare function hzToMel(hz: number): number;
15
+ /**
16
+ * Convert Mel scale value to frequency in Hz
17
+ * Formula: f = 700 * (10^(m/2595) - 1)
18
+ *
19
+ * @param mel - Mel scale value
20
+ * @returns Frequency in Hz
21
+ */
22
+ export declare function melToHz(mel: number): number;
23
+ /**
24
+ * Result of audio resampling
25
+ */
26
+ export interface ResampledAudio {
27
+ /** Resampled audio data as mono Float32Array */
28
+ data: Float32Array;
29
+ /** Original sample rate */
30
+ originalSampleRate: number;
31
+ /** Target sample rate */
32
+ targetSampleRate: number;
33
+ }
34
+ /**
35
+ * Resample audio buffer to a target sample rate
36
+ * Uses linear interpolation for simplicity
37
+ *
38
+ * @param audioBuffer - Source audio buffer
39
+ * @param targetRate - Target sample rate in Hz
40
+ * @returns Resampled audio data with metadata
41
+ */
42
+ export declare function resampleAudio(audioBuffer: AudioBuffer, targetRate: number): ResampledAudio;
43
+ /**
44
+ * Create a Mel filterbank for spectral analysis
45
+ *
46
+ * Creates triangular filters spaced evenly on the Mel scale,
47
+ * suitable for perceptual audio analysis as per Ellis 2007.
48
+ *
49
+ * @param numBands - Number of Mel bands to create
50
+ * @param fftSize - FFT size used for analysis
51
+ * @param sampleRate - Audio sample rate in Hz
52
+ * @param minFreq - Minimum frequency in Hz (default: 0)
53
+ * @param maxFreq - Maximum frequency in Hz (default: sampleRate/2)
54
+ * @returns Array of Float32Array filters, each representing one Mel band
55
+ */
56
+ export declare function createMelFilterbank(numBands: number, fftSize: number, sampleRate: number, minFreq?: number, maxFreq?: number): Float32Array[];
57
+ /**
58
+ * Apply a high-pass filter to remove DC offset and low-frequency components
59
+ * Uses a simple first-order IIR filter
60
+ *
61
+ * @param signal - Input signal
62
+ * @param cutoff - Cutoff frequency in Hz
63
+ * @param sampleRate - Sample rate in Hz
64
+ * @returns Filtered signal
65
+ */
66
+ export declare function highPassFilter(signal: Float32Array, cutoff: number, sampleRate: number): Float32Array;
67
+ /**
68
+ * Apply Gaussian smoothing to a signal
69
+ *
70
+ * @param signal - Input signal
71
+ * @param windowMs - Window size in milliseconds
72
+ * @param sampleRate - Sample rate in Hz
73
+ * @returns Smoothed signal
74
+ */
75
+ export declare function gaussianSmooth(signal: Float32Array, windowMs: number, sampleRate: number): Float32Array;
76
+ /**
77
+ * Calculate the standard deviation of a signal
78
+ *
79
+ * @param signal - Input signal
80
+ * @returns Standard deviation
81
+ */
82
+ export declare function calculateStdDev(signal: Float32Array): number;
83
+ /**
84
+ * Perform FFT on a signal and return magnitude spectrum
85
+ * Uses Cooley-Tukey algorithm with Hann window
86
+ *
87
+ * @param signal - Input signal (will be padded to nearest power of 2)
88
+ * @returns Magnitude spectrum (half spectrum, positive frequencies only)
89
+ */
90
+ export declare function performFFT(signal: Float32Array): Float32Array;
91
+ /**
92
+ * Result of STFT analysis
93
+ */
94
+ export interface STFTResult {
95
+ /** 2D array of magnitude spectra (frame x frequency bin) */
96
+ frames: Float32Array[];
97
+ /** Number of frames */
98
+ numFrames: number;
99
+ /** FFT size used */
100
+ fftSize: number;
101
+ /** Hop size in samples */
102
+ hopSize: number;
103
+ /** Sample rate */
104
+ sampleRate: number;
105
+ }
106
+ /**
107
+ * Perform Short-Time Fourier Transform (STFT) on a signal
108
+ *
109
+ * @param signal - Input signal
110
+ * @param fftSize - FFT window size in samples
111
+ * @param hopSize - Hop size in samples
112
+ * @param sampleRate - Sample rate in Hz
113
+ * @returns STFT result containing magnitude spectra for each frame
114
+ */
115
+ export declare function performSTFT(signal: Float32Array, fftSize: number, hopSize: number, sampleRate: number): STFTResult;
116
+ /**
117
+ * Configuration for the Butterworth band-pass filter
118
+ *
119
+ * The filter uses cascaded 2nd-order biquad sections for steep cutoff.
120
+ * An 8th order filter provides 48 dB/octave slope.
121
+ */
122
+ export interface BandPassFilterConfig {
123
+ /** Filter order (must be even positive integer). Default: 8 for 48 dB/octave */
124
+ order?: number;
125
+ /** Optional Q factor adjustment. Default: 0.707 (Butterworth maximally flat) */
126
+ qFactor?: number;
127
+ }
128
+ /**
129
+ * Frequency band definition for multi-band analysis
130
+ */
131
+ export interface FrequencyBand {
132
+ /** Band name identifier (e.g., 'low', 'mid', 'high') */
133
+ name: string;
134
+ /** Lower cutoff frequency in Hz */
135
+ lowHz: number;
136
+ /** Upper cutoff frequency in Hz */
137
+ highHz: number;
138
+ /** Human-readable description of the band's typical content */
139
+ description: string;
140
+ }
141
+ /**
142
+ * Standard frequency bands for multi-band transient detection
143
+ *
144
+ * These three bands cover the full audible spectrum and are optimized
145
+ * for detecting different types of rhythmic elements:
146
+ * - Low: Bass, kick drums, sub frequencies
147
+ * - Mid: Vocals, snare body, lead instruments
148
+ * - High: Hi-hats, cymbals, harmonics, air
149
+ */
150
+ export declare const FREQUENCY_BANDS: FrequencyBand[];
151
+ /**
152
+ * Apply a Butterworth band-pass filter to a signal
153
+ *
154
+ * Implements a band-pass filter by cascading high-pass and low-pass filters.
155
+ * Uses cascaded 2nd-order biquad sections for steep cutoff slopes.
156
+ *
157
+ * Default configuration is 8th order (48 dB/octave slope) which provides
158
+ * clean band separation at crossover points without significant phase distortion.
159
+ *
160
+ * @param signal - Input signal to filter
161
+ * @param lowHz - Lower cutoff frequency in Hz
162
+ * @param highHz - Upper cutoff frequency in Hz
163
+ * @param sampleRate - Sample rate in Hz
164
+ * @param config - Optional filter configuration
165
+ * @returns Filtered signal (same length as input)
166
+ * @throws Error if order is not a positive even integer
167
+ *
168
+ * @example
169
+ * ```typescript
170
+ * // Apply default 8th order band-pass filter for low band (20-500 Hz)
171
+ * const filtered = bandPassFilter(signal, 20, 500, 44100);
172
+ *
173
+ * // Apply 4th order filter with custom Q factor
174
+ * const filtered = bandPassFilter(signal, 500, 2000, 44100, { order: 4, qFactor: 0.5 });
175
+ * ```
176
+ */
177
+ export declare function bandPassFilter(signal: Float32Array, lowHz: number, highHz: number, sampleRate: number, config?: BandPassFilterConfig): Float32Array;
178
+ /**
179
+ * Apply a frequency band filter to a signal
180
+ *
181
+ * Convenience function that applies the band-pass filter using
182
+ * predefined frequency band settings from FREQUENCY_BANDS.
183
+ *
184
+ * @param signal - Input signal to filter
185
+ * @param bandName - Name of the frequency band ('low', 'mid', or 'high')
186
+ * @param sampleRate - Sample rate in Hz
187
+ * @param config - Optional filter configuration
188
+ * @returns Filtered signal
189
+ * @throws Error if bandName is not recognized
190
+ *
191
+ * @example
192
+ * ```typescript
193
+ * // Apply low band filter (20-500 Hz) for bass/kick detection
194
+ * const lowFiltered = applyFrequencyBand(signal, 'low', 44100);
195
+ *
196
+ * // Apply mid band filter (500-2000 Hz) for vocal/snare detection
197
+ * const midFiltered = applyFrequencyBand(signal, 'mid', 44100);
198
+ *
199
+ * // Apply high band filter (2000-20000 Hz) for hi-hat/cymbal detection
200
+ * const highFiltered = applyFrequencyBand(signal, 'high', 44100);
201
+ * ```
202
+ */
203
+ export declare function applyFrequencyBand(signal: Float32Array, bandName: 'low' | 'mid' | 'high', sampleRate: number, config?: BandPassFilterConfig): Float32Array;
204
+ //# sourceMappingURL=audioUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audioUtils.d.ts","sourceRoot":"","sources":["../../../../../src/core/analysis/beat/utils/audioUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,gDAAgD;IAChD,IAAI,EAAE,YAAY,CAAC;IACnB,2BAA2B;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yBAAyB;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,WA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