Skip to content

Feature/demo song#11

Merged
illobo merged 15 commits intomainfrom
feature/demo-song
Mar 16, 2026
Merged

Feature/demo song#11
illobo merged 15 commits intomainfrom
feature/demo-song

Conversation

@illobo
Copy link
Owner

@illobo illobo commented Mar 16, 2026

No description provided.

lobo and others added 15 commits March 12, 2026 14:28
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add lookup helpers to all 4 preset modules:
- pattern_presets: preset_by_name()
- synth_presets: preset_by_name()
- synth_pattern_presets: preset_by_name()
- drum_presets: preset_by_name_for_voice() + first_preset_for_category()

These functions enable direct preset lookup by name for loading presets
from saved projects and applying them programmatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded PatternData structs with pattern_from_preset() helper
that loads from pattern_presets module. Update demo project metadata:
- Name: "Demo Beats" → "Demo Song"
- BPM: 125 → 138 (matches first scene)

New 10-scene lineup:
1. Acid Techno 138 (Acid House preset)
2. House 122 (Classic House preset)
3. Deep House 120
4. Techno 130 (Driving Techno preset)
5. Downtempo 85 (Lo-Fi Hip Hop preset)
6. Trance 140 (Classic Trance preset)
7. Drum & Bass 174 (Amen Break preset)
8. Electro 128 (Electro Funk preset)
9. Dub Techno 118 (Basic Chain preset)
10. Ambient 90 (Sparse Pulse preset)

Note: 2 demo tests now fail (expected, will be fixed in Task 10).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add helper functions synth_kit_from_preset() and synth_pattern_from_preset()
to load synth sounds and patterns from the preset system. Wire all 8 synth kits
and 10 patterns for both Synth A (bass) and Synth B (lead/pad) channels.

Synth A uses bass presets (Wobble, Acid, Reese, etc.) paired with bass patterns.
Synth B uses melodic presets (Screamer, Electric Piano, pads, leads) with
corresponding melodic patterns. Each pattern slot matches its drum pattern genre.

Note: Velocity conversion from u8 (0-127) to f32 (0.0-1.0) in pattern loader.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace old demo_house_kick_is_four_on_the_floor test
- Update BPM assertions for new patterns (Acid Techno 138, D&B 174, Ambient 90)
- Add tests for nonempty drum steps
- Add tests for synth kits (Wobble Bass, Screamer)
- Add tests for synth patterns having notes (synth A & B)
- Update serialize roundtrip to check new pattern names

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously App::new() ignored the project's synth patterns and loaded
hardcoded "Techno 2" / "Four on the Floor" presets. Now it loads
patterns and kits from the demo project for both Synth A and B,
and sends Synth B state to the audio thread on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix switch_synth_pattern_for(B): load pattern from project instead
  of resetting to empty default
- Fix switch_synth_kit_for(B): load kit from project
- Add queued synth B pattern activation at loop boundary
- Set demo project loop_length to 32 (was 16)
- Set synth_b_length default to 32 (was 16)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SceneBrowserState struct and SceneBrowser modal variant
- Add RenameScene(usize) to ModalAction enum
- Add queued_scene field to UiState with None default
- Implement scene methods: open_scene_browser, save_scene, apply_scene_immediate, queue_scene, delete_scene, rename_scene
- Wire queued_scene into StepAdvance handler (applies before individual pattern switches)
- Add stub handlers in keys.rs and ui/mod.rs for compilation (proper impl in Tasks 4-5)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add render_scene_browser() function displaying 14 scenes with pattern/kit indicators
- Show scene name (truncated), drum pattern/kit, synth A/B patterns/kits using ♫/◈ symbols
- Cyan theme for browser borders, amber for actions, pink for commands
- Footer shows nav keys, queue/now actions, save/rename/delete commands
- Add scene_truncate_name() helper for name overflow handling
- Replace SceneBrowser stub with actual render call to app.project.scenes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add Ctrl+E global keybinding to open scene browser
- Implement full scene browser keyboard navigation:
  - Up/Down: navigate scenes
  - Enter: queue scene (Shift+Enter: immediate switch)
  - S: save current state to selected scene
  - D: delete selected scene
  - R: rename selected scene (opens text input modal)
  - Esc: close browser
- Add ModalAction::RenameScene handler in text input modal
- Follow existing modal pattern with handle_scene_browser() helper

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 10 diverse genre scenes to demo_project(): Acid Techno, Classic House,
Deep House, Driving Techno, Lo-Fi Hip Hop, Trance, Drum & Bass, Electro Funk,
Dub Techno, and Ambient. Each scene references appropriate pattern/kit indices
and BPM settings.

Added test to verify demo project contains at least 5 populated scenes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Scene modal stays open on Enter/! (no auto-close)
- Use ! for immediate scene switch (Shift+Enter unreliable in terminals)
- Footer labels: "Return" queue, "!" now
- Mirror 16-step drum presets to fill all 32 steps
- Default panel visibility: both synth knobs collapsed, all grids visible
- Load first scene at startup (bonza as scene 1)
- Bump version to 1.3.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@illobo illobo merged commit 1944d2f into main Mar 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant