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:
1 parent
63b3129cca
commit
3992744a1d
9 files changed
+239
-113
No files matched your search
@@ -31,6 +31,7 @@ GLOBAL_TEMPO = 0 # two bytes, little-endian
|
||||
GLOBAL_SWING = 2
|
||||
GLOBAL_CURVE = 6
|
||||
GLOBAL_TRANSPOSE = 7 # signed
|
||||
GLOBAL_BANK = 11 # 0 is pad bank 1, 1 is pad bank 2; MidiSuite writes it to switch banks
|
||||
|
||||
# File bytes. Names are only values MidiSuite has shown for this pad's
|
||||
# factory image, or a RAM probe on this pad has heard.
|
||||
@@ -132,6 +133,7 @@ def unpack_global(raw: bytes) -> dict:
|
||||
"swing": raw[GLOBAL_SWING],
|
||||
"curve": raw[GLOBAL_CURVE],
|
||||
"transpose": int.from_bytes(raw[GLOBAL_TRANSPOSE:GLOBAL_TRANSPOSE + 1], "little", signed=True),
|
||||
"bank": raw[GLOBAL_BANK],
|
||||
"raw": raw.hex(),
|
||||
}
|
||||
|
||||
@@ -151,6 +153,10 @@ def pack_global(block: dict) -> bytes:
|
||||
if isinstance(transpose, bool) or not isinstance(transpose, int) or not -128 <= transpose <= 127:
|
||||
raise PresetError("transpose must be -128 to 127")
|
||||
out[GLOBAL_TRANSPOSE] = transpose & 0xFF
|
||||
bank = block.get("bank", out[GLOBAL_BANK])
|
||||
if isinstance(bank, bool) or bank not in (0, 1):
|
||||
raise PresetError("pad bank must be 0 or 1")
|
||||
out[GLOBAL_BANK] = bank
|
||||
return bytes(out)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user