Light pad bank 2 from page 7, and add factory reset and a pad bank toggle to the editor.

Bank 2's lamp colours come from preset page 7, not page 3, so pad_colours.py
writes there and the editor labels it Bank 2. The factory reset loads the
image MidiSuite uploads for its own reset, and the bank toggle writes the
global-block byte MidiSuite uses to switch banks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Sonnet 5.5 committed 2026-10-21 20:34:34 +13:00
1 parent 63b3129cca
commit 3992744a1d
9 files changed
+239 -113

No files matched your search

+27
View File
@@ -169,3 +169,30 @@ def test_factory_image_reads_as_midisuite_shows_it():
# Knob 6: CC, Channel 1, CC 35, 0–127.
knob6 = first["knobs"][5]
assert (knob6["type"], knob6["channel"], knob6["number"], knob6["left"], knob6["right"]) == (0, 1, 35, 0, 127)
def test_factory_document_packs_back_to_the_midisuite_image():
from pathlib import Path
from padeditor.preset import pack
from padeditor.server import Editor
document = Editor().factory()
assert pack(document) == (Path(__file__).parents[1] / "padeditor" / "factory.bin").read_bytes()
assert document["global"]["raw"] == "780032040000020001010000"
def test_global_bank_byte_round_trips_and_is_checked():
import pytest
from padeditor.preset import PresetError, pack_global, unpack_global
raw = bytes.fromhex("780032040000020001010001")
block = unpack_global(raw)
assert block["bank"] == 1
assert pack_global(block) == raw
block["bank"] = 0
assert pack_global(block)[11] == 0
block["bank"] = 2
with pytest.raises(PresetError):
pack_global(block)