User AMP and IR slots
How to import NAM amp models and cab IRs into the pedal's user slots, and how to rename, delete and read them back. For the conversion options, see Converting NAM models; for the wire format, NAM and IR uploads.
Slot numbering
The pedal has 10 user AMP slots and 10 user IR slots. Every call takes a 0-based slot.
slot | On the pedal | Amp or cab model |
|---|---|---|
| 0 | USER AMP 01 / USER IR 01 | 30 |
| 1 | USER AMP 02 / USER IR 02 | 31 |
| … | … | … |
| 9 | USER AMP 10 / USER IR 10 | 39 |
- Model number =
upload::USER_MODEL_BASE(30) + slot, in the AMP or CAB block. Select it withset_head(Module::Amp, 30 + slot, true). - Slot count:
upload::USER_SLOTS(10). - Data: each slot holds 2048 floats (
upload::UPLOAD_FLOATS), sent as 8192 bytes.
Imports overwrite the slot
An import replaces whatever is in the slot, with no undo. Read the slot back first if you want to keep it (below).
Import a file
The simplest way: convert and upload in one call.
dev.import_nam_file(2, "Jcm800.nam")?; // optimised conversion + upload to USER AMP 03
dev.import_ir_file(0, "My Cab.wav")?; // optimised conversion + upload to USER IR 01dev.import_nam_file(2, "Jcm800.nam") # optimised conversion + upload to USER AMP 03
dev.import_ir_file(0, "My Cab.wav") # optimised conversion + upload to USER IR 01- Names: the slot is named after the file, like the official app does (
Jcm800,My Cab). IR names are cut to the first 16 characters. - Return value: the conversion (
nam::Converted/ir::ConvertedIr), so you can inspect or cache it. - Timing: the NAM conversion runs on the calling thread and takes about a minute in an optimised build (Python releases the GIL meanwhile). An IR conversion takes under a second. The upload itself takes under a second over USB, about 10 s over Bluetooth.
- Never reads the official app: these calls use open-stomp's own converter.
| Rust | Python | Conversion | Level |
|---|---|---|---|
import_nam_file(slot, path) | import_nam_file(slot, path) | Optimised | Normalised |
import_nam_file_with(slot, path, Measure::App) | import_nam_file(slot, path, measure="app", normalise=False) | The official app's algorithm (a few seconds) | The model's own |
import_nam_file_as(slot, path, measure, normalise) | import_nam_file(slot, path, measure=…, normalise=…) | App, Clean or Optimised | Your choice |
import_ir_file(slot, path) | import_ir_file(slot, path) | Optimised (a 384-tap fit to the whole IR) | The app's |
import_ir_file_with(slot, path, ir::Method::App) | import_ir_file(slot, path, method="app") | Exactly the official conversion | The app's |
Python defaults
Python's import_nam_file normalises the level by default for every measure; Rust's import_nam_file_with never does. Pass normalise=False to keep a model's own level, as the official app does.
- Without the
namfeature (Rust),import_nam_file*don't exist andimport_ir_filefalls back to the official conversion (feature flags). - What the options mean: Converting NAM models.
Import converted data
If you already have the 2048 floats (from nam::convert, ir::convert, a cache, or a captured upload), upload them directly:
// data: 2048 converted floats
dev.import_user_amp(2, "Jcm800", &data, 1.0)?; // USER AMP 03
dev.import_user_ir(0, "My Cab", &data)?; // USER IR 01dev.import_user_amp(2, "Jcm800", floats) # USER AMP 03 (factor=1.0 by default)
dev.import_user_ir(0, "My Cab", floats) # USER IR 01Both send the official app's sequences, tested byte for byte against every captured import:
| Call | Sends |
|---|---|
import_user_amp(slot, name, data, factor) | Selects amp model 30 + slot, writes the slot-info record (name, gain factor), then 61 data chunks. The factor is 1.0 in every official import |
import_user_ir(slot, name, data) | Shows the CAB page, selects cab model 30 + slot, sends 61 data chunks, then the 0x09 name write |
Each chunk waits for its ack before the next goes out. upload::Reassembler turns captured chunks back into floats, so a captured conversion can be uploaded to any slot.
Rename a slot
dev.rename_user_amp(2, "Marshall JCM800")?; // only the name; the sound stays as it is
dev.rename_user_ir(0, "SVT 8x10 57")?;dev.rename_user_amp(2, "Marshall JCM800") # only the name; the sound stays as it is
dev.rename_user_ir(0, "SVT 8x10 57")- What it sends: only the name record of an import (the AMP slot-info write, the IR
0x09name write), then a re-read of the slot. - The sound is unchanged: confirmed on the pedal; a slot's sweep response before and after differs by at most 0.09 dB (rig noise).
- Names are cut to 31 characters. The official app's IR imports use at most 16.
- The official app can't rename a slot; this is an open-stomp addition (since 0.5.1).
Delete a slot
dev.delete_user_amp(2)?; // deletes USER AMP 03 and re-reads its infodev.delete_user_amp(2)This sends the official app's delete and re-reads the slot's info, like the app. The library has no call to delete a user IR slot.
Read a slot back
read_user_amp(slot) and read_user_ir(slot) ask the pedal for a slot's 2048 floats. Rust only for now; they are not in the Python bindings.
- Replies: 61
Update::Messages, one per 136-byte chunk:0x58(AMP) or0x10(IR) withdir2. Collect them withupload::Reassembler. - Origin: the official app never does this. It was found by probing and checked byte for byte on the pedal (since 0.6.2).
- Use: back a slot up before overwriting it, or check what an upload stored.
use open_stomp::device::Update;
use open_stomp::midi::{Cmd, Msg};
use open_stomp::upload::{Chunk, Reassembler, amp_sub};
dev.read_user_amp(2)?; // USER AMP 03
let mut slot_data = Reassembler::default();
while let Ok(update) = dev.recv() {
let Update::Message { bytes, .. } = update else { continue };
let Msg::Nep { cmd, dir: 2, payload } = Msg::parse(&bytes) else { continue };
if cmd != Cmd::UserAmp as u8 {
continue;
}
let Some(chunk) = Chunk::parse(&payload) else { continue };
if chunk.sub != amp_sub::READ_DATA {
continue;
}
if let Some((slot, floats)) = slot_data.push(&chunk) {
println!("USER AMP {:02}: {} floats", slot + 1, floats.len());
break;
}
}For an IR slot, call read_user_ir and match Cmd::IrData with upload::IR_DATA_SUB. Keep applying the other updates to your DeviceState as usual.
Errors
The upload calls check the slot and the data before sending anything.
Rust UploadError | Cause | Python |
|---|---|---|
Slot(n) | Slot outside 0–9 | ValueError |
Length(n) | Not exactly 2048 floats | ValueError |
NotFinite | NaN or infinite values | ValueError |
import_nam_file*/import_ir_file*returnBox<dyn Error + Send + Sync>in Rust, wrapping theUploadError, anam::NamError(bad or unsupported model) or a WAV / I/O error. Python raisesOSErrorfor file errors andValueErrorfor the rest.- Refused sends: if the engine isn't connected (or is listen-only), the call still returns
Okbut the engine refuses the upload with anUpdate::Info { error: true }(connecting). - Validate without a device:
upload::check(slot, &data).
Upload building blocks
For your own transport, the upload module builds the same frames the engine sends:
| Function | Returns |
|---|---|
user_amp_upload(&UserAmpInfo, &data) | Slot-info write + data chunks (select amp model 30 + slot just before, as the app does) |
user_ir_upload(slot, name, &data) | Data chunks + name write (select cab model 30 + slot just before) |
user_amp_delete(slot) | The delete write |
user_ir_name(slot, name) | The 0x09 name write |
user_amp_read(slot), user_ir_read(slot) | 61 read requests (Rust only) |
UserAmpInfo::new(slot, name, factor), parse, to_raw, write_frame | The 128-byte slot-info record, kept whole so unknown bytes survive |
Chunk::parse, to_packed; Reassembler | One chunk; collecting chunks back into floats |
data_frames(cmd, slot, sub, &bytes), floats_to_bytes, bytes_to_floats | Low-level framing |
Constants: CHUNK_BYTES (136, i.e. 34 floats), UPLOAD_FLOATS (2048), USER_SLOTS (10), USER_MODEL_BASE (30), AMP_INFO_LEN (128), IR_DATA_SUB, and the amp_sub sub-commands (Python: AMP_SUB_*).
