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.
- package/LICENSE +21 -0
- package/README.md +352 -0
- package/dist/__vite-browser-external-DYxpcVy9.js +4 -0
- package/dist/constants/DefaultClasses.d.ts +46 -0
- package/dist/constants/DefaultClasses.d.ts.map +1 -0
- package/dist/constants/DefaultEnchantments.d.ts +337 -0
- package/dist/constants/DefaultEnchantments.d.ts.map +1 -0
- package/dist/constants/DefaultEnemies.d.ts +83 -0
- package/dist/constants/DefaultEnemies.d.ts.map +1 -0
- package/dist/constants/DefaultEquipment.d.ts +23 -0
- package/dist/constants/DefaultEquipment.d.ts.map +1 -0
- package/dist/constants/DefaultFeatures.d.ts +22 -0
- package/dist/constants/DefaultFeatures.d.ts.map +1 -0
- package/dist/constants/DefaultRaces.d.ts +102 -0
- package/dist/constants/DefaultRaces.d.ts.map +1 -0
- package/dist/constants/DefaultSkills.d.ts +26 -0
- package/dist/constants/DefaultSkills.d.ts.map +1 -0
- package/dist/constants/DefaultSpells.d.ts +41 -0
- package/dist/constants/DefaultSpells.d.ts.map +1 -0
- package/dist/constants/EncounterBalance.d.ts +208 -0
- package/dist/constants/EncounterBalance.d.ts.map +1 -0
- package/dist/constants/EnemyEquipment.d.ts +71 -0
- package/dist/constants/EnemyEquipment.d.ts.map +1 -0
- package/dist/constants/EnemyRarity.d.ts +79 -0
- package/dist/constants/EnemyRarity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts +68 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts +64 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts +62 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts +61 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts.map +1 -0
- package/dist/constants/ItemTemplates.d.ts +40 -0
- package/dist/constants/ItemTemplates.d.ts.map +1 -0
- package/dist/constants/MagicItems.d.ts +30 -0
- package/dist/constants/MagicItems.d.ts.map +1 -0
- package/dist/constants/SpellSlots.d.ts +30 -0
- package/dist/constants/SpellSlots.d.ts.map +1 -0
- package/dist/constants/StatScaling.d.ts +113 -0
- package/dist/constants/StatScaling.d.ts.map +1 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts +599 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/ColorExtractor.d.ts +64 -0
- package/dist/core/analysis/ColorExtractor.d.ts.map +1 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts +282 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/LevelSerializer.d.ts +265 -0
- package/dist/core/analysis/LevelSerializer.d.ts.map +1 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts +283 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts +214 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MusicClassifier.d.ts +524 -0
- package/dist/core/analysis/MusicClassifier.d.ts.map +1 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts +266 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/PitchDetector.d.ts +251 -0
- package/dist/core/analysis/PitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/SpectrumScanner.d.ts +52 -0
- package/dist/core/analysis/SpectrumScanner.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts +477 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts +170 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatStream.d.ts +316 -0
- package/dist/core/analysis/beat/BeatStream.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts +205 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts +137 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts.map +1 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts +180 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts +246 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts +1082 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts +192 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts +133 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts.map +1 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts +230 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts +399 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts +262 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts.map +1 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts +275 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts +256 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts +220 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts +303 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts +180 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts.map +1 -0
- package/dist/core/analysis/beat/index.d.ts +41 -0
- package/dist/core/analysis/beat/index.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts +204 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts +404 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts +61 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts +33 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/index.d.ts +18 -0
- package/dist/core/analysis/index.d.ts.map +1 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts +108 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatAI.d.ts +179 -0
- package/dist/core/combat/AI/CombatAI.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts +30 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts.map +1 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts +170 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts +231 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts +203 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts +201 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts.map +1 -0
- package/dist/core/combat/AttackResolver.d.ts +220 -0
- package/dist/core/combat/AttackResolver.d.ts.map +1 -0
- package/dist/core/combat/CombatEngine.d.ts +388 -0
- package/dist/core/combat/CombatEngine.d.ts.map +1 -0
- package/dist/core/combat/DiceRoller.d.ts +115 -0
- package/dist/core/combat/DiceRoller.d.ts.map +1 -0
- package/dist/core/combat/InitiativeRoller.d.ts +62 -0
- package/dist/core/combat/InitiativeRoller.d.ts.map +1 -0
- package/dist/core/combat/PartyAnalyzer.d.ts +215 -0
- package/dist/core/combat/PartyAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/SeededDiceRoller.d.ts +120 -0
- package/dist/core/combat/SeededDiceRoller.d.ts.map +1 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts +366 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts.map +1 -0
- package/dist/core/combat/SpellCaster.d.ts +113 -0
- package/dist/core/combat/SpellCaster.d.ts.map +1 -0
- package/dist/core/config/index.d.ts +24 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/progressionConfig.d.ts +73 -0
- package/dist/core/config/progressionConfig.d.ts.map +1 -0
- package/dist/core/config/sensorConfig.d.ts +134 -0
- package/dist/core/config/sensorConfig.d.ts.map +1 -0
- package/dist/core/equipment/BoxOpener.d.ts +175 -0
- package/dist/core/equipment/BoxOpener.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts +189 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentModifier.d.ts +327 -0
- package/dist/core/equipment/EquipmentModifier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts +246 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentValidator.d.ts +173 -0
- package/dist/core/equipment/EquipmentValidator.d.ts.map +1 -0
- package/dist/core/extensions/ExtensionManager.d.ts +517 -0
- package/dist/core/extensions/ExtensionManager.d.ts.map +1 -0
- package/dist/core/extensions/WeightedSelector.d.ts +156 -0
- package/dist/core/extensions/WeightedSelector.d.ts.map +1 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/initializeDefaults.d.ts +170 -0
- package/dist/core/extensions/initializeDefaults.d.ts.map +1 -0
- package/dist/core/features/FeatureEffectApplier.d.ts +102 -0
- package/dist/core/features/FeatureEffectApplier.d.ts.map +1 -0
- package/dist/core/features/FeatureQuery.d.ts +368 -0
- package/dist/core/features/FeatureQuery.d.ts.map +1 -0
- package/dist/core/features/FeatureTypes.d.ts +199 -0
- package/dist/core/features/FeatureTypes.d.ts.map +1 -0
- package/dist/core/features/FeatureValidator.d.ts +149 -0
- package/dist/core/features/FeatureValidator.d.ts.map +1 -0
- package/dist/core/features/index.d.ts +12 -0
- package/dist/core/features/index.d.ts.map +1 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts +83 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts.map +1 -0
- package/dist/core/generation/AppearanceGenerator.d.ts +32 -0
- package/dist/core/generation/AppearanceGenerator.d.ts.map +1 -0
- package/dist/core/generation/BeatConverter.d.ts +127 -0
- package/dist/core/generation/BeatConverter.d.ts.map +1 -0
- package/dist/core/generation/ButtonMapper.d.ts +346 -0
- package/dist/core/generation/ButtonMapper.d.ts.map +1 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts +92 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts.map +1 -0
- package/dist/core/generation/CRLevelConverter.d.ts +242 -0
- package/dist/core/generation/CRLevelConverter.d.ts.map +1 -0
- package/dist/core/generation/CharacterGenerator.d.ts +194 -0
- package/dist/core/generation/CharacterGenerator.d.ts.map +1 -0
- package/dist/core/generation/ClassSuggester.d.ts +184 -0
- package/dist/core/generation/ClassSuggester.d.ts.map +1 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts +151 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/EnemyGenerator.d.ts +595 -0
- package/dist/core/generation/EnemyGenerator.d.ts.map +1 -0
- package/dist/core/generation/EquipmentGenerator.d.ts +204 -0
- package/dist/core/generation/EquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/LegendaryGenerator.d.ts +213 -0
- package/dist/core/generation/LegendaryGenerator.d.ts.map +1 -0
- package/dist/core/generation/LevelGenerator.d.ts +390 -0
- package/dist/core/generation/LevelGenerator.d.ts.map +1 -0
- package/dist/core/generation/NamingEngine.d.ts +136 -0
- package/dist/core/generation/NamingEngine.d.ts.map +1 -0
- package/dist/core/generation/PitchBeatLinker.d.ts +150 -0
- package/dist/core/generation/PitchBeatLinker.d.ts.map +1 -0
- package/dist/core/generation/RaceSelector.d.ts +58 -0
- package/dist/core/generation/RaceSelector.d.ts.map +1 -0
- package/dist/core/generation/RhythmGenerator.d.ts +597 -0
- package/dist/core/generation/RhythmGenerator.d.ts.map +1 -0
- package/dist/core/generation/SkillAssigner.d.ts +78 -0
- package/dist/core/generation/SkillAssigner.d.ts.map +1 -0
- package/dist/core/generation/SpellManager.d.ts +132 -0
- package/dist/core/generation/SpellManager.d.ts.map +1 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts +255 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts.map +1 -0
- package/dist/core/generation/index.d.ts +41 -0
- package/dist/core/generation/index.d.ts.map +1 -0
- package/dist/core/parser/MetadataExtractor.d.ts +66 -0
- package/dist/core/parser/MetadataExtractor.d.ts.map +1 -0
- package/dist/core/parser/PlaylistParser.d.ts +45 -0
- package/dist/core/parser/PlaylistParser.d.ts.map +1 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts +333 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts.map +1 -0
- package/dist/core/playback/index.d.ts +5 -0
- package/dist/core/playback/index.d.ts.map +1 -0
- package/dist/core/progression/CharacterUpdater.d.ts +203 -0
- package/dist/core/progression/CharacterUpdater.d.ts.map +1 -0
- package/dist/core/progression/LevelUpProcessor.d.ts +234 -0
- package/dist/core/progression/LevelUpProcessor.d.ts.map +1 -0
- package/dist/core/progression/PrestigeSystem.d.ts +217 -0
- package/dist/core/progression/PrestigeSystem.d.ts.map +1 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts +182 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts.map +1 -0
- package/dist/core/progression/SessionTracker.d.ts +169 -0
- package/dist/core/progression/SessionTracker.d.ts.map +1 -0
- package/dist/core/progression/XPCalculator.d.ts +128 -0
- package/dist/core/progression/XPCalculator.d.ts.map +1 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts +97 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts.map +1 -0
- package/dist/core/progression/stat/StatManager.d.ts +179 -0
- package/dist/core/progression/stat/StatManager.d.ts.map +1 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts +301 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts.map +1 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts +162 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts.map +1 -0
- package/dist/core/sensors/GeolocationProvider.d.ts +156 -0
- package/dist/core/sensors/GeolocationProvider.d.ts.map +1 -0
- package/dist/core/sensors/MotionDetector.d.ts +58 -0
- package/dist/core/sensors/MotionDetector.d.ts.map +1 -0
- package/dist/core/sensors/SteamAPIClient.d.ts +108 -0
- package/dist/core/sensors/SteamAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts +360 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts +144 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts.map +1 -0
- package/dist/core/skills/SkillQuery.d.ts +159 -0
- package/dist/core/skills/SkillQuery.d.ts.map +1 -0
- package/dist/core/skills/SkillTypes.d.ts +233 -0
- package/dist/core/skills/SkillTypes.d.ts.map +1 -0
- package/dist/core/skills/SkillValidator.d.ts +146 -0
- package/dist/core/skills/SkillValidator.d.ts.map +1 -0
- package/dist/core/skills/index.d.ts +11 -0
- package/dist/core/skills/index.d.ts.map +1 -0
- package/dist/core/spells/SpellQuery.d.ts +194 -0
- package/dist/core/spells/SpellQuery.d.ts.map +1 -0
- package/dist/core/spells/SpellTypes.d.ts +71 -0
- package/dist/core/spells/SpellTypes.d.ts.map +1 -0
- package/dist/core/spells/SpellValidator.d.ts +129 -0
- package/dist/core/spells/SpellValidator.d.ts.map +1 -0
- package/dist/core/spells/index.d.ts +11 -0
- package/dist/core/spells/index.d.ts.map +1 -0
- package/dist/core/types/AudioProfile.d.ts +143 -0
- package/dist/core/types/AudioProfile.d.ts.map +1 -0
- package/dist/core/types/BeatMap.d.ts +1825 -0
- package/dist/core/types/BeatMap.d.ts.map +1 -0
- package/dist/core/types/ButtonMapping.d.ts +345 -0
- package/dist/core/types/ButtonMapping.d.ts.map +1 -0
- package/dist/core/types/Character.d.ts +397 -0
- package/dist/core/types/Character.d.ts.map +1 -0
- package/dist/core/types/ChartedBeatMap.d.ts +169 -0
- package/dist/core/types/ChartedBeatMap.d.ts.map +1 -0
- package/dist/core/types/Combat.d.ts +268 -0
- package/dist/core/types/Combat.d.ts.map +1 -0
- package/dist/core/types/CombatAI.d.ts +143 -0
- package/dist/core/types/CombatAI.d.ts.map +1 -0
- package/dist/core/types/Enemy.d.ts +447 -0
- package/dist/core/types/Enemy.d.ts.map +1 -0
- package/dist/core/types/Environmental.d.ts +213 -0
- package/dist/core/types/Environmental.d.ts.map +1 -0
- package/dist/core/types/Equipment.d.ts +309 -0
- package/dist/core/types/Equipment.d.ts.map +1 -0
- package/dist/core/types/ISessionTracker.d.ts +48 -0
- package/dist/core/types/ISessionTracker.d.ts.map +1 -0
- package/dist/core/types/LevelExport.d.ts +366 -0
- package/dist/core/types/LevelExport.d.ts.map +1 -0
- package/dist/core/types/Playlist.d.ts +70 -0
- package/dist/core/types/Playlist.d.ts.map +1 -0
- package/dist/core/types/Prestige.d.ts +94 -0
- package/dist/core/types/Prestige.d.ts.map +1 -0
- package/dist/core/types/Progression.d.ts +214 -0
- package/dist/core/types/Progression.d.ts.map +1 -0
- package/dist/core/types/RhythmXP.d.ts +398 -0
- package/dist/core/types/RhythmXP.d.ts.map +1 -0
- package/dist/core/utils/AbilityConstants.d.ts +31 -0
- package/dist/core/utils/AbilityConstants.d.ts.map +1 -0
- package/dist/core/utils/EffectApplierUtils.d.ts +56 -0
- package/dist/core/utils/EffectApplierUtils.d.ts.map +1 -0
- package/dist/core/utils/ImageValidator.d.ts +66 -0
- package/dist/core/utils/ImageValidator.d.ts.map +1 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts +88 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts.map +1 -0
- package/dist/essentia-wasm.es-BUEnKUts.js +2990 -0
- package/dist/essentia.js-model.es-CGA0xotH.js +306 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/playlist-data-engine.js +124 -0
- package/dist/playlist-data-engine.mjs +49251 -0
- package/dist/utils/EnchantmentLibrary.d.ts +378 -0
- package/dist/utils/EnchantmentLibrary.d.ts.map +1 -0
- package/dist/utils/arweaveGatewayManager.d.ts +485 -0
- package/dist/utils/arweaveGatewayManager.d.ts.map +1 -0
- package/dist/utils/arweaveUtils.d.ts +118 -0
- package/dist/utils/arweaveUtils.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +439 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/equipmentConstants.d.ts +60 -0
- package/dist/utils/equipmentConstants.d.ts.map +1 -0
- package/dist/utils/hash.d.ts +33 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +192 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/magicItemExamples.d.ts +46 -0
- package/dist/utils/magicItemExamples.d.ts.map +1 -0
- package/dist/utils/playlistUtils.d.ts +149 -0
- package/dist/utils/playlistUtils.d.ts.map +1 -0
- package/dist/utils/random.d.ts +34 -0
- package/dist/utils/random.d.ts.map +1 -0
- package/dist/utils/sensorDashboard.d.ts +60 -0
- package/dist/utils/sensorDashboard.d.ts.map +1 -0
- package/dist/utils/validators.d.ts +189 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beat Interpolation Debug Utility
|
|
3
|
+
*
|
|
4
|
+
* Provides detailed debug output for the beat interpolation process.
|
|
5
|
+
* This tool is designed for research, development, and troubleshooting
|
|
6
|
+
* to understand how the interpolation algorithm works.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { BeatInterpolator, generateDebugReport } from './beat/index.js';
|
|
11
|
+
*
|
|
12
|
+
* const interpolator = new BeatInterpolator();
|
|
13
|
+
* const interpolatedBeatMap = interpolator.interpolate(beatMap);
|
|
14
|
+
*
|
|
15
|
+
* // Generate a complete debug report
|
|
16
|
+
* const debugReport = generateDebugReport(interpolatedBeatMap);
|
|
17
|
+
* console.log(debugReport.toConsole());
|
|
18
|
+
*
|
|
19
|
+
* // Or save to JSON for later analysis
|
|
20
|
+
* const json = debugReport.toJSON();
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import type { Beat, BeatWithSource, InterpolatedBeatMap, QuarterNoteDetection } from '../../../types/BeatMap.js';
|
|
24
|
+
/**
|
|
25
|
+
* A single entry in the quarter note detection histogram
|
|
26
|
+
*/
|
|
27
|
+
export interface HistogramEntry {
|
|
28
|
+
/** Interval bucket in seconds */
|
|
29
|
+
intervalSeconds: number;
|
|
30
|
+
/** Weight value for this bucket */
|
|
31
|
+
weight: number;
|
|
32
|
+
/** Whether this is the detected quarter note peak */
|
|
33
|
+
isPrimaryPeak: boolean;
|
|
34
|
+
/** Whether this is a secondary peak */
|
|
35
|
+
isSecondaryPeak: boolean;
|
|
36
|
+
/** Equivalent BPM for this interval */
|
|
37
|
+
bpm: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Information about a single gap between detected beats
|
|
41
|
+
*/
|
|
42
|
+
export interface GapDetail {
|
|
43
|
+
/** Index of the beat starting this gap */
|
|
44
|
+
startBeatIndex: number;
|
|
45
|
+
/** Index of the beat ending this gap */
|
|
46
|
+
endBeatIndex: number;
|
|
47
|
+
/** Timestamp of the start beat */
|
|
48
|
+
startTime: number;
|
|
49
|
+
/** Timestamp of the end beat */
|
|
50
|
+
endTime: number;
|
|
51
|
+
/** Duration of the gap in seconds */
|
|
52
|
+
duration: number;
|
|
53
|
+
/** Number of quarter notes that fit in this gap */
|
|
54
|
+
quarterNotesInGap: number;
|
|
55
|
+
/** Number of beats that were interpolated in this gap */
|
|
56
|
+
interpolatedBeats: number;
|
|
57
|
+
/** Whether this is a half-note gap (2x quarter note) */
|
|
58
|
+
isHalfNoteGap: boolean;
|
|
59
|
+
/** Whether this gap contains anomalies */
|
|
60
|
+
hasAnomalies: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Tempo drift data point
|
|
64
|
+
*/
|
|
65
|
+
export interface TempoDriftPoint {
|
|
66
|
+
/** Timestamp in seconds */
|
|
67
|
+
timestamp: number;
|
|
68
|
+
/** Local tempo in BPM at this point */
|
|
69
|
+
localTempo: number;
|
|
70
|
+
/** Beat index */
|
|
71
|
+
beatIndex: number;
|
|
72
|
+
/** Whether this is a detected or interpolated beat */
|
|
73
|
+
source: 'detected' | 'interpolated';
|
|
74
|
+
/** Deviation from the base tempo (percentage) */
|
|
75
|
+
deviationPercent: number;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Per-beat debug information
|
|
79
|
+
*/
|
|
80
|
+
export interface BeatDebugInfo {
|
|
81
|
+
/** Timestamp in seconds */
|
|
82
|
+
timestamp: number;
|
|
83
|
+
/** Beat index in the merged array */
|
|
84
|
+
index: number;
|
|
85
|
+
/** Source of this beat */
|
|
86
|
+
source: 'detected' | 'interpolated';
|
|
87
|
+
/** Confidence score (0-1) */
|
|
88
|
+
confidence: number;
|
|
89
|
+
/** Intensity value */
|
|
90
|
+
intensity: number;
|
|
91
|
+
/** Distance to nearest anchor (for interpolated beats) */
|
|
92
|
+
distanceToAnchor: number | null;
|
|
93
|
+
/** Timestamp of nearest anchor (for interpolated beats) */
|
|
94
|
+
nearestAnchorTimestamp: number | null;
|
|
95
|
+
/** Local tempo at this beat (BPM) */
|
|
96
|
+
localTempo: number;
|
|
97
|
+
/** Interval from previous beat (seconds) */
|
|
98
|
+
intervalFromPrevious: number | null;
|
|
99
|
+
/** Grid alignment error (seconds) */
|
|
100
|
+
gridAlignmentError: number;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Debug information for a tempo section
|
|
104
|
+
*/
|
|
105
|
+
export interface TempoSectionDebugInfo {
|
|
106
|
+
/** Section index (0-based) */
|
|
107
|
+
index: number;
|
|
108
|
+
/** Section start time in seconds */
|
|
109
|
+
start: number;
|
|
110
|
+
/** Section end time in seconds */
|
|
111
|
+
end: number;
|
|
112
|
+
/** Duration of section in seconds */
|
|
113
|
+
duration: number;
|
|
114
|
+
/** Tempo for this section in BPM */
|
|
115
|
+
bpm: number;
|
|
116
|
+
/** Quarter note interval in seconds */
|
|
117
|
+
intervalSeconds: number;
|
|
118
|
+
/** Number of detected beats in this section */
|
|
119
|
+
beatCount: number;
|
|
120
|
+
/** Index of first beat in this section */
|
|
121
|
+
startBeatIndex: number;
|
|
122
|
+
/** Index of last beat in this section */
|
|
123
|
+
endBeatIndex: number;
|
|
124
|
+
/** BPM change from previous section (null for first section) */
|
|
125
|
+
bpmChangeFromPrevious: number | null;
|
|
126
|
+
/** Percentage change from previous section (null for first section) */
|
|
127
|
+
percentChangeFromPrevious: number | null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Multi-tempo debug information
|
|
131
|
+
*/
|
|
132
|
+
export interface MultiTempoDebugInfo {
|
|
133
|
+
/** Whether multi-tempo was detected */
|
|
134
|
+
hasMultipleTempos: boolean;
|
|
135
|
+
/** Whether multi-tempo analysis was applied */
|
|
136
|
+
hasMultiTempoApplied: boolean;
|
|
137
|
+
/** Detected cluster tempos from normal analysis */
|
|
138
|
+
detectedClusterTempos: number[];
|
|
139
|
+
/** Full tempo section data (only after multi-tempo re-analysis) */
|
|
140
|
+
sections: TempoSectionDebugInfo[];
|
|
141
|
+
/** Number of sections */
|
|
142
|
+
sectionCount: number;
|
|
143
|
+
/** BPM range (min to max) */
|
|
144
|
+
bpmRange: {
|
|
145
|
+
min: number;
|
|
146
|
+
max: number;
|
|
147
|
+
spread: number;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Complete debug report for beat interpolation
|
|
152
|
+
*/
|
|
153
|
+
export interface InterpolationDebugReport {
|
|
154
|
+
/** Audio ID */
|
|
155
|
+
audioId: string;
|
|
156
|
+
/** Audio duration in seconds */
|
|
157
|
+
duration: number;
|
|
158
|
+
/** When this report was generated */
|
|
159
|
+
generatedAt: string;
|
|
160
|
+
/** Quarter note detection debug info */
|
|
161
|
+
quarterNoteDetection: {
|
|
162
|
+
/** Detected interval in seconds */
|
|
163
|
+
intervalSeconds: number;
|
|
164
|
+
/** Equivalent BPM */
|
|
165
|
+
bpm: number;
|
|
166
|
+
/** Detection confidence */
|
|
167
|
+
confidence: number;
|
|
168
|
+
/** Method used for detection */
|
|
169
|
+
method: QuarterNoteDetection['method'];
|
|
170
|
+
/** Number of dense sections found */
|
|
171
|
+
denseSectionCount: number;
|
|
172
|
+
/** Total beats from dense sections */
|
|
173
|
+
denseSectionBeats: number;
|
|
174
|
+
/** Histogram data */
|
|
175
|
+
histogram: HistogramEntry[];
|
|
176
|
+
};
|
|
177
|
+
/** Gap analysis debug info */
|
|
178
|
+
gapAnalysis: {
|
|
179
|
+
/** Total number of gaps */
|
|
180
|
+
totalGaps: number;
|
|
181
|
+
/** Number of half-note gaps */
|
|
182
|
+
halfNoteGaps: number;
|
|
183
|
+
/** Number of anomalies detected */
|
|
184
|
+
anomalyCount: number;
|
|
185
|
+
/** Indices of anomalous beats */
|
|
186
|
+
anomalyIndices: number[];
|
|
187
|
+
/** Average gap size in quarter notes */
|
|
188
|
+
avgGapSize: number;
|
|
189
|
+
/** Grid alignment score (0-1) */
|
|
190
|
+
gridAlignmentScore: number;
|
|
191
|
+
/** Detailed gap information */
|
|
192
|
+
gaps: GapDetail[];
|
|
193
|
+
};
|
|
194
|
+
/** Per-beat debug information */
|
|
195
|
+
beats: BeatDebugInfo[];
|
|
196
|
+
/** Tempo drift over time */
|
|
197
|
+
tempoDrift: {
|
|
198
|
+
/** Base tempo in BPM */
|
|
199
|
+
baseTempo: number;
|
|
200
|
+
/** Minimum local tempo observed */
|
|
201
|
+
minTempo: number;
|
|
202
|
+
/** Maximum local tempo observed */
|
|
203
|
+
maxTempo: number;
|
|
204
|
+
/** Tempo drift ratio (max/min) */
|
|
205
|
+
driftRatio: number;
|
|
206
|
+
/** Data points for drift visualization */
|
|
207
|
+
dataPoints: TempoDriftPoint[];
|
|
208
|
+
};
|
|
209
|
+
/** Summary statistics */
|
|
210
|
+
summary: {
|
|
211
|
+
/** Total detected beats */
|
|
212
|
+
detectedBeatCount: number;
|
|
213
|
+
/** Total interpolated beats */
|
|
214
|
+
interpolatedBeatCount: number;
|
|
215
|
+
/** Total beats in merged output */
|
|
216
|
+
totalBeatCount: number;
|
|
217
|
+
/** Ratio of interpolated to total beats */
|
|
218
|
+
interpolationRatio: number;
|
|
219
|
+
/** Average confidence of interpolated beats */
|
|
220
|
+
avgInterpolatedConfidence: number;
|
|
221
|
+
/** Average confidence of detected beats */
|
|
222
|
+
avgDetectedConfidence: number;
|
|
223
|
+
/** Beats per second (overall density) */
|
|
224
|
+
beatsPerSecond: number;
|
|
225
|
+
};
|
|
226
|
+
/** Multi-tempo section debug info */
|
|
227
|
+
multiTempo: MultiTempoDebugInfo;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Options for debug output formatting
|
|
231
|
+
*/
|
|
232
|
+
export interface DebugOutputOptions {
|
|
233
|
+
/** Maximum number of beats to include in detailed output (0 = all) */
|
|
234
|
+
maxBeats?: number;
|
|
235
|
+
/** Whether to include histogram data */
|
|
236
|
+
includeHistogram?: boolean;
|
|
237
|
+
/** Whether to include gap details */
|
|
238
|
+
includeGapDetails?: boolean;
|
|
239
|
+
/** Whether to include per-beat debug info */
|
|
240
|
+
includeBeatDetails?: boolean;
|
|
241
|
+
/** Whether to include tempo drift data */
|
|
242
|
+
includeTempoDrift?: boolean;
|
|
243
|
+
/** Whether to include multi-tempo section data */
|
|
244
|
+
includeMultiTempo?: boolean;
|
|
245
|
+
/** Histogram bucket size in seconds */
|
|
246
|
+
histogramBucketSize?: number;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Default debug output options
|
|
250
|
+
*/
|
|
251
|
+
export declare const DEFAULT_DEBUG_OUTPUT_OPTIONS: Required<DebugOutputOptions>;
|
|
252
|
+
/**
|
|
253
|
+
* Collect histogram data from a beat map
|
|
254
|
+
*
|
|
255
|
+
* Reconstructs the interval histogram used for quarter note detection.
|
|
256
|
+
*
|
|
257
|
+
* @param beats - Detected beats to analyze
|
|
258
|
+
* @param quarterNoteInterval - The detected quarter note interval
|
|
259
|
+
* @param bucketSize - Histogram bucket size in seconds
|
|
260
|
+
* @returns Array of histogram entries
|
|
261
|
+
*/
|
|
262
|
+
export declare function collectHistogramData(beats: Beat[], quarterNoteInterval: number, bucketSize?: number): HistogramEntry[];
|
|
263
|
+
/**
|
|
264
|
+
* Collect detailed gap information
|
|
265
|
+
*
|
|
266
|
+
* @param detectedBeats - Original detected beats
|
|
267
|
+
* @param mergedBeats - Merged beats (interpolated + detected)
|
|
268
|
+
* @param quarterNoteInterval - Detected quarter note interval
|
|
269
|
+
* @param anomalies - Array of anomaly indices
|
|
270
|
+
* @returns Array of gap details
|
|
271
|
+
*/
|
|
272
|
+
export declare function collectGapDetails(detectedBeats: Beat[], mergedBeats: BeatWithSource[], quarterNoteInterval: number, anomalies: number[]): GapDetail[];
|
|
273
|
+
/**
|
|
274
|
+
* Collect per-beat debug information
|
|
275
|
+
*
|
|
276
|
+
* @param mergedBeats - Merged beats array
|
|
277
|
+
* @param quarterNoteInterval - Detected quarter note interval
|
|
278
|
+
* @returns Array of beat debug info
|
|
279
|
+
*/
|
|
280
|
+
export declare function collectBeatDebugInfo(mergedBeats: BeatWithSource[], quarterNoteInterval: number): BeatDebugInfo[];
|
|
281
|
+
/**
|
|
282
|
+
* Collect tempo drift data
|
|
283
|
+
*
|
|
284
|
+
* @param mergedBeats - Merged beats array
|
|
285
|
+
* @param baseTempo - Base tempo in BPM
|
|
286
|
+
* @returns Tempo drift data points and statistics
|
|
287
|
+
*/
|
|
288
|
+
export declare function collectTempoDriftData(mergedBeats: BeatWithSource[], baseTempo: number): {
|
|
289
|
+
minTempo: number;
|
|
290
|
+
maxTempo: number;
|
|
291
|
+
driftRatio: number;
|
|
292
|
+
dataPoints: TempoDriftPoint[];
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Collect multi-tempo section debug information
|
|
296
|
+
*
|
|
297
|
+
* @param interpolationMetadata - The interpolation metadata from the beat map
|
|
298
|
+
* @returns Multi-tempo debug information
|
|
299
|
+
*/
|
|
300
|
+
export declare function collectMultiTempoDebugInfo(interpolationMetadata: InterpolatedBeatMap['interpolationMetadata']): MultiTempoDebugInfo;
|
|
301
|
+
/**
|
|
302
|
+
* Generate a comprehensive debug report for an interpolated beat map
|
|
303
|
+
*
|
|
304
|
+
* @param interpolatedBeatMap - The interpolated beat map to analyze
|
|
305
|
+
* @param options - Debug output options
|
|
306
|
+
* @returns Complete debug report
|
|
307
|
+
*/
|
|
308
|
+
export declare function generateDebugReport(interpolatedBeatMap: InterpolatedBeatMap, options?: DebugOutputOptions): InterpolationDebugReport;
|
|
309
|
+
/**
|
|
310
|
+
* Format a debug report as a human-readable console string
|
|
311
|
+
*
|
|
312
|
+
* @param report - Debug report to format
|
|
313
|
+
* @returns Formatted string for console output
|
|
314
|
+
*/
|
|
315
|
+
export declare function formatDebugReportToConsole(report: InterpolationDebugReport): string;
|
|
316
|
+
/**
|
|
317
|
+
* Format a debug report as JSON
|
|
318
|
+
*
|
|
319
|
+
* @param report - Debug report to format
|
|
320
|
+
* @returns JSON string
|
|
321
|
+
*/
|
|
322
|
+
export declare function formatDebugReportToJSON(report: InterpolationDebugReport): string;
|
|
323
|
+
/**
|
|
324
|
+
* Generate an ASCII visualization of tempo drift
|
|
325
|
+
*
|
|
326
|
+
* @param report - Debug report
|
|
327
|
+
* @param width - Width of the visualization in characters
|
|
328
|
+
* @returns ASCII visualization string
|
|
329
|
+
*/
|
|
330
|
+
export declare function generateTempoDriftVisualization(report: InterpolationDebugReport, width?: number): string;
|
|
331
|
+
/**
|
|
332
|
+
* Generate an ASCII visualization of confidence scores over time
|
|
333
|
+
*
|
|
334
|
+
* @param report - Debug report
|
|
335
|
+
* @param width - Width of the visualization in characters
|
|
336
|
+
* @returns ASCII visualization string
|
|
337
|
+
*/
|
|
338
|
+
export declare function generateConfidenceVisualization(report: InterpolationDebugReport, width?: number): string;
|
|
339
|
+
/**
|
|
340
|
+
* Generate an ASCII visualization of tempo sections
|
|
341
|
+
*
|
|
342
|
+
* Shows section boundaries and per-section tempos as a timeline.
|
|
343
|
+
*
|
|
344
|
+
* @param report - Debug report
|
|
345
|
+
* @param width - Width of the visualization in characters
|
|
346
|
+
* @returns ASCII visualization string
|
|
347
|
+
*/
|
|
348
|
+
export declare function generateTempoSectionVisualization(report: InterpolationDebugReport, width?: number): string;
|
|
349
|
+
/**
|
|
350
|
+
* Debug helper class for beat interpolation
|
|
351
|
+
*
|
|
352
|
+
* Provides methods for generating and formatting debug output.
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* ```typescript
|
|
356
|
+
* const interpolator = new BeatInterpolator();
|
|
357
|
+
* const interpolatedBeatMap = interpolator.interpolate(beatMap);
|
|
358
|
+
*
|
|
359
|
+
* const debug = new BeatInterpolationDebug(interpolatedBeatMap);
|
|
360
|
+
* console.log(debug.toConsole());
|
|
361
|
+
* debug.saveToFile('./debug-report.json');
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
export declare class BeatInterpolationDebug {
|
|
365
|
+
private report;
|
|
366
|
+
constructor(interpolatedBeatMap: InterpolatedBeatMap, options?: DebugOutputOptions);
|
|
367
|
+
/**
|
|
368
|
+
* Get the raw debug report data
|
|
369
|
+
*/
|
|
370
|
+
getReport(): InterpolationDebugReport;
|
|
371
|
+
/**
|
|
372
|
+
* Format as human-readable console output
|
|
373
|
+
*/
|
|
374
|
+
toConsole(): string;
|
|
375
|
+
/**
|
|
376
|
+
* Format as JSON string
|
|
377
|
+
*/
|
|
378
|
+
toJSON(): string;
|
|
379
|
+
/**
|
|
380
|
+
* Get tempo drift visualization
|
|
381
|
+
*/
|
|
382
|
+
getTempoDriftVisualization(width?: number): string;
|
|
383
|
+
/**
|
|
384
|
+
* Get confidence visualization
|
|
385
|
+
*/
|
|
386
|
+
getConfidenceVisualization(width?: number): string;
|
|
387
|
+
/**
|
|
388
|
+
* Get tempo section visualization
|
|
389
|
+
*/
|
|
390
|
+
getTempoSectionVisualization(width?: number): string;
|
|
391
|
+
/**
|
|
392
|
+
* Print debug info to console
|
|
393
|
+
*/
|
|
394
|
+
print(): void;
|
|
395
|
+
/**
|
|
396
|
+
* Save debug report to JSON file (Node.js only)
|
|
397
|
+
*/
|
|
398
|
+
saveToFile(filePath: string): Promise<void>;
|
|
399
|
+
/**
|
|
400
|
+
* Load debug report from JSON file (Node.js only)
|
|
401
|
+
*/
|
|
402
|
+
static loadFromFile(filePath: string): Promise<BeatInterpolationDebug>;
|
|
403
|
+
}
|
|
404
|
+
//# sourceMappingURL=beatInterpolationDebug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beatInterpolationDebug.d.ts","sourceRoot":"","sources":["../../../../../src/core/analysis/beat/utils/beatInterpolationDebug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACR,IAAI,EAEJ,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EAGvB,MAAM,2BAA2B,CAAC;AAMnC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,iCAAiC;IACjC,eAAe,EAAE,MAAM,CAAC;IAExB,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IAEf,qDAAqD;IACrD,aAAa,EAAE,OAAO,CAAC;IAEvB,uCAAuC;IACvC,eAAe,EAAE,OAAO,CAAC;IAEzB,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IAEvB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IAErB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAElB,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAEhB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IAEjB,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,CAAC;IAE1B,yDAAyD;IACzD,iBAAiB,EAAE,MAAM,CAAC;IAE1B,wDAAwD;IACxD,aAAa,EAAE,OAAO,CAAC;IAEvB,0CAA0C;IAC1C,YAAY,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAElB,u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
|
|
4
|
+
* A one-step function that takes an InterpolatedBeatMap and SubdivisionConfig,
|
|
5
|
+
* unifies the beat map, and returns a SubdividedBeatMap.
|
|
6
|
+
*
|
|
7
|
+
* This is a convenience wrapper around `unifyBeatMap()` + `BeatSubdivider.subdivide()`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const interpolator = new BeatInterpolator();
|
|
12
|
+
* const interpolatedMap = interpolator.interpolate(beatMap);
|
|
13
|
+
*
|
|
14
|
+
* // One-step subdivision with per-beat config
|
|
15
|
+
* const subdividedMap = subdivideBeatMap(interpolatedMap, {
|
|
16
|
+
* beatSubdivisions: new Map([
|
|
17
|
+
* [0, 'quarter'],
|
|
18
|
+
* [32, 'eighth'],
|
|
19
|
+
* ]),
|
|
20
|
+
* defaultSubdivision: 'quarter',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
import type { InterpolatedBeatMap, SubdividedBeatMap, SubdivisionConfig } from '../../../types/BeatMap.js';
|
|
25
|
+
import { type BeatSubdividerOptions } from '../BeatSubdivider.js';
|
|
26
|
+
/**
|
|
27
|
+
* Subdivide an interpolated beat map with a single function call
|
|
28
|
+
*
|
|
29
|
+
* This convenience function combines the unification and subdivision steps:
|
|
30
|
+
* 1. Converts InterpolatedBeatMap to UnifiedBeatMap
|
|
31
|
+
* 2. Applies the subdivision configuration
|
|
32
|
+
* 3. Returns the final SubdividedBeatMap
|
|
33
|
+
*
|
|
34
|
+
* @param interpolatedBeatMap - The interpolated beat map to subdivide
|
|
35
|
+
* @param config - Optional subdivision configuration (defaults to quarter notes)
|
|
36
|
+
* @param options - Optional BeatSubdivider options
|
|
37
|
+
* @returns A subdivided beat map
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Basic usage with default config (quarter notes)
|
|
42
|
+
* const subdividedMap = subdivideBeatMap(interpolatedMap);
|
|
43
|
+
*
|
|
44
|
+
* // With custom per-beat subdivision config
|
|
45
|
+
* const subdividedMap = subdivideBeatMap(interpolatedMap, {
|
|
46
|
+
* beatSubdivisions: new Map([
|
|
47
|
+
* [0, 'quarter'],
|
|
48
|
+
* [32, 'eighth'],
|
|
49
|
+
* ]),
|
|
50
|
+
* defaultSubdivision: 'quarter',
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // With subdivider options
|
|
54
|
+
* const subdividedMap = subdivideBeatMap(interpolatedMap, config, {
|
|
55
|
+
* tolerance: 0.03,
|
|
56
|
+
* defaultIntensity: 0.6,
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function subdivideBeatMap(interpolatedBeatMap: InterpolatedBeatMap, config?: SubdivisionConfig, options?: BeatSubdividerOptions): SubdividedBeatMap;
|
|
61
|
+
//# sourceMappingURL=subdivideBeatMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subdivideBeatMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/analysis/beat/utils/subdivideBeatMap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EACR,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,gBAAgB,CAC5B,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,GAAE,iBAA8C,EACtD,OAAO,CAAC,EAAE,qBAAqB,GAChC,iBAAiB,CASnB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beat Map Unification Utility
|
|
3
|
+
*
|
|
4
|
+
* Converts an InterpolatedBeatMap into a UnifiedBeatMap by flattening
|
|
5
|
+
* detected + interpolated beats into a single unified list of quarter notes.
|
|
6
|
+
* This is the foundation for the subdivision system.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const interpolator = new BeatInterpolator();
|
|
11
|
+
* const interpolatedMap = interpolator.interpolate(beatMap);
|
|
12
|
+
* const unifiedMap = unifyBeatMap(interpolatedMap);
|
|
13
|
+
*
|
|
14
|
+
* // All beats are now in a single array
|
|
15
|
+
* console.log(unifiedMap.beats.length);
|
|
16
|
+
*
|
|
17
|
+
* // Detected beat indices for accent patterns
|
|
18
|
+
* console.log(unifiedMap.detectedBeatIndices);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import type { InterpolatedBeatMap, UnifiedBeatMap } from '../../../types/BeatMap.js';
|
|
22
|
+
/**
|
|
23
|
+
* Convert an InterpolatedBeatMap to a UnifiedBeatMap
|
|
24
|
+
*
|
|
25
|
+
* This function flattens the merged beats (detected + interpolated) into a
|
|
26
|
+
* single unified list, removing the source distinction while preserving
|
|
27
|
+
* detected beat indices for accent pattern use.
|
|
28
|
+
*
|
|
29
|
+
* @param interpolatedBeatMap - The interpolated beat map to unify
|
|
30
|
+
* @returns A unified beat map ready for subdivision
|
|
31
|
+
*/
|
|
32
|
+
export declare function unifyBeatMap(interpolatedBeatMap: InterpolatedBeatMap): UnifiedBeatMap;
|
|
33
|
+
//# sourceMappingURL=unifyBeatMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unifyBeatMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/analysis/beat/utils/unifyBeatMap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACR,mBAAmB,EACnB,cAAc,EAGjB,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,cAAc,CA4CrF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analysis Module
|
|
3
|
+
*
|
|
4
|
+
* Exports all audio analysis utilities.
|
|
5
|
+
*/
|
|
6
|
+
export { AudioAnalyzer } from './AudioAnalyzer.js';
|
|
7
|
+
export { SpectrumScanner } from './SpectrumScanner.js';
|
|
8
|
+
export { MusicClassifier } from './MusicClassifier.js';
|
|
9
|
+
export { PitchDetector } from './PitchDetector.js';
|
|
10
|
+
export { EssentiaPitchDetector, DEFAULT_CREPE_MODEL_URL } from './EssentiaPitchDetector.js';
|
|
11
|
+
export type { EssentiaPitchAlgorithm, EssentiaPitchDetectorConfig, } from './EssentiaPitchDetector.js';
|
|
12
|
+
export { MultiBandAnalyzer } from './MultiBandAnalyzer.js';
|
|
13
|
+
export * from './beat/index.js';
|
|
14
|
+
export { MelodyContourAnalyzer } from './MelodyContourAnalyzer.js';
|
|
15
|
+
export type { MelodyContourAnalysisResult, MelodyContourAnalyzerConfig, DirectionStats, IntervalStats, IntervalCategory, PitchDirection, MelodyContour, MelodySegment, MelodySegmentDirection, MelodyContourDirection, } from './MelodyContourAnalyzer.js';
|
|
16
|
+
export { PitchAnalyzer } from './PitchAnalyzer.js';
|
|
17
|
+
export type { PitchAnalyzerConfig, PitchAnalysisProfile, PitchContour, PitchContourSegment, PitchContourSegmentDirection, PitchContourDirection, } from './PitchAnalyzer.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/analysis/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,YAAY,EACR,sBAAsB,EACtB,2BAA2B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EACR,2BAA2B,EAC3B,2BAA2B,EAC3B,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,sBAAsB,GACzB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACR,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,4BAA4B,EAC5B,qBAAqB,GACxB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AICombatRunner — Orchestrates full combat encounters with AI decision-making
|
|
3
|
+
*
|
|
4
|
+
* Bridges the gap between CombatAI (decisions) and CombatEngine (execution).
|
|
5
|
+
* For each combatant's turn, the runner:
|
|
6
|
+
* 1. Asks CombatAI for a decision
|
|
7
|
+
* 2. Executes the decision via CombatEngine
|
|
8
|
+
* 3. Processes legendary actions for bosses
|
|
9
|
+
* 4. Advances to the next turn
|
|
10
|
+
*
|
|
11
|
+
* The runner is designed for both live combat (random dice) and simulation
|
|
12
|
+
* (seeded dice). Pass a SeededDiceRoller for deterministic results.
|
|
13
|
+
*/
|
|
14
|
+
import type { CharacterSheet } from '../../types/Character.js';
|
|
15
|
+
import type { CombatInstance, CombatConfig, CombatResult, DiceRollerAPI } from '../../types/Combat.js';
|
|
16
|
+
import type { AIConfig, CombatantMetrics } from '../../types/CombatAI.js';
|
|
17
|
+
/**
|
|
18
|
+
* Result of an AI-driven combat simulation.
|
|
19
|
+
* Contains both the full combat instance (with history) and the final result.
|
|
20
|
+
*/
|
|
21
|
+
export interface AICombatResult {
|
|
22
|
+
/** Full combat instance with complete action history */
|
|
23
|
+
combat: CombatInstance;
|
|
24
|
+
/** Final combat result (winner, XP, rounds, etc.) */
|
|
25
|
+
result: CombatResult;
|
|
26
|
+
/** Per-combatant metrics computed from combat history */
|
|
27
|
+
metrics: Map<string, CombatantMetrics>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* AICombatRunner — Runs a full combat encounter with AI-controlled combatants.
|
|
31
|
+
*
|
|
32
|
+
* Usage:
|
|
33
|
+
* ```ts
|
|
34
|
+
* const runner = new AICombatRunner();
|
|
35
|
+
* const { combat, result } = runner.runFullCombat(
|
|
36
|
+
* players, enemies,
|
|
37
|
+
* { playerStyle: 'normal', enemyStyle: 'aggressive' },
|
|
38
|
+
* { maxTurnsBeforeDraw: 50 },
|
|
39
|
+
* createSeededRoller('sim-seed-42')
|
|
40
|
+
* );
|
|
41
|
+
* console.log(result.winnerSide); // 'player' | 'enemy' | 'draw'
|
|
42
|
+
* console.log(result.roundsElapsed);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class AICombatRunner {
|
|
46
|
+
/**
|
|
47
|
+
* Run a complete combat encounter with AI-controlled combatants.
|
|
48
|
+
*
|
|
49
|
+
* @param players - Player character sheets
|
|
50
|
+
* @param enemies - Enemy character sheets
|
|
51
|
+
* @param aiConfig - AI configuration (play styles per side)
|
|
52
|
+
* @param combatConfig - Optional combat engine configuration
|
|
53
|
+
* @param diceRoller - Optional dice roller for deterministic simulation
|
|
54
|
+
* @returns The full combat instance and final result
|
|
55
|
+
*/
|
|
56
|
+
runFullCombat(players: CharacterSheet[], enemies: CharacterSheet[], aiConfig: AIConfig, combatConfig?: CombatConfig, diceRoller?: DiceRollerAPI): AICombatResult;
|
|
57
|
+
/**
|
|
58
|
+
* Execute an AI decision on the combat engine.
|
|
59
|
+
*
|
|
60
|
+
* Maps each AIDecision action type to the corresponding CombatEngine method.
|
|
61
|
+
* Unhandled actions (e.g., useItem) are logged in history without mechanical effect.
|
|
62
|
+
*/
|
|
63
|
+
private executeDecision;
|
|
64
|
+
/**
|
|
65
|
+
* Process legendary actions for boss enemies after a regular combatant's turn.
|
|
66
|
+
*
|
|
67
|
+
* In D&D 5e, legendary actions are taken at the end of another creature's turn.
|
|
68
|
+
* Each boss can spend up to 3 legendary action points per round. The AI
|
|
69
|
+
* decides whether to act and which action to use, potentially chaining
|
|
70
|
+
* multiple actions in a single turn.
|
|
71
|
+
*/
|
|
72
|
+
private processLegendaryActions;
|
|
73
|
+
/**
|
|
74
|
+
* Execute a legendary action decision from the AI.
|
|
75
|
+
*/
|
|
76
|
+
private executeLegendaryDecision;
|
|
77
|
+
/**
|
|
78
|
+
* Execute a weapon attack with resilience to weapon data issues.
|
|
79
|
+
*
|
|
80
|
+
* Handles the name mismatch between CombatAI's 'Unarmed Strike' and
|
|
81
|
+
* CombatEngine's 'unarmed' trigger. Falls back to unarmed strike if
|
|
82
|
+
* the named weapon causes an error (e.g., not in DEFAULT_EQUIPMENT).
|
|
83
|
+
*/
|
|
84
|
+
private executeWeaponAttack;
|
|
85
|
+
/**
|
|
86
|
+
* Find a combatant by ID in the combat instance.
|
|
87
|
+
*/
|
|
88
|
+
private findCombatant;
|
|
89
|
+
/**
|
|
90
|
+
* Find a spell by name from a combatant's combat_spells array.
|
|
91
|
+
*/
|
|
92
|
+
private findSpell;
|
|
93
|
+
/**
|
|
94
|
+
* Resolve target combatants from a decision's target and targetIds fields.
|
|
95
|
+
*/
|
|
96
|
+
private resolveTargets;
|
|
97
|
+
/**
|
|
98
|
+
* Fallback: basic attack the first living enemy when the preferred action
|
|
99
|
+
* can't be executed (e.g., flee not allowed).
|
|
100
|
+
*/
|
|
101
|
+
private fallbackAttack;
|
|
102
|
+
/**
|
|
103
|
+
* Check if a combatant has any status effect that forces turn skipping
|
|
104
|
+
* (e.g., Stunned, Unconscious).
|
|
105
|
+
*/
|
|
106
|
+
private hasSkipTurnEffect;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=AICombatRunner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AICombatRunner.d.ts","sourceRoot":"","sources":["../../../../src/core/combat/AI/AICombatRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EACV,cAAc,EAEd,YAAY,EACZ,YAAY,EACZ,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAc,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKtF;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,MAAM,EAAE,cAAc,CAAC;IACvB,qDAAqD;IACrD,MAAM,EAAE,YAAY,CAAC;IACrB,yDAAyD;IACzD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACxC;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,cAAc;IACzB;;;;;;;;;OASG;IACH,aAAa,CACX,OAAO,EAAE,cAAc,EAAE,EACzB,OAAO,EAAE,cAAc,EAAE,EACzB,QAAQ,EAAE,QAAQ,EAClB,YAAY,CAAC,EAAE,YAAY,EAC3B,UAAU,CAAC,EAAE,aAAa,GACzB,cAAc;IA6EjB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAgGvB;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IAwB/B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA+BhC;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAuB3B;;OAEG;IACH,OAAO,CAAC,aAAa;IAKrB;;OAEG;IACH,OAAO,CAAC,SAAS;IAKjB;;OAEG;IACH,OAAO,CAAC,cAAc;IAmBtB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAYtB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CAK1B"}
|