Skip to content

feat(editor): instruments by default — a Guitar Pro import sounds out of the box - #281

Merged
byrongamatos merged 2 commits into
mainfrom
feat/editor-instruments-default
Jul 15, 2026
Merged

feat(editor): instruments by default — a Guitar Pro import sounds out of the box#281
byrongamatos merged 2 commits into
mainfrom
feat/editor-instruments-default

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

⚠ STACKED on #280 (multi-track MIDI playback) — base feat/editor-midi-playback; the chartware default turns #280's band mode on where it matters most. After #280 squashes: rebase --onto main, retarget, ancestry check.

What

Import a Guitar Pro or MIDI file, press play, hear music. Today that flow produces silence — the guide is off by default and its default voice was a clap. Christian's call: claps are dumb; built-in soundfonts, on by default for every GP/MIDI track.

  • Session-aware defaults: chart-only sessions (no recording — GP/MIDI imports, create mode) default the guide ON and band mode ON (feat(editor): multi-track MIDI playback — the chart plays as a band, mixed by the Tracks strips #280), so every track voices its instrument immediately. Recording-backed sessions keep today's quiet defaults exactly. A stored user choice beats the default in both directions (an explicit OFF in chartware sticks — the default never overrides a human).
  • The clap mode is gone. The guide voice is always instruments: _gmGuideModePure reads 'gm' for every input (legacy stored 'clap' prefs migrate silently), the Clap/Instrument menu radio is removed (the per-kind instrument choice rows stay), and user-facing copy says "guide voices". The clap survives only as the never-silent loading fallback and the drum-grid tick — invisible plumbing, not a feature.
  • The default sounds ship inside the plugin (~2 MB). The per-kind default presets are now vendored into assets/wafonts/ — WebAudioFontPlayer + FluidR3 grand piano (keys), clean electric (guitar), fingered bass (bass) — so the source chain's first rung serves them and first play needs zero network. The FluidR3-only provenance contract is kept and the README lists every file with source + license; non-default curated choices still stream lazily from org/CDN. This closes the "vendor preset subset" follow-up from feat(editor): pitched GM guide voices + per-kind instrument picker (DAW 1.2/1.5) #217 (the size call: defaults only, ~2 MB).

Testing

tests/instruments_default.test.mjs (3 cases, fails on main): the default matrix (chartware ON / recording OFF / stored beats both, both ways), the clap→gm migration, and a pin that the default presets are genuinely on disk with whitelist-exact names and real sizes. gm_guide and midi_playback suites re-pinned to the new contract. Full gates green: 160 files / 0 fail, lint at baseline, test_wafont_route.py 4/4.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q

Summary by CodeRabbit

  • New Features

    • Imported Guitar Pro and MIDI files now play all transcription tracks immediately with bundled default instruments.
    • Default instruments work offline, while additional sounds can load when selected.
    • Added live mixer controls for audio and transcription tracks, including volume, mute, and solo.
    • Guide voice selection now offers instruments by track type.
  • Bug Fixes

    • Track playback choices are remembered between sessions.
    • Band channels now manage their own audible state independently.
    • Improved guide voice defaults and updated related labels.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ee8b3d6-c87b-492a-8405-5ee8517f440f

📥 Commits

Reviewing files that changed from the base of the PR and between d684849 and 4512b47.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • assets/wafonts/0000_FluidR3_GM_sf2_file.js
  • assets/wafonts/0270_FluidR3_GM_sf2_file.js
  • assets/wafonts/0330_FluidR3_GM_sf2_file.js
  • assets/wafonts/README.md
  • assets/wafonts/WebAudioFontPlayer.js
  • docs/USER-GUIDE.md
  • src/audio.js
  • src/gm-guide.js
  • src/menu-bar.js
  • src/shortcuts.js
  • tests/band_review_fixes.test.mjs
  • tests/gm_guide.test.mjs
  • tests/instruments_default.test.mjs
  • tests/midi_playback.test.mjs
🔥 Files not summarized due to errors (2)
  • assets/wafonts/0000_FluidR3_GM_sf2_file.js: Server error: no LLM provider could handle the message
  • assets/wafonts/0330_FluidR3_GM_sf2_file.js: Server error: no LLM provider could handle the message

📝 Walkthrough

Walkthrough

Adds a WebAudioFont playback engine and bundled default preset, normalizes guide voice selection to GM instruments, and updates multi-track scheduler behavior, persisted playback preferences, documentation, changelogs, and tests.

Changes

Guide voice and multi-track playback

Layer / File(s) Summary
WebAudioFont playback engine
assets/wafonts/WebAudioFontPlayer.js
Adds preset loading and lookup, sample decoding, WebAudio scheduling, envelopes, reverb, cancellation, and loop ticking.
Bundled default soundfont preset
assets/wafonts/0270_FluidR3_GM_sf2_file.js, assets/wafonts/README.md
Adds the FluidR3 guitar tone data and documents vendored default presets and remote preset loading.
Guide voice normalization and selection
src/audio.js, src/gm-guide.js, src/menu-bar.js, src/shortcuts.js, tests/gm_guide.test.mjs
Defaults guide audio on, normalizes guide mode to GM, and replaces clap/instrument mode choices with dynamic GM instrument rows and updated labels.
Multi-track scheduling and persisted choices
src/audio.js, tests/band_review_fixes.test.mjs, tests/midi_playback.test.mjs, tests/instruments_default.test.mjs, docs/USER-GUIDE.md, CHANGELOG.md
Updates play-all preference handling and band scheduling, documents live mixer behavior, records the changes, and validates defaults, bundled assets, and playback scenarios.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor
  participant WebAudioFontLoader
  participant WebAudioFontPlayer
  participant GuideScheduler
  participant AudioOutput
  Editor->>WebAudioFontLoader: request default instrument preset
  WebAudioFontLoader->>WebAudioFontPlayer: provide decoded preset
  Editor->>GuideScheduler: start play-all or band playback
  GuideScheduler->>WebAudioFontPlayer: queue transcription and guide notes
  WebAudioFontPlayer->>AudioOutput: schedule sampled voices
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/editor-instruments-default

Comment @coderabbitai help to get the list of available commands.

ChrisBeWithYou and others added 2 commits July 15, 2026 22:36
Christian's call: the guide claps are dumb; built-in soundfonts,
defaulted ON for each Guitar Pro / MIDI track.

- Session-aware defaults: a chart-only session (createMode or no
  recording) defaults the guide ON and band mode ON — import a GP file,
  press play, hear the band. Recording-backed sessions keep the quiet
  defaults. A stored user choice beats the default in BOTH directions
  (explicit OFF in chartware sticks).
- The clap MODE is gone: _gmGuideModePure always reads 'gm' (legacy
  stored 'clap' prefs migrate), the Clap/Instrument menu radio is
  removed (per-kind instrument choice rows stay), user-facing copy says
  'guide voices'. The clap itself survives ONLY as the loading fallback
  and the drum-grid tick.
- VENDORED the per-kind default presets (~2 MB: WebAudioFontPlayer +
  FluidR3 0000 piano / 0270 clean electric / 0330 fingered bass) into
  assets/wafonts — the source chain's plugin rung now serves them, so
  first play needs zero network. README provenance updated (FluidR3-
  only contract kept); non-default choices still stream lazily.

tests/instruments_default.test.mjs (3 cases, fails on main): the
session-aware default matrix, the mode migration, and a pin that the
default presets are genuinely on disk with whitelist-exact names.
gm_guide + midi_playback suites re-pinned to the new contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
@byrongamatos
byrongamatos force-pushed the feat/editor-instruments-default branch from 1766fc7 to 4512b47 Compare July 15, 2026 20:37
@byrongamatos
byrongamatos merged commit a345fbb into main Jul 15, 2026
3 of 4 checks passed
@byrongamatos
byrongamatos deleted the feat/editor-instruments-default branch July 15, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants