Skip to content

Python quick start ​

Install the open_stomp Python package and run a first script against the pedal. The package is the Rust library compiled in with PyO3: the same protocol, state tracking, connection engine and NAM / IR conversion.

Requirements ​

  • Python: 3.9 or newer (CPython; free-threaded builds are supported).
  • Platforms with a ready-made wheel: Linux x86_64, macOS (universal: Apple Silicon and Intel), Windows x64.
  • Anything else (for example Linux on ARM): build from source, below.

Not on PyPI

PyPI publishing was dropped in 0.7.0. The wheels and the source distribution are attached to each GitHub release instead.

Install a release wheel ​

No Rust toolchain needed.

  1. Open the releases page and pick a release (the newest is v0.7.0).

  2. Download the wheel for your system:

    SystemWheel
    Linux x86_64open_stomp_lib-0.7.0-cp39-abi3-manylinux_2_28_x86_64.whl
    macOS 10.12+ (Intel and Apple Silicon)open_stomp_lib-0.7.0-cp39-abi3-macosx_10_12_universal2….whl
    Windows x64open_stomp_lib-0.7.0-cp39-abi3-win_amd64.whl
  3. Install it:

    sh
    pip install open_stomp_lib-0.7.0-*.whl

One abi3 wheel per platform works on every CPython from 3.9 up. The distribution is named open-stomp-lib; the module you import is open_stomp.

Build from source ​

You need Rust 1.88 or newer and, on Linux, the ALSA and D-Bus headers:

SystemCommand
Debian, Ubuntusudo apt install libasound2-dev libdbus-1-dev
Fedorasudo dnf install alsa-lib-devel dbus-devel

Then install from a checkout (pip builds it with maturin):

sh
git clone https://github.com/JackMechem/open-stomp-lib
pip install ./open-stomp-lib/bindings/python

For working on the bindings themselves, build in place with maturin develop instead (development).

Check the install ​

sh
python -c "import open_stomp; print(open_stomp.__version__)"

First script ​

This connects to the pedal, waits for the startup sync, turns the active preset's amp gain up, then prints everything that happens.

python
from open_stomp import Device, DeviceState, Module

state = DeviceState()
with Device() as dev:                         # finds and connects to the pedal by itself
    for u in dev:                             # blocks; Ctrl-C to stop
        ev = state.feed(u)                    # applies messages, resets on reconnect
        if ev and ev.category != "protocol" and not ev.redundant:
            print(ev)                         # AMP      Mar J800 · GAIN = 64
        if u.kind == "sync" and u.total == 0 and state.current is not None:
            dev.set_param(Module.AMP, 0, 100) # turn the active preset's gain up

Send after the sync

The engine refuses edits until it is connected (you get an "info" update with error=True). Waiting for the end of the startup sync also means state knows the pedal's presets.

Import a NAM model and a cab IR ​

Slots are 0–9 (USER AMP 01–10, USER IR 01–10). An import overwrites what is in the slot.

python
dev.import_nam_file(9, "Ampeg SVT.nam")    # optimised conversion, about a minute
dev.import_ir_file(9, "Ampeg 8x10.wav")    # optimised conversion, under a second

Or convert without a pedal and look at the result:

python
from open_stomp import nam, ir

model = nam.Model.load("Ampeg SVT.nam")
c = nam.convert(model, measure="optimised")   # c.data: the 2048 floats the pedal gets
samples = [0.0] * 48000                       # your own audio: mono, 48 kHz
out = model.process(samples)                  # run the model on it
cab = ir.convert("Ampeg 8x10.wav", method="optimised")

See User AMP and IR slots and Converting NAM models.

Example scripts ​

A checkout has two ready-made scripts in bindings/python/examples/:

ScriptWhat it does
monitor.pyFollows the pedal and prints every event. Flags: --listen (send nothing), --port NAME, --replay LOG, --speed N, --all (include protocol plumbing and repeats)
shell.pyAn interactive shell over the whole API: inspect presets and state, send live edits, back up, save presets and settings (with confirmation). -c CMD runs commands after the sync, then exits; help lists the commands
sh
python bindings/python/examples/monitor.py
python bindings/python/examples/monitor.py --replay captures/logs/01-main-session.log --speed 8
python bindings/python/examples/shell.py -c status -c "show live"

Next ​

MIT or Apache-2.0. Not affiliated with SORAN.