feat(ascii_tracker): grid notation inspired by Switch Angel's Strudel sequencer#5
Open
Talador12 wants to merge 1 commit into
Open
feat(ascii_tracker): grid notation inspired by Switch Angel's Strudel sequencer#5Talador12 wants to merge 1 commit into
Talador12 wants to merge 1 commit into
Conversation
… sequencer Phase 2 of the Strudel integration plan. Switch Angel mentioned in her Night Friends video description that she built her own ASCII track sequencer in Strudel for live param tweaking; this lands the same idea in code-music as a pure offline module that renders through the existing PolyphonicTrack pipeline. Format: a multi-line text grid where rows are time steps and columns are voices. Cells parse as: C2, F#3, Bb4 pitched notes C2,E2,G2 chord (comma-separated) C2:80 note with explicit MIDI velocity (0..127) C2:0.6 note with fractional velocity (0..1) ~ - ... rest tokens # comment comment line 00 | optional step-index prefix per row Module: - code_music/ascii_tracker.py — AsciiTracker.from_string, to_patterns, to_song, to_string. Round-trip clean for any tracker built from from_string. - code_music/__init__.py — re-export AsciiTracker, Cell, tracker. Songs: - songs/tracker_trance.py — 16-step trance grid at 138 BPM (Switch Angel style: kick/snare/hat/bass/lead/pad). - songs/tracker_chord_progression.py — 16-step I-vi-IV-V grid at 84 BPM (piano + bass). Tests: - tests/test_ascii_tracker.py — 35 tests covering rest tokens, single notes, sharp/flat, chord cells, velocity (MIDI + fractional), invalid tokens, header parsing, comment + blank-line handling, optional step index, row/column count mismatch errors, to_patterns chord collapse, to_song polytrack assignment, instruments dict, default fallback, step-duration timing, simultaneous chord events, and to_string round- trip for both monophonic and chord grids. CI: added a tracker_trance smoke render alongside the existing songs. Slide notation (C2~D2) and modulation lanes documented as deferred - the v1 cell parser raises ValueError on those tokens deliberately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/strudel_integration.md: Switch Angel-style ASCII tracker as a pure offline module that renders through the existing PolyphonicTrack pipeline.code_music.ascii_trackerexposesAsciiTracker.from_string / to_patterns / to_song / to_string. Cells parse as rests, pitched notes, chords (C2,E2,G2), and notes with velocity (C2:80MIDI scale orC2:0.6fractional).songs/tracker_trance.py(138 BPM trance grid, 6 voices) andsongs/tracker_chord_progression.py(I-vi-IV-V at 84 BPM).Format example
Changes
code_music/ascii_tracker.py- new module (~300 lines).code_music/__init__.py- re-exportAsciiTracker,Cell,tracker.tests/test_ascii_tracker.py- 35 tests.songs/tracker_trance.py,songs/tracker_chord_progression.py- demo songs..github/workflows/ci.yml- tracker smoke render alongside existing songs.docs/strudel_integration.md- Phase 2 marked shipped, ship-order updated.claude.md- status updated, next-step pointer to Phase 1 mini-notation parity.Verification
ruff check code_music tests songs samples scales scripts albums-> clean.pytest tests/-> 3844 passed (was 3804 before this PR + visualizer/hook PRs; +35 new ascii_tracker tests)./tmp/tracker_trance.wav0.7 MB,/tmp/tracker_chord.wav3.3 MB).Out of scope
C2~D2) and modulation lanes - cell parser deliberately raisesValueErroron these tokens so the gap is visible. Future PR.code_music.pattern- that is Phase 1 of the plan, separate PR.