Skip to main content

Crate open_stomp

Crate open_stomp 

Source
Expand description

A library for the SORAN Dual Stomp (Lite) guitar multi-effects pedal over USB-MIDI.

The protocol was reverse engineered from the vendor’s Stomp Manager app; docs/ in the repository describes it in full, and docs/10-library-guide.md is the guide to this crate. The crate has two layers:

  • Protocol (always available, no I/O, no dependencies): pack (8-in-7 bitstream), midi (message parsing, SysEx framing, stream reassembly, request and command builders), catalog (modules, models, parameters), records (preset and settings records), state (a model of the pedal that every message is applied to), queue (the one-request-at-a-time pacing the pedal needs), upload (user AMP/IR upload framing) and capture (capture log reader).
  • NAM (feature nam, on by default): nam loads and runs Neural Amp Modeler .nam models and converts them into the pedal’s user AMP format, as the official app does.
  • Device (feature device, on by default): device runs a background engine that finds the pedal, connects, performs the startup sync, sends edits and reports everything that happens, or replays a capture log instead of a real pedal.
use open_stomp::device::{Config, Device, Update};
use open_stomp::DeviceState;

let dev = Device::spawn(Config::default()); // finds and connects to the pedal by itself
let mut state = DeviceState::default();
while let Ok(update) = dev.recv() {
    match update {
        Update::Reset => state = DeviceState::default(),
        Update::Message { origin, bytes, .. } => {
            let ev = state.apply(&bytes, origin);
            println!("{:8} {} = {}", ev.category.label(), ev.subject, ev.value);
        }
        _ => {}
    }
}
// and to control it: dev.select_preset(4); dev.set_param(Module::Amp, 0, 100); ...

Tested against the Dual Stomp Lite on firmware V1.1.1. The capture logs in captures/logs/ are the test vectors.

Re-exports§

pub use catalog::Module;
pub use midi::Assembler;
pub use midi::Msg;
pub use records::Preset;
pub use records::Settings;
pub use state::Category;
pub use state::DeviceState;
pub use state::Event;
pub use state::Origin;

Modules§

blemidi
BLE-MIDI packet framing (Apple / MMA “MIDI over Bluetooth LE” spec), used for the pedal’s Wireless mode. Pure code: the transport itself is in the engine (feature ble).
capture
Reader for the capture logs in captures/logs/ (docs/07): <unix ms> <TX|RX> <len> [<endpoint>] <hex…> and # MARK <ms> <text>.
catalog
Module / model / parameter catalogue (docs/02).
device
Background engine (feature device): owns the MIDI connection (or a capture replay), finds and connects to the pedal, performs the startup sync, sends edits and reports every message.
ir
Impulse responses for the pedal’s user CAB (IR) slots (docs/05): reading and writing WAV files, resampling, and the conversion to the pedal’s upload format.
midi
MIDI message parsing, SysEx framing and stream reassembly (docs/02, docs/03).
nam
Neural Amp Modeler (.nam) models (feature nam): loading and inference.
pack
8-in-7 packing: 8-bit structs carried as a little-endian 7-bit bitstream (docs/03).
queue
Request pacing (docs/03): the pedal handles one SysEx request at a time, so requests and writes are queued and each waits for its reply or ack before the next is sent, like the official app. Live CCs/PCs carry no reply and need no queue.
records
Data records carried in SysEx (docs/04).
state
Device state tracker: applies MIDI traffic (either direction) to a model of the pedal and describes each message in plain English.
upload
User AMP (NAM, SysEx 0x58) and user IR (SysEx 0x10 + 0x09) uploads (docs/05).

Constants§

BLE_PORT_SUFFIX
Suffix of the port name the engine gives a pedal found over Bluetooth LE MIDI (feature ble): "JME STOMPBOX (Bluetooth)".
USB_ID
USB vendor and product id of the pedal (3962:2000, “JME STOMPBOX”).

Functions§

is_ble_port
Whether a port name is a pedal found over Bluetooth (see BLE_PORT_SUFFIX).
is_stomp_port
Whether a MIDI port name belongs to the pedal. Matches what the official app matches (.*JME.*, .*SORAN AMPEY.*) plus the product name, ignoring case.