Skip to main content

Module upload

Module upload 

Source
Expand description

User AMP (NAM, SysEx 0x58) and user IR (SysEx 0x10 + 0x09) uploads (docs/05).

Both send a converted model as 2048 little-endian f32s (8192 bytes) in chunks of 136 bytes, each a packed SysEx write acknowledged before the next. Every chunk starts with a 12-byte header:

[0] 0   [1] slot   [2] sub-command   [3] 0   [4..8] byte offset (u32 LE)   [8..12] total length (u32 LE)

A user AMP upload is preceded by a 128-byte slot-info record (sub 3) carrying the name and a gain factor; a user IR upload is followed by a 0x09 name write. Converting a .nam or audio file into the 2048 floats is done by the nam and ir modules (docs/05).

Modules§

amp_sub
0x58 sub-commands (unpacked header byte 2).

Structs§

Chunk
One upload chunk (or a header-only request/ack), unpacked.
Reassembler
Collects the data chunks of one upload (in any order) back into its floats.
UserAmpInfo
The 128-byte user AMP slot-info record (0x58 sub 3 write, sub 4 reply), kept whole so unknown bytes survive.

Enums§

UploadError
Why an upload was refused.

Constants§

AMP_INFO_LEN
CHUNK_BYTES
Bytes of payload per chunk (34 floats).
IR_DATA_SUB
0x10 sub-command for IR data.
UPLOAD_FLOATS
Floats per upload, as the official app sends them.
USER_MODEL_BASE
Model number of user slot 0 (USER AMP 01 / USER IR 01).
USER_SLOTS
Number of user AMP slots (amp models 30–39) and user IR slots (cab models 30–39).

Functions§

bytes_to_floats
check
Check a slot and model data before uploading.
data_frames
Split data into CHUNK_BYTES write frames for cmd (0x58 NAM data, 0x10 IR data). The slot goes where each command expects it: header byte 1 for NAM, byte 0 for IR data.
floats_to_bytes
Model data as the little-endian bytes the pedal receives.
user_amp_delete
Delete a user AMP slot (the app re-reads its info afterwards).
user_amp_upload
The official app’s user AMP import: slot-info record, then the model data. The app selects the slot’s amp model (host::head(Module::Amp, 30 + slot, true)) just before.
user_ir_name
The 0x09 user IR name write: <slot> <packed: 01 00 00 00, 32-byte name>. The first field was 1 after an upload (meaning unknown, docs/09).
user_ir_upload
The official app’s user IR import: the data (slot in header byte 0, unlike NAM’s byte 1), then the name. Checked byte for byte against imports into all ten slots (captures/logs/02-ir-tests.log). The app selects the slot’s cab model (host::head(Module::Cab, 30 + slot, true)) just before.