Skip to content

Presets and settings ​

How to store presets on the pedal, rename them, and change the global settings, plus the Preset and Settings records the library uses for them. The byte layouts are on the Preset record and Other records pages.

Back up first ​

Writes overwrite the pedal

save_preset and write_settings overwrite what is stored on the pedal. They match the official app byte for byte but haven't been run on hardware from this library yet, so keep your presets before you experiment.

  • Back up: after the sync, every stored preset is in state.presets; keep those Presets (or their to_raw() bytes). The Python example shell.py has backup FILE, which writes every read preset and the settings to a JSON file.
  • Restore: write a kept Preset back with save_preset.
  • Never send anything: Config { sync: false, .. } (Device(sync=False)) guarantees no byte goes to the pedal.

Save a preset ​

Take the live sound (the edit buffer, with all your live edits), give it a slot and a name, and save it.

rust
let mut p = state.live.clone();        // the edit buffer, with all live edits applied
let source = state.current.unwrap();   // the slot the edits were made on
p.index = 21;                          // store to P22 (or keep `source` to overwrite)
p.name = "Lead".into();                // ≤ 16 printable ASCII; others become '?'
dev.save_preset(source, &p);
python
p = state.live                         # a copy of the edit buffer with all live edits
source = state.current                 # the slot the edits were made on
p.index = 21                           # store to P22 (or keep `source` to overwrite)
p.name = "Lead"                        # <= 16 printable ASCII; others become '?'
dev.save_preset(source, p)             # name, record, then select the saved slot

save_preset(source_slot, &preset) queues the official app's exact sequence (Commands):

  1. A 0x12 name write. Its first byte is source_slot, the active preset the edits were made on (the official app sends it even when saving to another slot).
  2. A 0x0B preset write to slot preset.index, which waits for its ack.
  3. A program change to the saved slot.

The sequence is tested byte for byte against a captured save as from the official app.

Rename a preset ​

A rename is a save with a new name to the same slot:

rust
let i = state.current.unwrap();
let mut p = state.live.clone();
p.name = "Clean Verb".into();
dev.save_preset(i, &p);                // p.index is already i
python
i = state.current
p = state.live
p.name = "Clean Verb"
dev.save_preset(i, p)
  • Names: up to 16 characters; non-ASCII becomes ?.
  • Name only: host::preset_name(source_slot, name) sets just the edit buffer's name. Store it with a save.

Read-modify-write ​

Never build a record from scratch: several bytes of the preset and settings records are still unknown.

  1. Start from a record the pedal sent: state.live, state.stored(i) or state.settings.
  2. Change only the fields you understand.
  3. Write it back with save_preset or write_settings. The encoder keeps every other byte as it was.

The official app does the same for the system settings.

The Preset record ​

Preset decodes the 110-byte record of a 0x0B (preset) or 0x0C (edit buffer) body.

FieldRecord bytesMeaning
index00-based slot. Always 0 in the edit buffer; DeviceState fixes it up
modules[8]heads 12–19, params per moduleOne ModuleState per effect module, indexed by Module::index()
volume78Preset volume, 0–100
chain[8]82–89Module indices of all eight effect blocks in signal order, GATE included (signal chain)
name94–109Up to 16 ASCII characters
rawall 110The record as read; unknown bytes survive a round trip

Changed in 0.7.0

Preset::chain is now all eight effect modules, GATE included ([u8; 8], bytes 82–89); before, byte 82 was taken for a constant and chain had seven entries. In Python, Preset.chain is a list of eight Modules and now includes Module.GATE.

ModuleState fieldMeaning
onBlock on or off
model0-based model index
params[12]Parameter values by slot (only the module's first N are used)
head() / set_head(b)The head byte: bit 6 set = off, low 6 bits = model

Methods ​

RustPythonDoes
Preset::from_packed(body)Preset.from_packed(body)Decode a packed 0x0B/0x0C body. Rust: None if it isn't one; Python: ValueError
Preset::from_raw(bytes)Preset.from_raw(bytes)Decode the unpacked 110 bytes
to_raw()to_raw()The 110-byte record: raw with every decoded field written back
to_packed()to_packed()The packed body for a 0x0B write
module(m) / module_mut(m)module(m)One module's state (Python: a copy)
set_module(m, on=…, model=…, params=…), set_param(m, slot, value)Edit a module (Python)
same_sound(&other)same_sound(other)Same modules, volume and chain, ignoring unused parameter slots
Preset::default()Preset()An empty preset
clone()copy(), copy.copy, copy.deepcopyA copy
  • Unknown bytes: the decoder keeps the full record in raw and the encoder writes only known fields back over it, so bytes that are still unknown round-trip untouched (open questions). Always start from a record the pedal sent.
  • Param counts: when a module's model changes, its parameter-count byte is recomputed (records::param_count; CAB always carries all five).
  • Constants: PRESET_COUNT (99), PRESET_LEN (110), CHAIN_LEN (8), DEFAULT_CHAIN, records::valid_chain(order).
  • Python: assigning a whole list to p.modules also works.

Settings ​

The global settings are written whole. Always start from the record the pedal sent, so unknown bytes survive.

rust
let mut s = state.settings.clone().expect("synced");
s.input_trim = 13;     // 0–20 = −10…+10 dB
s.loopback = false;
dev.write_settings(&s);
python
s = state.settings                 # a copy of the pedal's record
s.input_trim = 13                  # 0-20 = -10..+10 dB
s.loopback = False
dev.write_settings(s)
Settings fieldMeaning
input_trim0–20 = −10…+10 dB; input_trim_db() gives the dB value (a property in Python)
eq_bass, eq_mid, eq_trebleGlobal EQ, 0–100 (50 = centre). Changes made on the pedal aren't reported over USB
wirelessThe Wireless (Bluetooth) setting
loopbackThe LoopBack setting
rawThe 17-byte record as read
  • Encoding: Settings::from_packed(body) decodes a 0x14 body and to_packed() encodes it; values are clamped to their ranges on write.
  • Sliders: successive settings writes still waiting in the queue collapse into the latest one, so a slider can write on every change.
  • Python: Settings has copy() too, but no constructor; get one from state.settings or Settings.from_packed.

MIT or Apache-2.0. Not affiliated with SORAN.