Major role mapping and synthesis improvements

Role Mapping Rewrite:
- Replace naive hard thresholds with scored feature analysis
- Extract comprehensive track features (polyphony, repetition, phrase continuity)
- Add melody vs accompaniment separation logic
- Competitive role allocation with fallback handling
- Support for 6 roles: bass, drone, ostinato, texture, accents, melody

Chord Detection & Polyphony:
- Extract chord events from simultaneous notes (50ms window)
- Add ChordEvent type with multiple pitches
- SynthesisEngine supports both single notes and chords
- Drone/texture layers use chords, others remain monophonic

Feature Extraction:
- medianPitch, pitchRange, noteDensity analysis
- polyphonyRatio calculation via note overlap detection
- repetitionScore using 4-note pattern matching
- phraseContinuity detection via stepwise motion
- register classification (low/mid/high)

This should dramatically improve "sounds like the song" recognition
by using actual musical features instead of arbitrary cutoffs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
b1rdmania
2025-12-17 21:00:33 +00:00
parent 11c894bd91
commit 2d4c748d4c
7 changed files with 5361 additions and 129 deletions
+2747
View File
File diff suppressed because it is too large Load Diff