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,477 @@
1
+ /**
2
+ * Beat Interpolator
3
+ *
4
+ * Post-processing pass that runs AFTER BeatMap generation to fill gaps
5
+ * where detected beats are missing. Uses dense section priority to determine
6
+ * the quarter note interval, then generates interpolated beats using the
7
+ * Adaptive Phase-Locked Grid algorithm.
8
+ *
9
+ * The Adaptive Phase-Locked approach uses anchor points (detected beats) to
10
+ * track tempo drift and maintain phase alignment throughout the track.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const interpolator = new BeatInterpolator({
15
+ * minAnchorConfidence: 0.3,
16
+ * gridSnapTolerance: 0.05,
17
+ * });
18
+ *
19
+ * const interpolatedBeatMap = interpolator.interpolate(beatMap);
20
+ *
21
+ * // Access original detected beats
22
+ * console.log(interpolatedBeatMap.detectedBeats.length);
23
+ *
24
+ * // Access merged beats (interpolated + detected override)
25
+ * console.log(interpolatedBeatMap.mergedBeats.length);
26
+ * ```
27
+ */
28
+ import type { BeatMap, BeatInterpolationOptions, InterpolatedBeatMap } from '../../types/BeatMap.js';
29
+ /**
30
+ * Beat Interpolator
31
+ *
32
+ * Generates interpolated beats to fill gaps in detected beat maps using
33
+ * the Pace + Anchors model with dense section priority.
34
+ */
35
+ export declare class BeatInterpolator {
36
+ private options;
37
+ /**
38
+ * Create a new BeatInterpolator
39
+ *
40
+ * @param options - Configuration options (all optional, defaults provided)
41
+ */
42
+ constructor(options?: BeatInterpolationOptions);
43
+ /**
44
+ * Get the current configuration
45
+ *
46
+ * @returns The current configuration
47
+ */
48
+ getConfig(): Required<BeatInterpolationOptions>;
49
+ /**
50
+ * Interpolate beats in a BeatMap
51
+ *
52
+ * Main entry point that orchestrates the interpolation process:
53
+ * 1. Detect quarter note interval using dense section priority
54
+ * 2. Analyze gaps between detected beats
55
+ * 3. Generate beat grid using selected algorithm
56
+ * 4. Merge detected beats with interpolated beats
57
+ *
58
+ * @param beatMap - The beat map to interpolate
59
+ * @returns Interpolated beat map with two output streams
60
+ */
61
+ interpolate(beatMap: BeatMap): InterpolatedBeatMap;
62
+ /**
63
+ * Detect quarter note interval using dense section priority
64
+ *
65
+ * Algorithm:
66
+ * 1. Identify dense sections (consecutive beats at similar intervals)
67
+ * 2. Build weighted histogram of intervals
68
+ * 3. Find primary peak (most weighted interval = quarter note)
69
+ * 4. Calculate confidence based on peak prominence and dense section contribution
70
+ *
71
+ * @param beats - Detected beats to analyze
72
+ * @returns Quarter note detection result
73
+ */
74
+ private detectQuarterNote;
75
+ /**
76
+ * Identify dense sections in the beat sequence
77
+ *
78
+ * A dense section is a sequence of consecutive beats (3+ by default)
79
+ * where the intervals between beats are consistent (low variance).
80
+ *
81
+ * @param beats - Beats to analyze
82
+ * @returns Array of dense sections
83
+ */
84
+ private identifyDenseSections;
85
+ /**
86
+ * Identify tempo clusters from dense sections
87
+ *
88
+ * Builds on identifyDenseSections() output to group dense sections by tempo
89
+ * similarity and create verified tempo clusters for multi-tempo detection.
90
+ *
91
+ * Algorithm:
92
+ * 1. Convert dense sections to cluster candidates with BPM
93
+ * 2. Group sections by tempo similarity (within tempoSectionThreshold)
94
+ * 3. Merge adjacent sections with similar tempo into clusters
95
+ * 4. Filter clusters by minClusterBeats requirement
96
+ * 5. Return only verified clusters
97
+ *
98
+ * @param beats - Detected beats to analyze
99
+ * @returns Array of verified tempo clusters
100
+ */
101
+ private identifyTempoClusters;
102
+ /**
103
+ * Find conflicting tempo clusters
104
+ *
105
+ * Checks if any two verified clusters have tempos that differ by more than
106
+ * the tempoSectionThreshold. Filters out octave-related tempos (e.g., 60 BPM
107
+ * vs 120 BPM are considered the same tempo).
108
+ *
109
+ * @param clusters - Verified tempo clusters to analyze
110
+ * @returns Array of conflicting cluster pairs, or null if no conflicts
111
+ */
112
+ private findConflictingClusters;
113
+ /**
114
+ * Check if two tempos are octave multiples
115
+ *
116
+ * Used to filter out false "conflicts" where two clusters are actually
117
+ * at the same tempo but detected at different octaves (e.g., 60 BPM vs 120 BPM).
118
+ *
119
+ * @param tempoA - First tempo in BPM
120
+ * @param tempoB - Second tempo in BPM
121
+ * @param tolerance - Tolerance for ratio comparison (default: 0.1 = 10%)
122
+ * @returns True if tempos are ~0.5x or ~2x each other
123
+ */
124
+ private isOctaveMultiple;
125
+ /**
126
+ * Filter out octave multiples from a list of tempos
127
+ *
128
+ * When multiple tempos are detected but some are octave multiples of others,
129
+ * we keep only one representative tempo. This prevents false detection of
130
+ * "multiple tempos" when the track is actually at a consistent tempo but
131
+ * detected at different octaves (e.g., 60 BPM and 120 BPM).
132
+ *
133
+ * Algorithm:
134
+ * 1. Sort tempos in ascending order
135
+ * 2. For each tempo, check if it's an octave multiple of any already-kept tempo
136
+ * 3. If not an octave multiple of any kept tempo, add it to the result
137
+ *
138
+ * @param tempos - Array of tempo values in BPM
139
+ * @returns Filtered array with octave multiples removed
140
+ */
141
+ private filterOctaveMultiples;
142
+ /**
143
+ * Find the crossing point between two tempo clusters
144
+ *
145
+ * Core boundary detection algorithm for the crossing paths strategy:
146
+ * 1. If NO beats between clusters → automatic boundary (no evidence of drift)
147
+ * 2. If beats exist between clusters:
148
+ * - Interpolate forwards from Cluster 1 with drift
149
+ * - Interpolate backwards from Cluster 2 with drift
150
+ * - At crossing point, measure gap between forward and backward positions
151
+ * - If gap < threshold → drift bridged it → no boundary
152
+ * - If gap > threshold → sudden jump → return boundary timestamp
153
+ *
154
+ * @param cluster1 - First tempo cluster (earlier in time)
155
+ * @param cluster2 - Second tempo cluster (later in time)
156
+ * @param allBeats - All detected beats in the track
157
+ * @returns Crossing point analysis result
158
+ */
159
+ private findCrossingPoint;
160
+ /**
161
+ * Measure the gap between forwards and backwards interpolation at crossing point
162
+ *
163
+ * Compares forwards and backwards interpolation results at the crossing point
164
+ * to determine if tempo drift could bridge the gap between clusters.
165
+ *
166
+ * @param forwardsResult - Result of forwards drift interpolation
167
+ * @param backwardsResult - Result of backwards drift interpolation
168
+ * @param c1Interval - Cluster 1's interval (for reference)
169
+ * @param c2Interval - Cluster 2's interval (for reference)
170
+ * @returns Gap measurement result
171
+ */
172
+ private measureGapAtCrossing;
173
+ /**
174
+ * Assign connecting beats to sections based on phase alignment
175
+ *
176
+ * For each beat between clusters, check phase alignment with both clusters
177
+ * and assign to the one with better alignment.
178
+ *
179
+ * @param connectingBeats - Beats between the two clusters
180
+ * @param cluster1 - First cluster (earlier in time)
181
+ * @param cluster2 - Second cluster (later in time)
182
+ * @param boundaryTimestamp - The determined boundary timestamp
183
+ * @returns Beats assigned to each section
184
+ */
185
+ private assignBeatsToSections;
186
+ /**
187
+ * Calculate phase alignment between a beat and a cluster's tempo grid
188
+ *
189
+ * Binary check: returns 1 if beat is within tolerance of expected grid position,
190
+ * 0 otherwise.
191
+ *
192
+ * @param beatTimestamp - Timestamp of the beat to check
193
+ * @param clusterAnchor - Anchor timestamp (e.g., first or last beat of cluster)
194
+ * @param clusterInterval - Cluster's interval in seconds
195
+ * @param tolerance - Tolerance as ratio of interval (default: 0.1 = 10%)
196
+ * @returns 1 if aligned, 0 if not
197
+ */
198
+ private calculatePhaseAlignment;
199
+ /**
200
+ * Run full multi-tempo analysis to detect section boundaries
201
+ *
202
+ * This is the expensive part that only runs when:
203
+ * 1. enableMultiTempo option is true
204
+ * 2. Multiple tempo clusters have been detected
205
+ *
206
+ * Uses the crossing paths strategy to determine exact boundaries between sections.
207
+ *
208
+ * @param beats - All detected beats in the track
209
+ * @param clusters - Verified tempo clusters
210
+ * @param duration - Track duration in seconds
211
+ * @returns TempoSection array with boundaries, or null if no valid sections
212
+ */
213
+ private runMultiTempoAnalysis;
214
+ /**
215
+ * Re-interpolate boundary regions between tempo sections
216
+ *
217
+ * When multi-tempo is applied, beats near section boundaries need to be
218
+ * re-interpolated using the correct tempo for each section.
219
+ *
220
+ * @param mergedBeats - Current merged beats (single-tempo interpolation)
221
+ * @param tempoSections - Detected tempo sections with boundaries
222
+ * @param detectedBeats - Original detected beats
223
+ * @param downbeatConfig - Downbeat configuration
224
+ * @returns Re-interpolated merged beats
225
+ */
226
+ private reinterpolateBoundaryRegions;
227
+ /**
228
+ * Check if multi-tempo re-analysis can be applied to a beat map
229
+ *
230
+ * Used by UI to determine whether to show a "Re-analyze with Multi-Tempo" button.
231
+ *
232
+ * @param interpolatedBeatMap - The interpolated beat map to check
233
+ * @returns true if multi-tempo analysis is available and not yet applied
234
+ */
235
+ canApplyMultiTempo(interpolatedBeatMap: InterpolatedBeatMap): boolean;
236
+ /**
237
+ * Calculate weighted intervals between beats
238
+ *
239
+ * Weight factors:
240
+ * - Is the interval from a dense section? (higher weight)
241
+ * - Is the interval consistent with neighbors? (higher weight)
242
+ * - Are the bounding beats high-confidence? (higher weight)
243
+ *
244
+ * @param beats - Beats to analyze
245
+ * @param denseSections - Identified dense sections
246
+ * @returns Array of weighted intervals
247
+ */
248
+ private calculateWeightedIntervals;
249
+ /**
250
+ * Build a histogram of intervals
251
+ *
252
+ * Uses bucketing to group similar intervals together.
253
+ *
254
+ * @param weightedIntervals - Weighted intervals to histogram
255
+ * @returns Map of interval buckets to total weights
256
+ */
257
+ private buildIntervalHistogram;
258
+ /**
259
+ * Find peaks in the interval histogram
260
+ *
261
+ * Returns peaks sorted by weight (descending).
262
+ *
263
+ * @param histogram - Interval histogram
264
+ * @returns Array of peaks with interval and weight
265
+ */
266
+ private findHistogramPeaks;
267
+ /**
268
+ * Calculate simple average interval (fallback method)
269
+ *
270
+ * @param beats - Beats to analyze
271
+ * @returns Average interval in seconds
272
+ */
273
+ private calculateAverageInterval;
274
+ /**
275
+ * Analyze gaps between detected beats
276
+ *
277
+ * Identifies:
278
+ * - Half-note gaps (exactly 2x quarter note)
279
+ * - Anomalies (single unusual intervals)
280
+ * - Grid alignment score
281
+ *
282
+ * @param beats - Beats to analyze
283
+ * @param quarterNote - Detected quarter note interval
284
+ * @returns Gap analysis result
285
+ */
286
+ private analyzeGaps;
287
+ /**
288
+ * Generate beat grid using the selected algorithm
289
+ *
290
+ * Delegates to the appropriate algorithm implementation based on options.
291
+ *
292
+ * @param beatMap - Original beat map
293
+ * @param quarterNote - Quarter note detection
294
+ * @param gapAnalysis - Gap analysis result
295
+ * @returns Array of beats with source information
296
+ */
297
+ private generateGrid;
298
+ /**
299
+ * Interpolate forwards from a start anchor through connecting beats with drift
300
+ *
301
+ * Used by the crossing paths strategy to determine how tempo evolves when
302
+ * interpolating from one cluster towards another. Each detected beat encountered
303
+ * can push/pull the tempo based on phase alignment.
304
+ *
305
+ * @param startAnchor - Starting beat timestamp (anchor point)
306
+ * @param initialInterval - Initial tempo as interval in seconds
307
+ * @param connectingBeats - Beats to interpolate through (sorted by timestamp)
308
+ * @param adaptationRate - How quickly tempo adapts (0-1)
309
+ * @param stopAtTimestamp - Optional timestamp to stop interpolation at
310
+ * @returns Drift interpolation result with final tempo and beat positions
311
+ */
312
+ private interpolateForwardsWithDrift;
313
+ /**
314
+ * Interpolate backwards from an end anchor through connecting beats with drift
315
+ *
316
+ * Used by the crossing paths strategy to determine how tempo evolves when
317
+ * interpolating from one cluster backwards towards another. Each detected beat
318
+ * encountered can push/pull the tempo (in reverse time direction).
319
+ *
320
+ * @param endAnchor - Ending beat timestamp (anchor point)
321
+ * @param initialInterval - Initial tempo as interval in seconds
322
+ * @param connectingBeats - Beats to interpolate through (sorted by timestamp)
323
+ * @param adaptationRate - How quickly tempo adapts (0-1)
324
+ * @param stopAtTimestamp - Optional timestamp to stop interpolation at
325
+ * @returns Drift interpolation result with final tempo and beat positions
326
+ */
327
+ private interpolateBackwardsWithDrift;
328
+ /**
329
+ * Approach 2: Adaptive Phase-Locked Grid
330
+ *
331
+ * Handles tempo drift by:
332
+ * 1. Starting with quarter note interval
333
+ * 2. Phase tracking at each detected beat anchor
334
+ * 3. Allowing tempo to drift slightly between anchors
335
+ *
336
+ * @param beatMap - Original beat map
337
+ * @param quarterNote - Quarter note detection
338
+ * @returns Grid beats with source information
339
+ */
340
+ private interpolateAdaptivePhaseLocked;
341
+ /**
342
+ * Merge detected beats with grid beats
343
+ *
344
+ * Detected beats override interpolated beats at the same position.
345
+ *
346
+ * @param detectedBeats - Original detected beats
347
+ * @param gridBeats - Grid beats (interpolated)
348
+ * @param downbeatConfig - Downbeat configuration from the BeatMap
349
+ * @returns Merged beats with source information
350
+ */
351
+ private mergeBeats;
352
+ /**
353
+ * Reassign beat positions (beatInMeasure, isDownbeat, measureNumber)
354
+ * based on the merged beat sequence using the provided downbeat configuration.
355
+ *
356
+ * Supports multiple segments for time signature changes within a track.
357
+ *
358
+ * IMPORTANT: Measure numbers CONTINUE across segment boundaries.
359
+ * When time signature changes, measure number doesn't reset - it keeps
360
+ * incrementing. Only the beatsPerMeasure changes.
361
+ *
362
+ * @param beats - Merged beats to update
363
+ * @param downbeatConfig - Downbeat configuration from BeatMap (undefined = default)
364
+ */
365
+ private reassignBeatPositions;
366
+ /**
367
+ * Compute measure offsets for each segment to continue numbering across boundaries
368
+ *
369
+ * @param segments - Array of downbeat segments (must be ordered by startBeat)
370
+ * @param totalBeats - Total number of beats
371
+ * @returns Array of measure offsets for each segment
372
+ */
373
+ private computeMeasureOffsets;
374
+ /**
375
+ * Find the index of the active segment for a given beat index
376
+ * Segments are contiguous - each covers beats until the next segment starts
377
+ *
378
+ * @param segments - Array of downbeat segments (must be ordered by startBeat)
379
+ * @param beatIndex - The beat index to find the active segment for
380
+ * @returns The index of the active segment
381
+ */
382
+ private findActiveSegmentIndex;
383
+ /**
384
+ * Calculate confidence score from components
385
+ */
386
+ private calculateConfidence;
387
+ /**
388
+ * Create an interpolated beat
389
+ */
390
+ private createInterpolatedBeat;
391
+ /**
392
+ * Create a detected beat with source info
393
+ */
394
+ private createDetectedBeat;
395
+ /**
396
+ * Find a beat near a given timestamp within tolerance
397
+ */
398
+ private findBeatNear;
399
+ /**
400
+ * Find the nearest anchor beat to a given time
401
+ */
402
+ private findNearestAnchor;
403
+ /**
404
+ * Calculate tempo drift ratio (max local tempo / min local tempo)
405
+ */
406
+ private calculateTempoDriftRatio;
407
+ /**
408
+ * Create an empty interpolated beat map (edge case)
409
+ */
410
+ private createEmptyInterpolatedBeatMap;
411
+ /**
412
+ * Create a single-beat interpolated beat map (edge case)
413
+ */
414
+ private createSingleBeatInterpolatedBeatMap;
415
+ /**
416
+ * Convert an InterpolatedBeatMap to JSON string
417
+ *
418
+ * @param interpolatedBeatMap - Interpolated beat map to serialize
419
+ * @returns JSON string
420
+ *
421
+ * @example
422
+ * ```typescript
423
+ * const interpolator = new BeatInterpolator();
424
+ * const interpolatedBeatMap = interpolator.interpolate(beatMap);
425
+ *
426
+ * // Serialize to JSON for storage
427
+ * const json = BeatInterpolator.toJSON(interpolatedBeatMap);
428
+ * localStorage.setItem('beatmap', json);
429
+ * ```
430
+ */
431
+ static toJSON(interpolatedBeatMap: InterpolatedBeatMap): string;
432
+ /**
433
+ * Parse an InterpolatedBeatMap from JSON string
434
+ *
435
+ * @param jsonString - JSON string to parse
436
+ * @returns Interpolated beat map
437
+ *
438
+ * @example
439
+ * ```typescript
440
+ * // Load from storage
441
+ * const json = localStorage.getItem('beatmap');
442
+ * const interpolatedBeatMap = BeatInterpolator.fromJSON(json);
443
+ *
444
+ * // Use the loaded beat map
445
+ * console.log(interpolatedBeatMap.mergedBeats.length);
446
+ * ```
447
+ */
448
+ static fromJSON(jsonString: string): InterpolatedBeatMap;
449
+ /**
450
+ * Save an InterpolatedBeatMap to a file (Node.js only)
451
+ *
452
+ * @param interpolatedBeatMap - Interpolated beat map to save
453
+ * @param filePath - Path to save to
454
+ *
455
+ * @example
456
+ * ```typescript
457
+ * const interpolator = new BeatInterpolator();
458
+ * const interpolatedBeatMap = interpolator.interpolate(beatMap);
459
+ * await BeatInterpolator.saveToFile(interpolatedBeatMap, './beatmap.json');
460
+ * ```
461
+ */
462
+ static saveToFile(interpolatedBeatMap: InterpolatedBeatMap, filePath: string): Promise<void>;
463
+ /**
464
+ * Load an InterpolatedBeatMap from a file (Node.js only)
465
+ *
466
+ * @param filePath - Path to load from
467
+ * @returns Interpolated beat map
468
+ *
469
+ * @example
470
+ * ```typescript
471
+ * const interpolatedBeatMap = await BeatInterpolator.loadFromFile('./beatmap.json');
472
+ * console.log(interpolatedBeatMap.mergedBeats.length);
473
+ * ```
474
+ */
475
+ static loadFromFile(filePath: string): Promise<InterpolatedBeatMap>;
476
+ }
477
+ //# sourceMappingURL=BeatInterpolator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BeatInterpolator.d.ts","sourceRoot":"","sources":["../../../../src/core/analysis/beat/BeatInterpolator.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Beat Map Generator
3
+ *
4
+ * Orchestrates the beat detection pipeline to generate complete beat maps:
5
+ * 1. Load/decode audio
6
+ * 2. Calculate Onset Strength Envelope (OSE)
7
+ * 3. Estimate Tempo
8
+ * 4. Run DP Beat Tracker
9
+ * 5. Detect Downbeats
10
+ * 6. Assemble BeatMap
11
+ *
12
+ * Supports JSON serialization and file I/O for caching beat maps.
13
+ */
14
+ import type { BeatMap, BeatMapGeneratorOptions, BeatMapGenerationProgress, DownbeatConfig } from '../../types/BeatMap.js';
15
+ /**
16
+ * Progress callback type
17
+ */
18
+ export type ProgressCallback = (progress: BeatMapGenerationProgress) => void;
19
+ export declare class BeatMapGenerator {
20
+ private options;
21
+ private state;
22
+ /**
23
+ * Create a new BeatMapGenerator
24
+ *
25
+ * @param options - Configuration options (all optional, defaults provided)
26
+ */
27
+ constructor(options?: BeatMapGeneratorOptions);
28
+ /**
29
+ * Get the current configuration
30
+ *
31
+ * @returns The current configuration
32
+ */
33
+ getConfig(): Required<BeatMapGeneratorOptions>;
34
+ /**
35
+ * Generate a beat map from an audio URL
36
+ *
37
+ * IMPORTANT: The typical workflow is to generate FIRST with default config,
38
+ * examine the beat map to identify the correct downbeat, then use
39
+ * reapplyDownbeatConfig() to set it. You usually don't know the correct
40
+ * downbeat until after seeing the generated beat map.
41
+ *
42
+ * @param audioUrl - URL of the audio file
43
+ * @param audioId - Unique identifier for the audio source
44
+ * @param downbeatConfig - Optional manual downbeat configuration (defaults to beat 0 = downbeat, 4/4 time)
45
+ * If provided, will be stored in the resulting BeatMap
46
+ * @param onProgress - Optional progress callback
47
+ * @returns Generated beat map
48
+ */
49
+ generateBeatMap(audioUrl: string, audioId: string, downbeatConfig?: DownbeatConfig, onProgress?: ProgressCallback): Promise<BeatMap>;
50
+ /**
51
+ * Generate a beat map from an AudioBuffer
52
+ *
53
+ * IMPORTANT: The typical workflow is to generate FIRST with default config,
54
+ * examine the beat map to identify the correct downbeat, then use
55
+ * reapplyDownbeatConfig() to set it. You usually don't know the correct
56
+ * downbeat until after seeing the generated beat map.
57
+ *
58
+ * @param audioBuffer - Decoded audio buffer
59
+ * @param audioId - Unique identifier for the audio source
60
+ * @param downbeatConfig - Optional manual downbeat configuration (defaults to beat 0 = downbeat, 4/4 time)
61
+ * If provided, will be stored in the resulting BeatMap
62
+ * @param onProgress - Optional progress callback
63
+ * @returns Generated beat map
64
+ */
65
+ generateBeatMapFromBuffer(audioBuffer: AudioBuffer, audioId: string, downbeatConfig?: DownbeatConfig, onProgress?: ProgressCallback): Promise<BeatMap>;
66
+ /**
67
+ * Get the current generation progress
68
+ *
69
+ * @returns Current progress or null if no generation is active
70
+ */
71
+ getProgress(): BeatMapGenerationProgress | null;
72
+ /**
73
+ * Cancel the current generation
74
+ */
75
+ cancel(): void;
76
+ /**
77
+ * Apply intensity threshold to filter weak beats
78
+ *
79
+ * @param beats - Beats to filter
80
+ * @returns Filtered beats
81
+ */
82
+ private applyIntensityThreshold;
83
+ /**
84
+ * Apply measure labels to beats based on downbeat configuration
85
+ *
86
+ * Calculates beatInMeasure, isDownbeat, and measureNumber for each beat
87
+ * based on the provided downbeat configuration.
88
+ *
89
+ * IMPORTANT: Measure numbers CONTINUE across segment boundaries.
90
+ * When time signature changes, measure number doesn't reset - it keeps
91
+ * incrementing. Only the beatsPerMeasure changes.
92
+ *
93
+ * @param beats - Beats to label (with timestamps)
94
+ * @param config - Downbeat configuration
95
+ * @returns Beats with measure information populated
96
+ */
97
+ private applyMeasureLabels;
98
+ /**
99
+ * Compute measure offsets for each segment to continue numbering across boundaries
100
+ *
101
+ * @param segments - Array of downbeat segments (must be ordered by startBeat)
102
+ * @param totalBeats - Total number of beats
103
+ * @returns Array of measure offsets for each segment
104
+ */
105
+ private computeMeasureOffsets;
106
+ /**
107
+ * Find the index of the active segment for a given beat index
108
+ * Segments are contiguous - each covers beats until the next segment starts
109
+ *
110
+ * @param segments - Array of downbeat segments (must be ordered by startBeat)
111
+ * @param beatIndex - The beat index to find the active segment for
112
+ * @returns The index of the active segment
113
+ */
114
+ private findActiveSegmentIndex;
115
+ /**
116
+ * Filter beats by how well they align with the tempo grid.
117
+ *
118
+ * This post-processing step removes beats that deviate significantly from
119
+ * the expected quarter-note grid based on the detected tempo.
120
+ *
121
+ * @param beats - Beats to filter
122
+ * @param tempoEstimate - Tempo estimate with beat period
123
+ * @param filterThreshold - Grid alignment threshold (0.0-1.0)
124
+ * @returns Filtered beats
125
+ */
126
+ private filterBeatsByGridAlignment;
127
+ /**
128
+ * Update progress state
129
+ */
130
+ private updateProgress;
131
+ /**
132
+ * Fetch and decode audio from a URL
133
+ */
134
+ private fetchAndDecode;
135
+ /**
136
+ * Convert a BeatMap to JSON string
137
+ *
138
+ * @param beatMap - Beat map to serialize
139
+ * @returns JSON string
140
+ */
141
+ static toJSON(beatMap: BeatMap): string;
142
+ /**
143
+ * Parse a BeatMap from JSON string
144
+ *
145
+ * @param jsonString - JSON string to parse
146
+ * @returns Beat map
147
+ */
148
+ static fromJSON(jsonString: string): BeatMap;
149
+ /**
150
+ * Save a BeatMap to a file (Node.js only)
151
+ *
152
+ * @param beatMap - Beat map to save
153
+ * @param filePath - Path to save to
154
+ */
155
+ static saveToFile(beatMap: BeatMap, filePath: string): Promise<void>;
156
+ /**
157
+ * Load a BeatMap from a file (Node.js only)
158
+ *
159
+ * @param filePath - Path to load from
160
+ * @returns Beat map
161
+ */
162
+ static loadFromFile(filePath: string): Promise<BeatMap>;
163
+ }
164
+ export interface BeatMapGeneratorInstance {
165
+ /** Instance method for toJSON - serializes a beat map */
166
+ toJSON(beatMap: BeatMap): string;
167
+ /** Instance method for fromJSON - parses a beat map */
168
+ fromJSON(jsonString: string): BeatMap;
169
+ }
170
+ //# sourceMappingURL=BeatMapGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BeatMapGenerator.d.ts","sourceRoot":"","sources":["../../../../src/core/analysis/beat/BeatMapGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAER,OAAO,EAEP,uBAAuB,EAEvB,yBAAyB,EAEzB,cAAc,EAEjB,MAAM,wBAAwB,CAAC;AAiBhC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;AA+D7E,qBAAa,gBAAgB;IACzB,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,KAAK,CAAgC;IAE7C;;;;OAIG;gBACS,OAAO,GAAE,uBAA4B;IAqCjD;;;;OAIG;IACH,SAAS,IAAI,QAAQ,CAAC,uBAAuB,CAAC;IAI9C;;;;;;;;;;;;;;OAcG;IACG,eAAe,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,cAAc,EAC/B,UAAU,CAAC,EAAE,gBAAgB,GAC9B,OAAO,CAAC,OAAO,CAAC;IAuBnB;;;;;;;;;;;;;;OAcG;IACG,yBAAyB,CAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,cAAc,EAC/B,UAAU,CAAC,EAAE,gBAAgB,GAC9B,OAAO,CAAC,OAAO,CAAC;IA8JnB;;;;OAIG;IACH,WAAW,IAAI,yBAAyB,GAAG,IAAI;IAI/C;;OAEG;IACH,MAAM,IAAI,IAAI;IAYd;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAS/B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,kBAAkB;IA0C1B;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IA2B7B;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;IAe9B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,0BAA0B;IAkClC;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;OAEG;YACW,cAAc;IAqB5B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAoBvC;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAoB5C;;;;;OAKG;WACU,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1E;;;;;OAKG;WACU,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAWhE;AAGD,MAAM,WAAW,wBAAwB;IACrC,yDAAyD;IACzD,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;CACzC"}