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,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EssentiaPitchDetector - Pitch detection using Essentia.js algorithms
|
|
3
|
+
*
|
|
4
|
+
* This module provides pitch detection using the Essentia.js WebAssembly library,
|
|
5
|
+
* offering 6 different algorithms including industry-standard options for
|
|
6
|
+
* polyphonic music (predominant_melodia) and neural network models (CREPE).
|
|
7
|
+
*
|
|
8
|
+
* ## Algorithm Categories
|
|
9
|
+
*
|
|
10
|
+
* ### Built-in WASM Algorithms (5 of 6)
|
|
11
|
+
* These are compiled directly into the essentia-wasm.wasm binary and require
|
|
12
|
+
* no external model files.
|
|
13
|
+
*
|
|
14
|
+
* | Algorithm | Best For | Returns Confidence? | Polyphonic? |
|
|
15
|
+
* |-----------|----------|-------------------|-------------|
|
|
16
|
+
* | `predominant_melodia` | Lead melody in polyphonic music **(Recommended)** | Yes | Single F0 |
|
|
17
|
+
* | `pitch_melodia` | Standard monophonic melody extraction | Yes | Single F0 |
|
|
18
|
+
* | `pitch_yin_probabilistic` | WASM-accelerated pYIN | Yes | Single F0 |
|
|
19
|
+
* | `multipitch_melodia` | Multiple simultaneous F0 contours | No | Multi F0 |
|
|
20
|
+
* | `multipitch_klapuri` | Harmonic summation multi-pitch | No | Multi F0 |
|
|
21
|
+
*
|
|
22
|
+
* ### External Model Algorithm (1 of 6)
|
|
23
|
+
* `pitch_crepe` - Neural network pitch detection using TensorFlow.js.
|
|
24
|
+
* Requires external TFJS model file loaded via `crepeModelUrl` config.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const detector = await EssentiaPitchDetector.create({
|
|
29
|
+
* algorithm: 'predominant_melodia',
|
|
30
|
+
* minFrequency: 80,
|
|
31
|
+
* maxFrequency: 20000,
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* const results = detector.detectSignal(audioSignal, 44100);
|
|
35
|
+
*
|
|
36
|
+
* for (const result of results) {
|
|
37
|
+
* if (result.isVoiced) {
|
|
38
|
+
* console.log(`${result.timestamp.toFixed(3)}s: ${result.noteName} (${result.frequency.toFixed(1)} Hz)`);
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
import type { PitchResult } from './PitchDetector.js';
|
|
44
|
+
/**
|
|
45
|
+
* Available Essentia pitch detection algorithms.
|
|
46
|
+
*
|
|
47
|
+
* Built-in WASM algorithms (no external model required):
|
|
48
|
+
* - `predominant_melodia`: Extracts the lead melody from polyphonic music (Recommended default)
|
|
49
|
+
* - `pitch_melodia`: Standard monophonic melody extraction
|
|
50
|
+
* - `pitch_yin_probabilistic`: WASM-accelerated pYIN (same algorithm as PitchDetector, C++ speed)
|
|
51
|
+
* - `multipitch_melodia`: Extracts multiple simultaneous F0 contours
|
|
52
|
+
* - `multipitch_klapuri`: Harmonic summation polyphonic pitch detection
|
|
53
|
+
*
|
|
54
|
+
* External model algorithm:
|
|
55
|
+
* - `pitch_crepe`: Neural network pitch detection using TensorFlow.js (requires crepeModelUrl)
|
|
56
|
+
*/
|
|
57
|
+
export type EssentiaPitchAlgorithm = 'predominant_melodia' | 'pitch_melodia' | 'pitch_yin_probabilistic' | 'multipitch_melodia' | 'multipitch_klapuri' | 'pitch_crepe';
|
|
58
|
+
/**
|
|
59
|
+
* Unified pitch detection algorithm selection.
|
|
60
|
+
*
|
|
61
|
+
* Includes the built-in pYIN detector (`pyin_legacy`) alongside all
|
|
62
|
+
* Essentia.js WASM algorithms. Used by `PitchBeatLinker` to select
|
|
63
|
+
* which pitch detection backend to use.
|
|
64
|
+
*
|
|
65
|
+
* @default 'pitch_melodia'
|
|
66
|
+
*/
|
|
67
|
+
export type PitchAlgorithm = 'pyin_legacy' | EssentiaPitchAlgorithm;
|
|
68
|
+
/**
|
|
69
|
+
* Configuration for the EssentiaPitchDetector.
|
|
70
|
+
*/
|
|
71
|
+
export interface EssentiaPitchDetectorConfig {
|
|
72
|
+
/**
|
|
73
|
+
* The pitch detection algorithm to use.
|
|
74
|
+
* @default 'pitch_melodia'
|
|
75
|
+
*/
|
|
76
|
+
algorithm: EssentiaPitchAlgorithm;
|
|
77
|
+
/**
|
|
78
|
+
* Minimum frequency to detect in Hz.
|
|
79
|
+
* @default 80
|
|
80
|
+
*/
|
|
81
|
+
minFrequency: number;
|
|
82
|
+
/**
|
|
83
|
+
* Maximum frequency to detect in Hz.
|
|
84
|
+
* @default 20000
|
|
85
|
+
*/
|
|
86
|
+
maxFrequency: number;
|
|
87
|
+
/**
|
|
88
|
+
* Frame size in samples for analysis.
|
|
89
|
+
* Essentia algorithms typically use 2048.
|
|
90
|
+
* @default 2048
|
|
91
|
+
*/
|
|
92
|
+
frameSize: number;
|
|
93
|
+
/**
|
|
94
|
+
* Hop size in samples between consecutive frames.
|
|
95
|
+
* Essentia prefers finer hop sizes (128) than pYIN's 512.
|
|
96
|
+
* @default 128
|
|
97
|
+
*/
|
|
98
|
+
hopSize: number;
|
|
99
|
+
/**
|
|
100
|
+
* Target sample rate for analysis.
|
|
101
|
+
* @default 44100
|
|
102
|
+
*/
|
|
103
|
+
targetSampleRate: number;
|
|
104
|
+
/**
|
|
105
|
+
* URL to the CREPE TensorFlow.js model.
|
|
106
|
+
* Only required when algorithm is 'pitch_crepe'.
|
|
107
|
+
* Omit to use DEFAULT_CREPE_MODEL_URL.
|
|
108
|
+
*/
|
|
109
|
+
crepeModelUrl?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Optional callback to resolve Arweave URLs before loading models.
|
|
112
|
+
* Used by the ArweaveGatewayManager to try alternate gateways on failure.
|
|
113
|
+
*/
|
|
114
|
+
resolveUrl?: (url: string) => Promise<string>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Default CREPE TensorFlow.js model URL.
|
|
118
|
+
*
|
|
119
|
+
* Used when `crepeModelUrl` is not explicitly provided and algorithm is 'pitch_crepe'.
|
|
120
|
+
* Update this constant when the model is deployed to Arweave.
|
|
121
|
+
*/
|
|
122
|
+
export declare const DEFAULT_CREPE_MODEL_URL = "https://arweave.net/_HoMwkbF0JUamTiVGWNnCCC5yDjcPry-ENhzN6Xn3U0/model.json";
|
|
123
|
+
/**
|
|
124
|
+
* Pitch Detector using Essentia.js algorithms
|
|
125
|
+
*
|
|
126
|
+
* Provides access to 6 different pitch detection algorithms from Essentia.js,
|
|
127
|
+
* including industry-standard options for polyphonic music and neural networks.
|
|
128
|
+
*
|
|
129
|
+
* Uses the same `PitchResult[]` output format as `PitchDetector` for drop-in
|
|
130
|
+
* compatibility with `PitchBeatLinker`.
|
|
131
|
+
*/
|
|
132
|
+
export declare class EssentiaPitchDetector {
|
|
133
|
+
private config;
|
|
134
|
+
/**
|
|
135
|
+
* Essentia WASM module reference for algorithm invocation
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
private essentiaWASM;
|
|
139
|
+
/**
|
|
140
|
+
* Essentia algorithms instance (EssentiaJS)
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
private algorithms;
|
|
144
|
+
/**
|
|
145
|
+
* CREPE TensorFlow.js model (loaded lazily when pitch_crepe algorithm is used)
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
private crepeModel;
|
|
149
|
+
/**
|
|
150
|
+
* Whether the WASM module has been initialized
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
private initialized;
|
|
154
|
+
/**
|
|
155
|
+
* Cache for resolved Arweave URLs.
|
|
156
|
+
* Avoids repeated gateway resolution calls for the same URL.
|
|
157
|
+
* @internal
|
|
158
|
+
*/
|
|
159
|
+
private resolvedUrlCache;
|
|
160
|
+
/**
|
|
161
|
+
* Private constructor - use static `create()` factory method instead.
|
|
162
|
+
*
|
|
163
|
+
* @param config - Detector configuration
|
|
164
|
+
*/
|
|
165
|
+
private constructor();
|
|
166
|
+
/**
|
|
167
|
+
* Create a new EssentiaPitchDetector instance.
|
|
168
|
+
*
|
|
169
|
+
* This factory method handles async WASM module loading.
|
|
170
|
+
*
|
|
171
|
+
* @param config - Configuration options (partial, defaults applied)
|
|
172
|
+
* @returns Promise resolving to initialized EssentiaPitchDetector
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```typescript
|
|
176
|
+
* const detector = await EssentiaPitchDetector.create({
|
|
177
|
+
* algorithm: 'predominant_melodia',
|
|
178
|
+
* });
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
static create(config?: Partial<EssentiaPitchDetectorConfig>): Promise<EssentiaPitchDetector>;
|
|
182
|
+
/**
|
|
183
|
+
* Get the current configuration.
|
|
184
|
+
*/
|
|
185
|
+
getConfig(): EssentiaPitchDetectorConfig;
|
|
186
|
+
/**
|
|
187
|
+
* Initialize the Essentia WASM module.
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
private initializeEssentia;
|
|
191
|
+
/**
|
|
192
|
+
* Load the CREPE TensorFlow.js model from a URL with retry and gateway fallback.
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
private loadCrepeModel;
|
|
196
|
+
/**
|
|
197
|
+
* Resolves a URL using the resolveUrl callback with caching.
|
|
198
|
+
* @internal
|
|
199
|
+
*/
|
|
200
|
+
private resolveUrlWithCache;
|
|
201
|
+
/**
|
|
202
|
+
* Detect pitch in an audio signal.
|
|
203
|
+
*
|
|
204
|
+
* Processes the signal using the configured Essentia algorithm and returns
|
|
205
|
+
* pitch estimates in the same format as `PitchDetector.detectSignal()`.
|
|
206
|
+
*
|
|
207
|
+
* @param signal - Mono audio signal as Float32Array
|
|
208
|
+
* @param sampleRate - Sample rate of the signal
|
|
209
|
+
* @returns Array of pitch results, one per analysis frame
|
|
210
|
+
*/
|
|
211
|
+
detectSignal(signal: Float32Array, sampleRate: number): PitchResult[];
|
|
212
|
+
/**
|
|
213
|
+
* PredominantPitchMelodia — extracts the lead melody from polyphonic music.
|
|
214
|
+
* Returns pitch + confidence per frame. Output 0 Hz for unvoiced frames.
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
private runPredominantMelodia;
|
|
218
|
+
/**
|
|
219
|
+
* PitchMelodia — standard monophonic melody extraction.
|
|
220
|
+
* Returns pitch + confidence per frame. Output 0 Hz for unvoiced frames.
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
private runPitchMelodia;
|
|
224
|
+
/**
|
|
225
|
+
* PitchYinProbabilistic — WASM-accelerated pYIN algorithm.
|
|
226
|
+
* Returns pitch + voicedProbabilities per frame. Negative pitch = unvoiced.
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
private runPitchYinProbabilistic;
|
|
230
|
+
/**
|
|
231
|
+
* MultiPitchMelodia — multiple simultaneous F0 contours via MELODIA.
|
|
232
|
+
* Returns 2D pitch array (vector of vectors). No confidence output.
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
private runMultiPitchMelodia;
|
|
236
|
+
/**
|
|
237
|
+
* MultiPitchKlapuri — harmonic summation multi-pitch detection.
|
|
238
|
+
* Returns 2D pitch array (vector of vectors). No confidence output.
|
|
239
|
+
* @internal
|
|
240
|
+
*/
|
|
241
|
+
private runMultiPitchKlapuri;
|
|
242
|
+
/**
|
|
243
|
+
* CREPE pitch detection via TensorFlow.js neural network.
|
|
244
|
+
*
|
|
245
|
+
* CREPE expects 16kHz audio input with 1024-sample frames.
|
|
246
|
+
* The model outputs a 360-bin pitch distribution (10 cents per bin,
|
|
247
|
+
* covering C1 ≈ 32.7 Hz to ~2093 Hz).
|
|
248
|
+
*
|
|
249
|
+
* The signal is resampled to 16kHz internally.
|
|
250
|
+
* @internal
|
|
251
|
+
*/
|
|
252
|
+
private runCrepe;
|
|
253
|
+
/**
|
|
254
|
+
* Map single-F0 algorithm output (pitch + confidence arrays) to PitchResult[].
|
|
255
|
+
* Voiced frames have freq > 0; unvoiced frames have freq == 0.
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
private mapSingleF0;
|
|
259
|
+
/**
|
|
260
|
+
* Map multi-pitch algorithm output (VectorVectorFloat) to PitchResult[].
|
|
261
|
+
* Uses the lowest detected frequency as primary pitch; stores others
|
|
262
|
+
* in alternativeHypotheses. Defaults probability to 1.0 (no confidence output).
|
|
263
|
+
* @internal
|
|
264
|
+
*/
|
|
265
|
+
private mapMultiPitch;
|
|
266
|
+
/**
|
|
267
|
+
* Resample a signal from one sample rate to another using linear interpolation.
|
|
268
|
+
* @internal
|
|
269
|
+
*/
|
|
270
|
+
private resampleSignal;
|
|
271
|
+
/**
|
|
272
|
+
* Convert frequency in Hz to MIDI note number.
|
|
273
|
+
* @internal
|
|
274
|
+
*/
|
|
275
|
+
private frequencyToMidi;
|
|
276
|
+
/**
|
|
277
|
+
* Convert MIDI note number to note name (e.g., "C4", "F#5").
|
|
278
|
+
* @internal
|
|
279
|
+
*/
|
|
280
|
+
private midiToNoteName;
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=EssentiaPitchDetector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EssentiaPitchDetector.d.ts","sourceRoot":"","sources":["../../../src/core/analysis/EssentiaPitchDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyC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BAAqB,CAAC;IAqBjC;;OAEG;IACH,SAAS,IAAI,2BAA2B;IAIxC;;;OAGG;YACW,kBAAkB;IAehC;;;OAGG;YACW,cAAc;IAmC5B;;;OAGG;YACW,mBAAmB;IA2BjC;;;;;;;;;OASG;IACH,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,EAAE;IA+BrE;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAiC7B;;;;OAIG;IACH,OAAO,CAAC,eAAe;IA+BvB;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IA+ChC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IA2B5B;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAwB5B;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ;IA4FhB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IA+BnB;;;;;OAKG;IAEH,OAAO,CAAC,aAAa;IAkDrB;;;OAGG;IACH,OAAO,CAAC,cAAc;IA0BtB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAIvB;;;OAGG;IACH,OAAO,CAAC,cAAc;CAKzB"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Level Serializer - Converts GeneratedLevel to/from export formats
|
|
3
|
+
*
|
|
4
|
+
* This class provides serialization and deserialization for procedurally
|
|
5
|
+
* generated rhythm game levels. It converts between the engine's internal
|
|
6
|
+
* GeneratedLevel format and the FullBeatMapExportData format that is
|
|
7
|
+
* compatible with the playlist-data-showcase app.
|
|
8
|
+
*
|
|
9
|
+
* Part of the Pitch Detection & Button Mapping pipeline - Phase 4.2.2
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Export a generated level
|
|
14
|
+
* const exportData = LevelSerializer.toExportData(generatedLevel);
|
|
15
|
+
* const json = LevelSerializer.toJSON(generatedLevel);
|
|
16
|
+
*
|
|
17
|
+
* // Import a level
|
|
18
|
+
* const level = LevelSerializer.fromJSON(json);
|
|
19
|
+
* const level2 = LevelSerializer.fromExportData(exportData);
|
|
20
|
+
*
|
|
21
|
+
* // Validate before import
|
|
22
|
+
* const result = LevelSerializer.validate(unknownData);
|
|
23
|
+
* if (result.success) {
|
|
24
|
+
* const level = LevelSerializer.fromExportData(result.data!);
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
import type { GeneratedLevel } from '../generation/LevelGenerator.js';
|
|
29
|
+
import type { FullBeatMapExportData, FullBeatMapImportResult, TrackReference, LevelPackExport } from '../types/LevelExport.js';
|
|
30
|
+
/**
|
|
31
|
+
* Options for serialization
|
|
32
|
+
*/
|
|
33
|
+
export interface LevelSerializerOptions {
|
|
34
|
+
/** Include audio title in export (default: false) */
|
|
35
|
+
includeAudioTitle?: boolean;
|
|
36
|
+
/** Audio title to include */
|
|
37
|
+
audioTitle?: string;
|
|
38
|
+
/** Track reference identifying the song this level was built for */
|
|
39
|
+
trackReference?: TrackReference;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Serializer for rhythm game levels
|
|
43
|
+
*
|
|
44
|
+
* Converts between GeneratedLevel (engine internal) and FullBeatMapExportData
|
|
45
|
+
* (export format compatible with playlist-data-showcase app).
|
|
46
|
+
*
|
|
47
|
+
* All methods are static - this is a utility class without state.
|
|
48
|
+
*/
|
|
49
|
+
export declare class LevelSerializer {
|
|
50
|
+
/**
|
|
51
|
+
* Convert a GeneratedLevel to FullBeatMapExportData format
|
|
52
|
+
*
|
|
53
|
+
* @param level - The generated level to export
|
|
54
|
+
* @param options - Optional serialization options
|
|
55
|
+
* @returns The export data ready for JSON serialization
|
|
56
|
+
*/
|
|
57
|
+
static toExportData(level: GeneratedLevel, options?: LevelSerializerOptions): FullBeatMapExportData;
|
|
58
|
+
/**
|
|
59
|
+
* Build detected beats array from chart
|
|
60
|
+
*/
|
|
61
|
+
private static buildDetectedBeats;
|
|
62
|
+
/**
|
|
63
|
+
* Build merged beats array from chart
|
|
64
|
+
*/
|
|
65
|
+
private static buildMergedBeats;
|
|
66
|
+
/**
|
|
67
|
+
* Build interpolated metadata from chart
|
|
68
|
+
*/
|
|
69
|
+
private static buildInterpolatedMetadata;
|
|
70
|
+
/**
|
|
71
|
+
* Build subdivision data from chart
|
|
72
|
+
*/
|
|
73
|
+
private static buildSubdivisionData;
|
|
74
|
+
/**
|
|
75
|
+
* Convert a ChartedBeat to export format
|
|
76
|
+
*/
|
|
77
|
+
private static chartedBeatToExportBeat;
|
|
78
|
+
/**
|
|
79
|
+
* Build chart export data from metadata
|
|
80
|
+
*
|
|
81
|
+
* Returns null if there are no key assignments (chart is null case)
|
|
82
|
+
*/
|
|
83
|
+
private static buildChartExportData;
|
|
84
|
+
/**
|
|
85
|
+
* Build procedural generation metadata
|
|
86
|
+
*/
|
|
87
|
+
private static buildGenerationMetadata;
|
|
88
|
+
/**
|
|
89
|
+
* Convert FullBeatMapExportData to GeneratedLevel
|
|
90
|
+
*
|
|
91
|
+
* Note: The import creates a minimal but functional GeneratedLevel.
|
|
92
|
+
* Some data (like original rhythm analysis) cannot be fully reconstructed
|
|
93
|
+
* from the export format.
|
|
94
|
+
*
|
|
95
|
+
* @param data - The export data to import
|
|
96
|
+
* @returns The reconstructed GeneratedLevel
|
|
97
|
+
*/
|
|
98
|
+
static fromExportData(data: FullBeatMapExportData): GeneratedLevel;
|
|
99
|
+
/**
|
|
100
|
+
* Reconstruct ChartedBeatMap from export data
|
|
101
|
+
*
|
|
102
|
+
* Handles two cases:
|
|
103
|
+
* 1. Normal case: subdivision data exists, use it for beats
|
|
104
|
+
* 2. Edge case: subdivision is null, create beats from mergedBeats (interpolated only)
|
|
105
|
+
*/
|
|
106
|
+
private static reconstructChart;
|
|
107
|
+
/**
|
|
108
|
+
* Reconstruct ChartedBeatMap from mergedBeats when subdivision is null
|
|
109
|
+
*
|
|
110
|
+
* This handles the edge case where a level has only interpolated beats
|
|
111
|
+
* without any subdivision applied. We create ChartedBeats from mergedBeats.
|
|
112
|
+
*/
|
|
113
|
+
private static reconstructChartFromMergedBeats;
|
|
114
|
+
/**
|
|
115
|
+
* Reconstruct downbeat config from beats (using segments format)
|
|
116
|
+
*/
|
|
117
|
+
private static reconstructDownbeatConfig;
|
|
118
|
+
/**
|
|
119
|
+
* Reconstruct chart metadata from export data
|
|
120
|
+
*/
|
|
121
|
+
private static reconstructChartMetadata;
|
|
122
|
+
/**
|
|
123
|
+
* Parse difficulty level from string
|
|
124
|
+
*/
|
|
125
|
+
private static parseDifficultyLevel;
|
|
126
|
+
/**
|
|
127
|
+
* Parse difficulty preset from string
|
|
128
|
+
*/
|
|
129
|
+
private static parseDifficultyPreset;
|
|
130
|
+
/**
|
|
131
|
+
* Reconstruct difficulty variant from export data
|
|
132
|
+
*/
|
|
133
|
+
private static reconstructVariant;
|
|
134
|
+
/**
|
|
135
|
+
* Convert SubdivisionType to GridType
|
|
136
|
+
*/
|
|
137
|
+
private static subdivisionTypeToGridType;
|
|
138
|
+
/**
|
|
139
|
+
* Reconstruct minimal GeneratedRhythm from export data
|
|
140
|
+
*/
|
|
141
|
+
private static reconstructRhythm;
|
|
142
|
+
/**
|
|
143
|
+
* Build full RhythmMetadata for reconstructed rhythm
|
|
144
|
+
*/
|
|
145
|
+
private static buildFullRhythmMetadata;
|
|
146
|
+
/**
|
|
147
|
+
* Build minimal MelodyContour
|
|
148
|
+
*/
|
|
149
|
+
private static buildMinimalMelodyContour;
|
|
150
|
+
/**
|
|
151
|
+
* Reconstruct pitch analysis from export data
|
|
152
|
+
*/
|
|
153
|
+
private static reconstructPitchAnalysis;
|
|
154
|
+
/**
|
|
155
|
+
* Reconstruct level metadata from export data
|
|
156
|
+
*/
|
|
157
|
+
private static reconstructMetadata;
|
|
158
|
+
/**
|
|
159
|
+
* Serialize a GeneratedLevel to JSON string
|
|
160
|
+
*
|
|
161
|
+
* @param level - The level to serialize
|
|
162
|
+
* @param options - Optional serialization options
|
|
163
|
+
* @returns JSON string
|
|
164
|
+
*/
|
|
165
|
+
static toJSON(level: GeneratedLevel, options?: LevelSerializerOptions): string;
|
|
166
|
+
/**
|
|
167
|
+
* Deserialize a GeneratedLevel from JSON string
|
|
168
|
+
*
|
|
169
|
+
* @param json - The JSON string to parse
|
|
170
|
+
* @returns The deserialized GeneratedLevel
|
|
171
|
+
* @throws {Error} If the JSON is invalid or doesn't match expected format
|
|
172
|
+
*/
|
|
173
|
+
static fromJSON(json: string): GeneratedLevel;
|
|
174
|
+
/**
|
|
175
|
+
* Save a GeneratedLevel to a file (Node.js only)
|
|
176
|
+
*
|
|
177
|
+
* @param level - The level to save
|
|
178
|
+
* @param filePath - Path to save the file
|
|
179
|
+
* @param options - Optional serialization options
|
|
180
|
+
* @throws {Error} If file cannot be written
|
|
181
|
+
*/
|
|
182
|
+
static saveToFile(level: GeneratedLevel, filePath: string, options?: LevelSerializerOptions): Promise<void>;
|
|
183
|
+
/**
|
|
184
|
+
* Load a GeneratedLevel from a file (Node.js only)
|
|
185
|
+
*
|
|
186
|
+
* @param filePath - Path to load the file from
|
|
187
|
+
* @returns The loaded GeneratedLevel
|
|
188
|
+
* @throws {Error} If file cannot be read or parsed
|
|
189
|
+
*/
|
|
190
|
+
static loadFromFile(filePath: string): Promise<GeneratedLevel>;
|
|
191
|
+
/**
|
|
192
|
+
* Validate unknown data as FullBeatMapExportData
|
|
193
|
+
*
|
|
194
|
+
* @param data - Unknown data to validate
|
|
195
|
+
* @returns Validation result with data if successful
|
|
196
|
+
*/
|
|
197
|
+
static validate(data: unknown): FullBeatMapImportResult;
|
|
198
|
+
/**
|
|
199
|
+
* Serialize multiple difficulty levels into a LevelPackExport.
|
|
200
|
+
*
|
|
201
|
+
* Each difficulty is independently serialized as a FullBeatMapExportData.
|
|
202
|
+
* The pack-level trackReference is shared across all difficulties.
|
|
203
|
+
*
|
|
204
|
+
* @param levels - Map of difficulty key to GeneratedLevel
|
|
205
|
+
* @param options - Serialization options (trackReference applied at pack level)
|
|
206
|
+
* @returns The level pack ready for JSON serialization
|
|
207
|
+
*/
|
|
208
|
+
static toPack(levels: {
|
|
209
|
+
natural?: GeneratedLevel;
|
|
210
|
+
easy?: GeneratedLevel;
|
|
211
|
+
medium?: GeneratedLevel;
|
|
212
|
+
hard?: GeneratedLevel;
|
|
213
|
+
custom?: GeneratedLevel;
|
|
214
|
+
}, options?: LevelSerializerOptions): LevelPackExport;
|
|
215
|
+
/**
|
|
216
|
+
* Deserialize a LevelPackExport into individual GeneratedLevels.
|
|
217
|
+
*
|
|
218
|
+
* @param pack - The level pack to deserialize
|
|
219
|
+
* @returns Map of difficulty key to GeneratedLevel (only entries that existed in the pack)
|
|
220
|
+
*/
|
|
221
|
+
static fromPack(pack: LevelPackExport): {
|
|
222
|
+
natural?: GeneratedLevel;
|
|
223
|
+
easy?: GeneratedLevel;
|
|
224
|
+
medium?: GeneratedLevel;
|
|
225
|
+
hard?: GeneratedLevel;
|
|
226
|
+
custom?: GeneratedLevel;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Convert a LevelPackExport to JSON string.
|
|
230
|
+
*/
|
|
231
|
+
static packToJSON(levels: {
|
|
232
|
+
natural?: GeneratedLevel;
|
|
233
|
+
easy?: GeneratedLevel;
|
|
234
|
+
medium?: GeneratedLevel;
|
|
235
|
+
hard?: GeneratedLevel;
|
|
236
|
+
custom?: GeneratedLevel;
|
|
237
|
+
}, options?: LevelSerializerOptions): string;
|
|
238
|
+
/**
|
|
239
|
+
* Parse a JSON string as a LevelPackExport and return the GeneratedLevels.
|
|
240
|
+
*
|
|
241
|
+
* @throws {Error} If the JSON is invalid or doesn't match the pack format
|
|
242
|
+
*/
|
|
243
|
+
static packFromJSON(json: string): {
|
|
244
|
+
natural?: GeneratedLevel;
|
|
245
|
+
easy?: GeneratedLevel;
|
|
246
|
+
medium?: GeneratedLevel;
|
|
247
|
+
hard?: GeneratedLevel;
|
|
248
|
+
custom?: GeneratedLevel;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Check if data represents a procedurally generated level
|
|
252
|
+
*
|
|
253
|
+
* @param data - Export data to check
|
|
254
|
+
* @returns True if the level was procedurally generated
|
|
255
|
+
*/
|
|
256
|
+
static isProcedural(data: FullBeatMapExportData): boolean;
|
|
257
|
+
/**
|
|
258
|
+
* Get a summary of the level for display purposes
|
|
259
|
+
*
|
|
260
|
+
* @param data - Export data to summarize
|
|
261
|
+
* @returns Human-readable summary
|
|
262
|
+
*/
|
|
263
|
+
static getSummary(data: FullBeatMapExportData): string;
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=LevelSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LevelSerializer.d.ts","sourceRoot":"","sources":["../../../src/core/analysis/LevelSerializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iCAAiC,CAAC;AAErF,OAAO,KAAK,EACR,qBAAqB,EAUrB,uBAAuB,EACvB,cAAc,EACd,eAAe,EAClB,MAAM,yBAAyB,CAAC;AAiBjC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC;AAMD;;;;;;;GAOG;AACH,qBAAa,eAAe;IAKxB;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,GAAE,sBAA2B,GAAG,qBAAqB;IAyCvG;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAsBjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAgB/B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAaxC;;OAEG;IACH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