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,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Level Generator - Orchestrates complete rhythm game level generation
|
|
3
|
+
*
|
|
4
|
+
* This is the main entry point for generating playable rhythm game levels from audio.
|
|
5
|
+
* It orchestrates all phases of the pipeline:
|
|
6
|
+
*
|
|
7
|
+
* Phase 1: Rhythm generation (from procedural-rhythm-generation.md)
|
|
8
|
+
* Phase 2: Pitch analysis (if pitchInfluenceWeight > 0)
|
|
9
|
+
* Phase 3: Button mapping (from pitch-detection-button-mapping.md)
|
|
10
|
+
* Phase 4: Conversion to ChartedBeatMap
|
|
11
|
+
*
|
|
12
|
+
* Part of the Pitch Detection & Button Mapping pipeline - Phase 3.1
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const generator = new LevelGenerator({
|
|
17
|
+
* difficulty: 'medium',
|
|
18
|
+
* controllerMode: 'ddr',
|
|
19
|
+
* buttons: { pitchInfluenceWeight: 08 },
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* // Generate level from audio
|
|
23
|
+
* const level = await generator.generate(audioBuffer, unifiedBeatMap);
|
|
24
|
+
*
|
|
25
|
+
* // Use the chart with BeatStream
|
|
26
|
+
* const beatStream = new BeatStream(level.chart, audioContext);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
import type { RhythmGenerationOptions, GeneratedRhythm, RhythmMetadata } from './RhythmGenerator.js';
|
|
30
|
+
import type { PitchAlgorithm } from '../analysis/EssentiaPitchDetector.js';
|
|
31
|
+
import type { MelodyContourAnalysisResult } from '../analysis/MelodyContourAnalyzer.js';
|
|
32
|
+
import type { ButtonMappingMetadata } from './ButtonMapper.js';
|
|
33
|
+
import type { ButtonMappingConfig, ControllerMode } from '../types/ButtonMapping.js';
|
|
34
|
+
import type { DifficultyPreset } from '../types/BeatMap.js';
|
|
35
|
+
import type { UnifiedBeatMap } from '../types/BeatMap.js';
|
|
36
|
+
import type { ChartedBeatMap } from '../types/ChartedBeatMap.js';
|
|
37
|
+
import { type DifficultyVariant, type DensityGenerationConfig } from '../analysis/beat/DifficultyVariantGenerator.js';
|
|
38
|
+
/**
|
|
39
|
+
* Options for level generation
|
|
40
|
+
*/
|
|
41
|
+
export interface LevelGenerationOptions {
|
|
42
|
+
/** Target difficulty for the generated chart */
|
|
43
|
+
difficulty: DifficultyPreset;
|
|
44
|
+
/** Controller mode (DDR or Guitar Hero) */
|
|
45
|
+
controllerMode: ControllerMode;
|
|
46
|
+
/** Rhythm generation settings (passed through to RhythmGenerator) */
|
|
47
|
+
rhythm?: Partial<RhythmGenerationOptions>;
|
|
48
|
+
/** Button mapping settings */
|
|
49
|
+
buttons?: Partial<ButtonMappingConfig>;
|
|
50
|
+
/** Seed for reproducibility */
|
|
51
|
+
seed?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Pre-generated rhythm to use instead of generating new.
|
|
54
|
+
* When provided, skips the rhythm generation phase entirely.
|
|
55
|
+
* Useful for reusing rhythm from a previous generation step.
|
|
56
|
+
*/
|
|
57
|
+
cachedRhythm?: GeneratedRhythm;
|
|
58
|
+
/** Which pitch detection algorithm to use. 'pyin_legacy' uses built-in pYIN; others use Essentia.js. (default: 'pitch_melodia') */
|
|
59
|
+
pitchAlgorithm?: PitchAlgorithm;
|
|
60
|
+
/** URL to the CREPE TFJS model (only required when pitchAlgorithm is 'pitch_crepe') */
|
|
61
|
+
crepeModelUrl?: string;
|
|
62
|
+
/** Optional callback to resolve Arweave URLs (gateway fallback for CREPE model) */
|
|
63
|
+
resolveUrl?: (url: string) => Promise<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Probability threshold for voiced/unvoiced decision in pitch detection.
|
|
66
|
+
* Higher values require stronger pitch signal to be considered "voiced".
|
|
67
|
+
* Passed through to PitchDetectorConfig.
|
|
68
|
+
*
|
|
69
|
+
* @default 0.2
|
|
70
|
+
*/
|
|
71
|
+
voicingThreshold?: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Metadata about the generated level
|
|
75
|
+
*/
|
|
76
|
+
export interface LevelMetadata {
|
|
77
|
+
/** Difficulty preset used */
|
|
78
|
+
difficulty: DifficultyPreset;
|
|
79
|
+
/** Controller mode used */
|
|
80
|
+
controllerMode: ControllerMode;
|
|
81
|
+
/** Rhythm generation metadata */
|
|
82
|
+
rhythmMetadata: RhythmMetadata;
|
|
83
|
+
/** Button mapping metadata */
|
|
84
|
+
buttonMetadata: ButtonMappingMetadata;
|
|
85
|
+
/** Pitch analysis metadata (if pitch detection was used) */
|
|
86
|
+
pitchMetadata: {
|
|
87
|
+
melodyRange: {
|
|
88
|
+
min: string;
|
|
89
|
+
max: string;
|
|
90
|
+
} | null;
|
|
91
|
+
directionStats: {
|
|
92
|
+
up: number;
|
|
93
|
+
down: number;
|
|
94
|
+
stable: number;
|
|
95
|
+
none: number;
|
|
96
|
+
} | null;
|
|
97
|
+
intervalStats: {
|
|
98
|
+
unison: number;
|
|
99
|
+
small: number;
|
|
100
|
+
medium: number;
|
|
101
|
+
large: number;
|
|
102
|
+
very_large: number;
|
|
103
|
+
} | null;
|
|
104
|
+
} | null;
|
|
105
|
+
/** Chart metadata */
|
|
106
|
+
chartMetadata: {
|
|
107
|
+
totalBeats: number;
|
|
108
|
+
detectedBeats: number;
|
|
109
|
+
generatedBeats: number;
|
|
110
|
+
};
|
|
111
|
+
/** Generation configuration */
|
|
112
|
+
generationConfig: LevelGenerationOptions;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Complete generated level ready for gameplay
|
|
116
|
+
*/
|
|
117
|
+
export interface GeneratedLevel {
|
|
118
|
+
/** The playable ChartedBeatMap */
|
|
119
|
+
chart: ChartedBeatMap;
|
|
120
|
+
/** The selected difficulty variant with keys assigned */
|
|
121
|
+
variant: DifficultyVariant;
|
|
122
|
+
/** Original rhythm generation output preserved */
|
|
123
|
+
rhythm: GeneratedRhythm;
|
|
124
|
+
/** Pitch analysis results (null if pitchInfluenceWeight was 0) */
|
|
125
|
+
pitchAnalysis: MelodyContourAnalysisResult | null;
|
|
126
|
+
/** Combined metadata */
|
|
127
|
+
metadata: LevelMetadata;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Progress callback for generation progress updates
|
|
131
|
+
*/
|
|
132
|
+
export type LevelProgressCallback = (progress: LevelGenerationProgress) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Progress information during level generation
|
|
135
|
+
*/
|
|
136
|
+
export interface LevelGenerationProgress {
|
|
137
|
+
/** Current stage of generation */
|
|
138
|
+
stage: 'rhythm' | 'pitch' | 'buttons' | 'conversion' | 'finalizing';
|
|
139
|
+
/** Progress within current stage (0-1) */
|
|
140
|
+
progress: number;
|
|
141
|
+
/** Human-readable status message */
|
|
142
|
+
message: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Result of level generation for all difficulties
|
|
146
|
+
*/
|
|
147
|
+
export interface AllDifficultiesResult {
|
|
148
|
+
easy: GeneratedLevel;
|
|
149
|
+
medium: GeneratedLevel;
|
|
150
|
+
hard: GeneratedLevel;
|
|
151
|
+
natural?: GeneratedLevel;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Cache phase identifier
|
|
155
|
+
*/
|
|
156
|
+
export type LevelCachePhase = 'rhythm' | 'pitch';
|
|
157
|
+
/**
|
|
158
|
+
* Statistics about the cache
|
|
159
|
+
*/
|
|
160
|
+
export interface LevelCacheStats {
|
|
161
|
+
/** Number of entries currently cached */
|
|
162
|
+
entryCount: number;
|
|
163
|
+
/** Phases that have cached results */
|
|
164
|
+
cachedPhases: LevelCachePhase[];
|
|
165
|
+
/** Number of cache hits during this session */
|
|
166
|
+
hits: number;
|
|
167
|
+
/** Number of cache misses during this session */
|
|
168
|
+
misses: number;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Extended options for level generation with cache settings
|
|
172
|
+
*/
|
|
173
|
+
export interface LevelGenerationOptionsWithCache extends LevelGenerationOptions {
|
|
174
|
+
/** Enable caching of intermediate results (default: true) */
|
|
175
|
+
enableCache?: boolean;
|
|
176
|
+
/** Maximum age of cache entries in milliseconds (default: 30 minutes) */
|
|
177
|
+
cacheMaxAge?: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Level Generator
|
|
181
|
+
*
|
|
182
|
+
* Orchestrates the complete rhythm game level generation pipeline.
|
|
183
|
+
* Takes audio input and produces playable ChartedBeatMap output.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* // With caching enabled (default)
|
|
188
|
+
* const generator = new LevelGenerator({
|
|
189
|
+
* difficulty: 'medium',
|
|
190
|
+
* controllerMode: 'ddr',
|
|
191
|
+
* enableCache: true,
|
|
192
|
+
* });
|
|
193
|
+
*
|
|
194
|
+
* // First call computes and caches rhythm/pitch
|
|
195
|
+
* const level1 = await generator.generate(audioBuffer, beatMap);
|
|
196
|
+
*
|
|
197
|
+
* // Second call reuses cached results (much faster)
|
|
198
|
+
* const level2 = await generator.generate(audioBuffer, beatMap);
|
|
199
|
+
*
|
|
200
|
+
* // Clear cache when done with this audio
|
|
201
|
+
* generator.clearCache();
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
export declare class LevelGenerator {
|
|
205
|
+
private options;
|
|
206
|
+
private buttonConfig;
|
|
207
|
+
private cache;
|
|
208
|
+
private cacheHits;
|
|
209
|
+
private cacheMisses;
|
|
210
|
+
/**
|
|
211
|
+
* Create a new LevelGenerator
|
|
212
|
+
*
|
|
213
|
+
* @param options - Generation options (partial, defaults applied)
|
|
214
|
+
*/
|
|
215
|
+
constructor(options?: Partial<LevelGenerationOptionsWithCache>);
|
|
216
|
+
/**
|
|
217
|
+
* Get the current configuration
|
|
218
|
+
*/
|
|
219
|
+
getOptions(): LevelGenerationOptionsWithCache;
|
|
220
|
+
/**
|
|
221
|
+
* Generate a cache key for a specific phase and inputs
|
|
222
|
+
*/
|
|
223
|
+
private generateCacheKey;
|
|
224
|
+
/**
|
|
225
|
+
* Create a config fingerprint for cache invalidation
|
|
226
|
+
* Only includes config options that affect the output
|
|
227
|
+
*/
|
|
228
|
+
private createConfigFingerprint;
|
|
229
|
+
/**
|
|
230
|
+
* Get a cached result if available and not expired
|
|
231
|
+
*/
|
|
232
|
+
private getFromCache;
|
|
233
|
+
/**
|
|
234
|
+
* Store a result in the cache
|
|
235
|
+
*/
|
|
236
|
+
private setCache;
|
|
237
|
+
/**
|
|
238
|
+
* Clear all cached results
|
|
239
|
+
*/
|
|
240
|
+
clearCache(): void;
|
|
241
|
+
/**
|
|
242
|
+
* Clear expired cache entries
|
|
243
|
+
*/
|
|
244
|
+
pruneExpiredCache(): void;
|
|
245
|
+
/**
|
|
246
|
+
* Get cache statistics
|
|
247
|
+
*/
|
|
248
|
+
getCacheStats(): LevelCacheStats;
|
|
249
|
+
/**
|
|
250
|
+
* Check if a phase result is cached for the given audio ID
|
|
251
|
+
*/
|
|
252
|
+
isCached(audioId: string, phase: LevelCachePhase): boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Get the cache hit ratio (0-1)
|
|
255
|
+
*/
|
|
256
|
+
getCacheHitRatio(): number;
|
|
257
|
+
/**
|
|
258
|
+
* Generate a level for a specific difficulty
|
|
259
|
+
*
|
|
260
|
+
* @param audioBuffer - Web Audio API AudioBuffer to analyze
|
|
261
|
+
* @param unifiedBeatMap - The unified beat map for measure/beat info
|
|
262
|
+
* @param progressCallback - Optional callback for progress updates
|
|
263
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
264
|
+
* @returns Generated level with playable chart
|
|
265
|
+
* @throws {DOMException} If the operation is cancelled via signal
|
|
266
|
+
*/
|
|
267
|
+
generate(audioBuffer: AudioBuffer, unifiedBeatMap: UnifiedBeatMap, progressCallback?: LevelProgressCallback, signal?: AbortSignal): Promise<GeneratedLevel>;
|
|
268
|
+
/**
|
|
269
|
+
* Generate levels for all difficulties
|
|
270
|
+
*
|
|
271
|
+
* This method efficiently reuses cached rhythm and pitch analysis results
|
|
272
|
+
* across all difficulty levels.
|
|
273
|
+
*
|
|
274
|
+
* @param audioBuffer - Web Audio API AudioBuffer to analyze
|
|
275
|
+
* @param unifiedBeatMap - The unified beat map for measure/beat info
|
|
276
|
+
* @param progressCallback - Optional callback for progress updates
|
|
277
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
278
|
+
* @returns Generated levels for easy, medium, and hard
|
|
279
|
+
* @throws {DOMException} If the operation is cancelled via signal
|
|
280
|
+
*/
|
|
281
|
+
generateAllDifficulties(audioBuffer: AudioBuffer, unifiedBeatMap: UnifiedBeatMap, progressCallback?: LevelProgressCallback, signal?: AbortSignal): Promise<AllDifficultiesResult>;
|
|
282
|
+
/**
|
|
283
|
+
* Generate a level at a specific target density
|
|
284
|
+
*
|
|
285
|
+
* This method provides fine-grained control over difficulty by allowing
|
|
286
|
+
* independent specification of target density (notes/second) and maximum
|
|
287
|
+
* quantization grid. Unlike the preset-based `generate()` method, this
|
|
288
|
+
* enables a continuous spectrum of difficulty.
|
|
289
|
+
*
|
|
290
|
+
* @param audioBuffer - Web Audio API AudioBuffer to analyze
|
|
291
|
+
* @param unifiedBeatMap - The unified beat map for measure/beat info
|
|
292
|
+
* @param config - Density generation configuration
|
|
293
|
+
* @param progressCallback - Optional callback for progress updates
|
|
294
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
295
|
+
* @returns Generated level with playable chart
|
|
296
|
+
* @throws {DOMException} If the operation is cancelled via signal
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```typescript
|
|
300
|
+
* const generator = new LevelGenerator({
|
|
301
|
+
* controllerMode: 'ddr',
|
|
302
|
+
* buttons: { pitchInfluenceWeight: 0.8 },
|
|
303
|
+
* });
|
|
304
|
+
*
|
|
305
|
+
* // Dense chart with only 8th note quantization
|
|
306
|
+
* const denseLevel = await generator.generateAtDensity(
|
|
307
|
+
* audioBuffer,
|
|
308
|
+
* beatMap,
|
|
309
|
+
* { targetDensity: 3.0, maxGridType: 'straight_8th' }
|
|
310
|
+
* );
|
|
311
|
+
*
|
|
312
|
+
* // Sparse chart with 16th note grid allowed
|
|
313
|
+
* const sparseLevel = await generator.generateAtDensity(
|
|
314
|
+
* audioBuffer,
|
|
315
|
+
* beatMap,
|
|
316
|
+
* { targetDensity: 0.5, maxGridType: 'straight_16th' }
|
|
317
|
+
* );
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
generateAtDensity(audioBuffer: AudioBuffer, unifiedBeatMap: UnifiedBeatMap, config: DensityGenerationConfig, progressCallback?: LevelProgressCallback, signal?: AbortSignal): Promise<GeneratedLevel>;
|
|
321
|
+
/**
|
|
322
|
+
* Generate levels for multiple density configurations in one call
|
|
323
|
+
*
|
|
324
|
+
* This method efficiently reuses cached rhythm and pitch analysis results
|
|
325
|
+
* across all density configurations, similar to how `generateAllDifficulties()`
|
|
326
|
+
* works for preset difficulties.
|
|
327
|
+
*
|
|
328
|
+
* @param audioBuffer - Web Audio API AudioBuffer to analyze
|
|
329
|
+
* @param unifiedBeatMap - The unified beat map for measure/beat info
|
|
330
|
+
* @param configs - Array of labeled density configurations
|
|
331
|
+
* @param progressCallback - Optional callback for progress updates
|
|
332
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
333
|
+
* @returns Map of labels to generated levels
|
|
334
|
+
* @throws {DOMException} If the operation is cancelled via signal
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```typescript
|
|
338
|
+
* const generator = new LevelGenerator({
|
|
339
|
+
* controllerMode: 'ddr',
|
|
340
|
+
* buttons: { pitchInfluenceWeight: 0.8 },
|
|
341
|
+
* });
|
|
342
|
+
*
|
|
343
|
+
* const levels = await generator.generateAtDensities(
|
|
344
|
+
* audioBuffer,
|
|
345
|
+
* beatMap,
|
|
346
|
+
* [
|
|
347
|
+
* { label: 'sparse', config: { targetDensity: 0.5, maxGridType: 'straight_8th' } },
|
|
348
|
+
* { label: 'medium', config: { targetDensity: 2.0, maxGridType: 'straight_16th' } },
|
|
349
|
+
* { label: 'dense', config: { targetDensity: 3.5, maxGridType: 'straight_16th' } },
|
|
350
|
+
* ]
|
|
351
|
+
* );
|
|
352
|
+
*
|
|
353
|
+
* const sparseLevel = levels.get('sparse');
|
|
354
|
+
* const denseLevel = levels.get('dense');
|
|
355
|
+
* ```
|
|
356
|
+
*/
|
|
357
|
+
generateAtDensities(audioBuffer: AudioBuffer, unifiedBeatMap: UnifiedBeatMap, configs: {
|
|
358
|
+
label: string;
|
|
359
|
+
config: DensityGenerationConfig;
|
|
360
|
+
}[], progressCallback?: LevelProgressCallback, signal?: AbortSignal): Promise<Map<string, GeneratedLevel>>;
|
|
361
|
+
/**
|
|
362
|
+
* Collect grid decisions from quantization result
|
|
363
|
+
*
|
|
364
|
+
* Merges grid decisions from all bands into a single map.
|
|
365
|
+
* When multiple bands have decisions for the same beat index,
|
|
366
|
+
* the decision with higher confidence is used.
|
|
367
|
+
*/
|
|
368
|
+
private collectGridDecisions;
|
|
369
|
+
/**
|
|
370
|
+
* Phase 1: Generate rhythm from audio
|
|
371
|
+
*/
|
|
372
|
+
private generateRhythm;
|
|
373
|
+
/**
|
|
374
|
+
* Phase 2: Analyze pitch on rhythm beats
|
|
375
|
+
*/
|
|
376
|
+
private analyzePitch;
|
|
377
|
+
/**
|
|
378
|
+
* Phase 3: Map buttons to beats
|
|
379
|
+
*/
|
|
380
|
+
private mapButtons;
|
|
381
|
+
/**
|
|
382
|
+
* Phase 4: Convert to ChartedBeatMap
|
|
383
|
+
*/
|
|
384
|
+
private convertToChart;
|
|
385
|
+
/**
|
|
386
|
+
* Build the final GeneratedLevel result
|
|
387
|
+
*/
|
|
388
|
+
private buildLevel;
|
|
389
|
+
}
|
|
390
|
+
//# sourceMappingURL=LevelGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LevelGenerator.d.ts","sourceRoot":"","sources":["../../../src/core/generation/LevelGenerator.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { PlaylistTrack } from '../types/Playlist';
|
|
2
|
+
import type { AudioProfile } from '../types/AudioProfile';
|
|
3
|
+
import type { Class } from '../types/Character';
|
|
4
|
+
/**
|
|
5
|
+
* Generate RPG-style character names from track metadata and character class
|
|
6
|
+
*
|
|
7
|
+
* Combines track title, artist, and genre with audio characteristics and actual
|
|
8
|
+
* character class to create unique fantasy-inspired character names using seven
|
|
9
|
+
* random formats with weighted distribution (20-20-10-20-15-10-5):
|
|
10
|
+
* - 20% Class Title (e.g., "Midnight Dreams the Wizard")
|
|
11
|
+
* - 20% Adjective Construct (e.g., "Hypnotic Midnight Dreams")
|
|
12
|
+
* - 10% Clan Construct (e.g., "Midnight Dreams of Daft Punk")
|
|
13
|
+
* - 20% Descriptive Epithet (e.g., "Midnight Dreams, the Swift Sage")
|
|
14
|
+
* - 15% Compound Adjective (e.g., "Thunder-Blessed Midnight Dreams")
|
|
15
|
+
* - 10% Artist-Inspired (e.g., "Daftsmith of the Crystal Spire")
|
|
16
|
+
* - 5% Mononym Subtitle (e.g., "Midnight [Dreams Eternal]")
|
|
17
|
+
*
|
|
18
|
+
* Key design principle: Audio characteristics provide LIGHT influence (~50%) on name
|
|
19
|
+
* generation, with random selection equally important (~50%). All adjective categories
|
|
20
|
+
* are always considered - audio just provides weight boosts, not hard selection rules.
|
|
21
|
+
*/
|
|
22
|
+
export declare class NamingEngine {
|
|
23
|
+
/**
|
|
24
|
+
* Generate a unique RPG-style character name from track metadata and character class
|
|
25
|
+
*
|
|
26
|
+
* Creates fantasy-inspired character names by combining:
|
|
27
|
+
* - Track title/artist with cleaning (removes "Official Video", "Remix", etc.)
|
|
28
|
+
* - Genre classification
|
|
29
|
+
* - Audio profile characteristics (light influence via weights)
|
|
30
|
+
* - Actual character class (not genre-guessed)
|
|
31
|
+
* - Randomized format and word selection
|
|
32
|
+
*
|
|
33
|
+
* @param {string} seed - Seed for random generation (provided by CharacterGenerator)
|
|
34
|
+
* @param {PlaylistTrack} track - Track with title, artist, genre metadata
|
|
35
|
+
* @param {AudioProfile} audioProfile - Audio frequency characteristics
|
|
36
|
+
* @param {Class} characterClass - Actual D&D character class
|
|
37
|
+
* @param {boolean} deterministic - If true, same seed always produces same name. Default: false (adds timestamp/random variation)
|
|
38
|
+
* @returns {string} Generated RPG-style character name
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Non-deterministic (default) - slightly different each time
|
|
42
|
+
* const name1 = namingEngine.generateName(seed, track, audioProfile, 'Wizard');
|
|
43
|
+
* const name2 = namingEngine.generateName(seed, track, audioProfile, 'Wizard');
|
|
44
|
+
* // name1 might be "Midnight Dreams the Wizard"
|
|
45
|
+
* // name2 might be "Hypnotic Midnight Dreams" (different format!)
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Deterministic mode - same seed always produces same name
|
|
49
|
+
* const name = namingEngine.generateName(seed, track, audioProfile, 'Wizard', true);
|
|
50
|
+
* // Always same result for this seed
|
|
51
|
+
*/
|
|
52
|
+
generateName(seed: string, track: PlaylistTrack, audioProfile: AudioProfile, characterClass: Class, deterministic?: boolean): string;
|
|
53
|
+
/**
|
|
54
|
+
* Clean track title by removing metadata and noise
|
|
55
|
+
*
|
|
56
|
+
* Removes common metadata suffixes and prefixes:
|
|
57
|
+
* - Removes "(Official Video)", "[Remix]", "[feat. Artist]", etc.
|
|
58
|
+
* - Removes leading track numbers like "01 - " or "1. "
|
|
59
|
+
* - Removes audio file extensions (.mp3, .wav, .flac, etc.)
|
|
60
|
+
*
|
|
61
|
+
* @param {string} title - Raw track title
|
|
62
|
+
* @returns {string} Cleaned title suitable for character naming
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* namingEngine.cleanTitle("01 - Midnight Dreams (Official Video)");
|
|
66
|
+
* // Returns: "Midnight Dreams"
|
|
67
|
+
*/
|
|
68
|
+
cleanTitle(title: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Select naming format using weighted random selection
|
|
71
|
+
* Distribution: 20-20-10-20-15-10-5
|
|
72
|
+
*/
|
|
73
|
+
private selectFormat;
|
|
74
|
+
/**
|
|
75
|
+
* Format 1: Class Title
|
|
76
|
+
* Pattern: "{title} the {class}"
|
|
77
|
+
* Uses actual character class instead of genre-guessing
|
|
78
|
+
*
|
|
79
|
+
* @example "Midnight Dreams the Wizard"
|
|
80
|
+
*/
|
|
81
|
+
private formatClassTitle;
|
|
82
|
+
/**
|
|
83
|
+
* Format 2: Adjective Construct
|
|
84
|
+
* Pattern: "{adjective} {title}"
|
|
85
|
+
* Uses RNG-based selection with balanced audio/random weights
|
|
86
|
+
*
|
|
87
|
+
* @example "Hypnotic Midnight Dreams"
|
|
88
|
+
*/
|
|
89
|
+
private formatAdjectiveConstruct;
|
|
90
|
+
/**
|
|
91
|
+
* Format 3: Clan Construct
|
|
92
|
+
* Pattern: "{title} of {artist}"
|
|
93
|
+
*
|
|
94
|
+
* @example "Midnight Dreams of Daft Punk"
|
|
95
|
+
*/
|
|
96
|
+
private formatClanConstruct;
|
|
97
|
+
/**
|
|
98
|
+
* Format 4: Descriptive Epithet
|
|
99
|
+
* Pattern: "{title}, the {descriptor} {class_aspect}"
|
|
100
|
+
*
|
|
101
|
+
* @example "Midnight Dreams, the Swift Sage"
|
|
102
|
+
*/
|
|
103
|
+
private formatDescriptiveEpithet;
|
|
104
|
+
/**
|
|
105
|
+
* Format 5: Compound Adjective
|
|
106
|
+
* Pattern: "{prefix}-{suffix} {title}"
|
|
107
|
+
*
|
|
108
|
+
* @example "Thunder-Blessed Midnight Dreams"
|
|
109
|
+
*/
|
|
110
|
+
private formatCompoundAdjective;
|
|
111
|
+
/**
|
|
112
|
+
* Format 6: Artist-Inspired
|
|
113
|
+
* Pattern: "{artist_word}{occupation} of the {realm}"
|
|
114
|
+
*
|
|
115
|
+
* @example "Daftsmith of the Crystal Spire"
|
|
116
|
+
*/
|
|
117
|
+
private formatArtistInspired;
|
|
118
|
+
/**
|
|
119
|
+
* Format 7: Mononym Subtitle
|
|
120
|
+
* Pattern: "{first_word} [{subtitle}]"
|
|
121
|
+
*
|
|
122
|
+
* @example "Midnight [Dreams Eternal]"
|
|
123
|
+
*/
|
|
124
|
+
private formatMononymSubtitle;
|
|
125
|
+
/**
|
|
126
|
+
* Calculate balanced adjective weights for 50/50 audio/random influence
|
|
127
|
+
* All categories are always considered - audio just provides weight boosts
|
|
128
|
+
*/
|
|
129
|
+
private calculateBalancedAdjectiveWeights;
|
|
130
|
+
/**
|
|
131
|
+
* Find matching genre key in NAMING_DATA.adjectives
|
|
132
|
+
* Returns 'default' if no match (ensures all adjectives available)
|
|
133
|
+
*/
|
|
134
|
+
private findGenreKey;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=NamingEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NamingEngine.d.ts","sourceRoot":"","sources":["../../../src/core/generation/NamingEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAgBhD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,YAAY;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACI,YAAY,CACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,KAAK,EACrB,aAAa,GAAE,OAAe,GAC/B,MAAM;IAkCT;;;;;;;;;;;;;;OAcG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAexC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAYpB;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAoBhC;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAahC;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAY/B;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAgB5B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;OAGG;IACH,OAAO,CAAC,iCAAiC;IA6BzC;;;OAGG;IACH,OAAO,CAAC,YAAY;CASvB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pitch Beat Linker - Links pitch detection to rhythm beat timestamps
|
|
3
|
+
*
|
|
4
|
+
* Performs full-spectrum pitch detection on the unfiltered audio signal,
|
|
5
|
+
* then matches pitch frames to beat timestamps.
|
|
6
|
+
*
|
|
7
|
+
* All bands share the same full-spectrum analysis because band-pass filtering
|
|
8
|
+
* (8th order Butterworth) removes too many harmonics for YIN/Essentia to
|
|
9
|
+
* find periodicity reliably.
|
|
10
|
+
*
|
|
11
|
+
* Part of the Pitch Detection & Button Mapping pipeline - Phase 1.3
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const linker = new PitchBeatLinker();
|
|
16
|
+
*
|
|
17
|
+
* // Analyze pitch and link to composite beats
|
|
18
|
+
* const compositePitches = await linker.linkWithComposite(compositeStream, audioBuffer);
|
|
19
|
+
*
|
|
20
|
+
* // Access pitch at each beat
|
|
21
|
+
* for (const pitchAtBeat of compositePitches) {
|
|
22
|
+
* if (pitchAtBeat.pitch?.isVoiced) {
|
|
23
|
+
* console.log(`Beat ${pitchAtBeat.beatIndex}: ${pitchAtBeat.pitch.noteName}`);
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
import { type PitchResult, type PitchDetectorConfig } from '../analysis/PitchDetector.js';
|
|
29
|
+
import { type PitchAlgorithm } from '../analysis/EssentiaPitchDetector.js';
|
|
30
|
+
import type { CompositeStream } from '../analysis/beat/CompositeStreamGenerator.js';
|
|
31
|
+
import type { DifficultyVariant } from '../analysis/beat/DifficultyVariantGenerator.js';
|
|
32
|
+
/**
|
|
33
|
+
* Band name type matching FREQUENCY_BANDS
|
|
34
|
+
*/
|
|
35
|
+
export type PitchBandName = 'low' | 'mid' | 'high';
|
|
36
|
+
/**
|
|
37
|
+
* Interval category for button mapping
|
|
38
|
+
*/
|
|
39
|
+
export type IntervalCategory = 'unison' | 'small' | 'medium' | 'large' | 'very_large';
|
|
40
|
+
/**
|
|
41
|
+
* Direction of pitch change from previous beat
|
|
42
|
+
*/
|
|
43
|
+
export type PitchDirection = 'up' | 'down' | 'stable' | 'none';
|
|
44
|
+
/**
|
|
45
|
+
* Pitch information linked to a single rhythm beat
|
|
46
|
+
*/
|
|
47
|
+
export interface PitchAtBeat {
|
|
48
|
+
/** Index into the beat stream */
|
|
49
|
+
beatIndex: number;
|
|
50
|
+
/** Timestamp in seconds */
|
|
51
|
+
timestamp: number;
|
|
52
|
+
/** Which band stream this beat originated from (rhythm origin, not pitch detection band) */
|
|
53
|
+
band: PitchBandName;
|
|
54
|
+
/** Detected pitch (null if no pitch detected) */
|
|
55
|
+
pitch: PitchResult | null;
|
|
56
|
+
/** Direction of pitch change from previous beat (populated in melody contour analysis) */
|
|
57
|
+
direction: PitchDirection;
|
|
58
|
+
/** Interval in semitones from previous beat (0 if none, populated in melody contour analysis) */
|
|
59
|
+
intervalFromPrevious: number;
|
|
60
|
+
/** Categorized interval (populated in melody contour analysis) */
|
|
61
|
+
intervalCategory?: IntervalCategory;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Configuration for PitchBeatLinker
|
|
65
|
+
*/
|
|
66
|
+
export interface PitchBeatLinkerConfig {
|
|
67
|
+
/** Pitch detector configuration (passed through to PitchDetector) */
|
|
68
|
+
pitchDetector?: Partial<PitchDetectorConfig>;
|
|
69
|
+
/** Target sample rate for analysis (default: 44100) */
|
|
70
|
+
targetSampleRate?: number;
|
|
71
|
+
/** Which pitch detection algorithm to use. 'pyin_legacy' uses the built-in detector; all others use Essentia.js. (default: 'pitch_melodia') */
|
|
72
|
+
pitchAlgorithm?: PitchAlgorithm;
|
|
73
|
+
/** URL to the CREPE TFJS model (only required when pitchAlgorithm is 'pitch_crepe') */
|
|
74
|
+
crepeModelUrl?: string;
|
|
75
|
+
/** Optional callback to resolve Arweave URLs (gateway fallback for CREPE model) */
|
|
76
|
+
resolveUrl?: (url: string) => Promise<string>;
|
|
77
|
+
}
|
|
78
|
+
/** Default configuration for PitchBeatLinker */
|
|
79
|
+
type PitchBeatLinkerResolvedConfig = Required<Omit<PitchBeatLinkerConfig, 'pitchDetector' | 'resolveUrl'>> & {
|
|
80
|
+
pitchDetector: Partial<PitchDetectorConfig>;
|
|
81
|
+
resolveUrl?: (url: string) => Promise<string>;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Links pitch detection to rhythm beat timestamps
|
|
85
|
+
*
|
|
86
|
+
* Performs full-spectrum pitch detection on the unfiltered audio signal,
|
|
87
|
+
* then matches pitch frames to beat timestamps.
|
|
88
|
+
*/
|
|
89
|
+
export declare class PitchBeatLinker {
|
|
90
|
+
private config;
|
|
91
|
+
private fullSpectrumDetector;
|
|
92
|
+
private essentiaDetector;
|
|
93
|
+
/**
|
|
94
|
+
* Create a new PitchBeatLinker
|
|
95
|
+
*
|
|
96
|
+
* @param config - Configuration options (partial, defaults applied)
|
|
97
|
+
*/
|
|
98
|
+
constructor(config?: PitchBeatLinkerConfig);
|
|
99
|
+
/**
|
|
100
|
+
* Get the current configuration
|
|
101
|
+
*/
|
|
102
|
+
getConfig(): PitchBeatLinkerResolvedConfig;
|
|
103
|
+
/**
|
|
104
|
+
* Link pitch detection to composite stream beats.
|
|
105
|
+
*
|
|
106
|
+
* Runs pitch detection on the full unfiltered signal, then matches each composite
|
|
107
|
+
* beat's timestamp directly against pitch frames.
|
|
108
|
+
*
|
|
109
|
+
* When an Essentia algorithm is selected via `pitchAlgorithm`, the Essentia.js WASM
|
|
110
|
+
* module is loaded lazily on first call (async) and cached for reuse.
|
|
111
|
+
*
|
|
112
|
+
* @param compositeStream - The composite stream from GeneratedRhythm
|
|
113
|
+
* @param audioBuffer - Web Audio API AudioBuffer to analyze
|
|
114
|
+
* @returns Promise resolving to pitch at each composite beat
|
|
115
|
+
*/
|
|
116
|
+
linkWithComposite(compositeStream: CompositeStream, audioBuffer: AudioBuffer): Promise<PitchAtBeat[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Derive pitches for a difficulty variant from composite pitches
|
|
119
|
+
*
|
|
120
|
+
* Since difficulty variants are derived from the composite stream,
|
|
121
|
+
* we can look up pitches by matching timestamps. Simplified variants
|
|
122
|
+
* (e.g., easy) may have fewer beats, so we filter pitches accordingly.
|
|
123
|
+
*
|
|
124
|
+
* @param variant - The difficulty variant from GeneratedRhythm.difficultyVariants
|
|
125
|
+
* @param compositePitches - Pitches from linkWithComposite()
|
|
126
|
+
* @returns Array of pitch-at-beat for variant beats
|
|
127
|
+
*/
|
|
128
|
+
deriveVariantPitches(variant: DifficultyVariant, compositePitches: PitchAtBeat[]): PitchAtBeat[];
|
|
129
|
+
/**
|
|
130
|
+
* Derive pitches for all difficulty variants at once
|
|
131
|
+
*
|
|
132
|
+
* Convenience method that derives pitches for easy, medium, and hard
|
|
133
|
+
* variants in a single call.
|
|
134
|
+
*
|
|
135
|
+
* @param difficultyVariants - The difficulty variants from GeneratedRhythm
|
|
136
|
+
* @param compositePitches - Pitches from linkWithComposite()
|
|
137
|
+
* @returns Object with pitches for each difficulty level
|
|
138
|
+
*/
|
|
139
|
+
deriveAllVariantPitches(difficultyVariants: {
|
|
140
|
+
easy: DifficultyVariant;
|
|
141
|
+
medium: DifficultyVariant;
|
|
142
|
+
hard: DifficultyVariant;
|
|
143
|
+
}, compositePitches: PitchAtBeat[]): {
|
|
144
|
+
easy: PitchAtBeat[];
|
|
145
|
+
medium: PitchAtBeat[];
|
|
146
|
+
hard: PitchAtBeat[];
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export {};
|
|
150
|
+
//# sourceMappingURL=PitchBeatLinker.d.ts.map
|