# Sprint 6: Professional Session View Production

## Goal
Transform `_cmd_build_song` from basic sample rotation into a professional
Session View production system. All work is Session View only — the user
records to Arrangement View manually with F9.

## Current State (Sprint 5)
- 11 tracks (7 audio + 4 MIDI)
- 5 scenes (Intro, Verse, Chorus, Bridge, Outro)
- Simple modulo sample rotation (2 samples per category)
- No velocity/energy variation across scenes
- No transition fills between sections
- No pad/texture layers
- Fragile Session→Arrangement recording

## Sprint 6 Changes

### Module 1: Expanded Track Layout (14 tracks)
Audio (9):
1. Drum Loop - Full groove loop
2. Kick - One-shot
3. Snare/Clap - One-shot
4. HiHat - One-shot
5. Shaker/Perc - Additional percussive layer
6. Perc Loop - Percussion loop
7. Bass Audio - Bass sample loop
8. FX - Risers, impacts, transitions
9. Ambience - Atmospheric textures

MIDI (5):
10. Dembow - Wavetable (4 variations per scene)
11. Chords - Wavetable (8 different progressions)
12. Lead - Operator (density varies by energy)
13. Sub Bass - Operator (4 styles per scene)
14. Pad/Texture - Wavetable (sustained chords)

### Module 2: 8 Scenes with Energy Profiles
| Scene | Name | Bars | Energy | Elements |
|-------|------|------|--------|----------|
| 0 | Intro | 4 | 0.30 | pad + ambience + hi-hats |
| 1 | Verse A | 8 | 0.60 | drums + bass + chords + dembow |
| 2 | Verse B | 8 | 0.65 | all verse + lead melody |
| 3 | Pre-Chorus | 4 | 0.75 | build + riser FX + pad |
| 4 | Chorus A | 8 | 0.95 | full energy, all elements + impact |
| 5 | Chorus B | 8 | 0.90 | chorus variation, different patterns |
| 6 | Bridge | 4 | 0.40 | breakdown, bass + pad + ambience |
| 7 | Outro | 4 | 0.20 | pad + ambience fade |

### Module 3: Per-Scene Sample Swapping
- `_pick_for_scene()`: distributes ALL available samples across 8 scenes
- Each scene gets a different sample from each category
- Energy-based: softer samples for intro/bridge, punchy for chorus

### Module 4: Energy-Based Velocity
- `_velocity_range(energy)`: maps 0.0-1.0 to MIDI velocity ranges
- Intro: vel 70-80, Verse: 85-100, Chorus: 95-127, Bridge: 60-80, Outro: 50-70
- Applied to all MIDI pattern generation

### Module 5: Better MIDI Patterns
- Dembow: 4 variations (minimal, standard, double, triple) mapped to scene energy
- Chords: 8 different progressions across scenes
- Bass: 4 styles (sub, standard, staccato, slide/melodic)
- Lead: density scales with energy (0.5-0.8)
- Pad: sustained triads with whole-note durations

### Module 6: Humanization
- Applied to all 5 MIDI tracks after generation
- Instrument-specific profiles (kick=5ms, snare=10ms, hats=15ms)
- BPM-aware timing conversion

### Module 7: Transition FX
- Pre-Chorus scene gets FX clip (riser)
- Chorus A scene gets FX clip (impact)
- Bridge scene gets ambience clip (downlifter feel)

## Removed
- `_start_translate_to_arrangement` call (user does F9 manually)
- `_translate_tick` still exists but not triggered by build_song

## Files Modified
- `__init__.py`: `_cmd_build_song` rewritten (lines 5342-5705)

## Testing
1. Health check (5/5)
2. Run `build_song`
3. Verify 14 tracks created
4. Verify 8 scenes with clips
5. Fire each scene and listen
6. Press F9 to record to Arrangement
