Skip to content

Lemon Drum Sampler: reopened projects play each pad its own sample - #473

Open
ItsAlphaNeon wants to merge 2 commits into
plugin-state-orderfrom
sampler-reload-samples
Open

ItsAlphaNeon wants to merge 2 commits into
plugin-state-orderfrom
sampler-reload-samples

Conversation

@ItsAlphaNeon

Copy link
Copy Markdown
Owner

Summary

  • After a project was saved and opened again, Lemon Drum Sampler pads played the wrong sample, or none.
  • When the host opens a project, it gives the plugin one sample file per layer, including the layers of empty pads. When the plugin rebuilt its kit, it counted only the layers that hold a sample. So the two lists fell out of step as soon as an empty pad came before a loaded one. It only showed after a reopen, because that's when the host fills the list.
  • The kit now finds each layer's file by the pad's first layer plus the layer's place in the pad, as plugins/lemon-drum-sampler.md §1 already describes (one entry per layer, in state order).

Fixes #467

Stacked on #472 (that branch is merged in). When this was opened, #472's Linux job had failed on an unrelated timing test, dropout_log::tests::a_hold_tells_running_from_waiting. The next PR in the stack makes that test robust.

Test plan

  • New lemon-drum-sampler test a_reopened_kit_plays_each_pad_its_own_sample: samples on pads 5, 2 and 10 go through save and reopen the way the host does it. Each pad holds its own sample and plays at that sample's level. It fails before the fix.
  • New os-session test drums::tests::a_reopened_kit_plays_each_pad_its_own_sample: the real reopen path (plugin_state, then create_with), with two pads whose samples are 4x apart in level. It fails before the fix.
  • cargo test --workspace --locked on Windows, with Activate hosted plugins before restoring their saved state #472 merged in: 2713 passed, 0 failed.
  • Manual: put samples on several pads (not only the first ones), save, close, reopen, and play each pad.

🤖 Generated with Claude Code

ItsAlphaNeon and others added 2 commits December 3, 2026 02:21
The host gives the plugin one sample file per layer in state order, the
empty pads' layers included, but rebuilding the kit counted only the
layers that hold a sample. After a project was reopened (the only time
the host fills that list) the k-th sounding layer opened the file of the
k-th layer overall, so pads played another pad's sample or nothing.

The kit now finds a layer's file from its pad's first layer plus its own
place. Regression tests in the plugin (state round trip, every pad's
sample and level) and in the session (the real reopen path).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant