Skip to content

openvave 0.4.0

Latest

Choose a tag to compare

@gustavolima00 gustavolima00 released this 18 Nov 21:07
· 61 commits to main since this release

Remote editing without edit mode, and the first release that can change stored presets:
set now works in normal mode, preset reload discards edits, bypass and loopback toggle
volatile state, and preset save / preset restore write stored presets behind --unsafe and
an automatic, verified backup. Every new message was first sent by openvave on the owner's pedal
(fw 96) in two gate sessions, with a backup before and after each step.

Added

  • Several fields over one connection: openvave set gain=95 treble=58 reverb_decay=room:18 delay_on=on led_colour=#2040ff --experimental. One session reads the pedal once, sends every
    knob field in a single knob-block write (rebuilt from that read), then each block switch and the
    LED colour, and checks each write's ACK and re-read before the next. Typed knobs take
    POSITION, TYPE:POSITION or raw:N. The batch is refused as a whole, with nothing sent, if
    any field is; fields already set are skipped. --dry-run prints every frame; --json prints
    a set-fields-result.schema.json document, also when the batch stops midway. A failure
    mid-batch (NAK, lost link, re-read differs) stops without retrying and lists every field as
    applied / unknown / not applied / not sent. The set FIELD VALUE [--type | --raw] form is
    unchanged. Library: TankG.plan_set_fields(changes) / set_fields(changes), new types
    EditPlan, EditWrite, FieldEdit, EditResult, EditWriteOutcome, and
    OpenvaveError.edit (the partial result on an error raised mid-batch).

  • openvave preset reload [--discard-edits] [--dry-run] / TankG.reload_preset() /
    TankG.plan_reload(): discards unsaved edits by selecting the loaded preset again (the
    confirmed preset-select write) and verifies the buffer equals the stored preset. Nothing is sent
    when there is nothing to discard; edit mode needs --discard-edits.

  • Reverb types for the decay knob, named as in the Tank-G manual: room, spring, cloud
    (the app's blue, orange, green sections; between two types the reverb is off).
    openvave set reverb_decay 10 --type spring; without --type the preset's current type is
    kept (refusal type_required when the knob sits between two types); --raw 53 writes the raw
    byte. Library: set_field("reverb_decay", ("spring", 10)), (None, 10) to keep the type,
    openvave.protocol.REVERB_TYPES, TYPED_FIELDS, type_raw(), type_parts(). Output shows
    both readings (5 (room 6) → 53 (spring 10)).

  • The same for MOD FX (chorus, phaser, tremolo) and DLY MIX (analog, tape, dual):
    set mod_fx 20 --type phaser, set delay_mix 30 --type tape; preset dump / watch show
    type: chorus 1. Their split was checked against the phone app on the pedal (15 readings, all
    fit). openvave.protocol.MOD_FX_TYPES, DELAY_MIX_TYPES.

  • Bypass: openvave bypass on [--discard-edits] sends 01 to
    0xE1000000 + i for the loaded preset (normal mode only) and reports applied when the pedal
    reads slot ff with an all-zero buffer, then prints Leave bypass: openvave bypass off 1B.
    openvave bypass off <position> leaves bypass with the confirmed preset select, only when the
    pedal is bypassed (refusal not_bypassed otherwise); without a position it exits 2 and names
    the bank the pedal reports. Library: TankG.plan_bypass_on() / bypass_on() (result
    return_index), plan_bypass_off(i) / bypass_off(i), WriteTarget.bypass(i). The message is
    confirmed on fw 96 (spec 004 gate sessions A and B), so bypass on runs without
    --experimental.

  • Loopback (experimental): openvave loopback on|off reads the status byte (0xD0000000),
    writes 01/00, and reads it back; never followed by a commit; an equal value sends nothing.
    Library: TankG.plan_loopback(on) / set_loopback(on), WriteTarget.loopback(). Message
    observed: on mixes the pedal's Bluetooth audio (e.g. a phone backing track) into the USB
    recording, off leaves it out (still heard); the flag persists across a power cycle.

  • WriteTarget.persistent and refusal reasons edit_mode and not_bypassed. The write
    allowlist grows by the two volatile kinds above; bypass data other than 01, an index above 35,
    loopback data other than 00/01 or any other length stay unencodable.

  • Save (UNSAFE): openvave preset save [--to POSITION] --unsafe stores the edit
    buffer in the loaded slot (or --to), normal mode only, with the phone app's sequence: slot
    write to 2 + 21·i (21 bytes), read back (a mismatch stops before the commit), 300 ms, the
    empty commit write to 0xF0000000, 100 ms, select, then verifies stored slot, position and
    buffer. Nothing to save: 1C already holds this sound; nothing sent. Library:
    TankG.plan_save(to) / save_preset(to, unsafe=True, on_backup=…). The slot write and the
    commit are confirmed on fw 96 (gate sessions A and B).

  • Restore (UNSAFE): openvave preset restore FILE (--slot POSITION | --all) --unsafe writes back an openvave backup file, checked before connecting
    (openvave.backup.restore_problems). --slot uses the save sequence with the file's bytes;
    --all writes the whole 758-byte image to 0x0 in one message (split over several Bluetooth
    writes by the transport), commits, selects the preset that was loaded and verifies with a full
    read. Lists the slots that differ; nothing differs → nothing sent. A file from another firmware
    needs --experimental (firmware_mismatch); unsaved edits need --discard-edits. Library:
    TankG.plan_restore(backup, slot=i | all=True) / restore(...). The slot write, the image
    write and the commit are confirmed on fw 96 (gate sessions A and B).

  • Both take an automatic backup before the first write
    (tankg-backup-<time>-before-save|restore.json in --backup-dir, never overwriting) and stop
    if it fails its cross-check or cannot be written. A failure mid-sequence prints every step
    (ACK / NAK / no reply / not sent), whether stored presets may have changed, and the recovery
    commands; nothing is retried. Exit codes as before (1 refused, 6 lost link, 7 NAK, 8 read-back
    differs). JSON: sequence-result.schema.json.

  • New opt-in --unsafe (unsafe=True), required by every command that changes stored presets and
    never implied by --experimental; refusal reasons unsafe_required and firmware_mismatch.

  • Three persistent write targets, WriteTarget.stored_slot(i), .commit() and
    .stored_image() (persistent is true for them), rows in "Write messages" at confirmed
    on fw 96 (spec 004 gate sessions A and B), so save and restore run without --experimental;
    --unsafe is still required. Only save_preset / restore send them, only with
    unsafe=True, after the backup. Library types SequencePlan, SequenceStep,
    SequenceResult, StepOutcome; errors raised mid-sequence carry .sequence.

  • The BLE transport splits a request longer than one Bluetooth write (ATT MTU − 3) into
    consecutive chunks (only the 773-byte image write needs it; observed at MTU 185: one ACK).

  • Pedal state: openvave.PedalState, openvave.protocol.classify(global, buffer),
    TankG.state() (confirms bypass with a second read 300 ms later) and
    DeviceSnapshot.pedal_state. info and preset dump print a state: line (in bypass: no
    decoded preset fields and bank <n>, slot not reported); watch prints the state in its header
    and a line when it changes (loading for one bypass-looking cycle, bypass for two). JSON adds
    a top-level pedal_state to info and preset dump and to watch --json start and change
    events; existing fields keep their meaning (schema_version 2).

Changed

  • openvave set works in normal mode (spec 004 check 1: the app never enters edit mode, and
    the knob block is applied in normal mode, confirmed over two connections). It is refused in
    tuner mode (tuner_mode), while the pedal is bypassed (bypassed) and in states openvave does
    not recognise (unrecognised_state). The refusal reason not_edit_mode is no longer raised.
    Block switches and led_colour still need --experimental.

  • The "Not saved" line after a write now names the discard command
    (Not saved. Discard: openvave preset reload).

  • openvave can now change stored presets, replacing the 0.3.0 statement that it never saves or
    overwrites one: it does so only through preset save and preset restore, only with --unsafe,
    and always after an automatic, verified backup. Every other write stays volatile.

  • openvave preset dump now also reads the global block (to report the pedal state).

  • Connecting is faster: the Bluetooth scan stops 1 s after the pedal is seen (or as soon as the
    --device identifier is seen) instead of always waiting --scan-timeout (5 s). A second pedal
    seen within that second still gives exit 4. openvave.discover() still scans the whole timeout.
    Measured before: set gain 90 took 11 s on macOS.

  • JSON write results validate against the spec 004 extension of the schema
    (write-result.schema.json):
    commands preset reload, bypass on|off, loopback on|off, target kinds bypass and
    loopback, the new refusal reasons, change region status, and return_index /
    return_position in a bypass on result.

  • A write refused because the pedal is bypassed now points to openvave bypass off <position>.

  • preset dump and watch human output show reverb decay (preset byte 15) as reverb type and
    position: type: room 6 after the field line (off between types), and
    5 (room 6) → 64 (spring 21) in watch changes. JSON is unchanged (schema_version 2, raw value
    only). Library: openvave.cli.render.type_reading(). REVERB_SECTIONS /
    reverb_decay_parts (0.3.0) still give the app's colour reading.

Tested

  • Spec 004 gate session A on a TANK-G v2, fw 96 (2026-11-18), each message sent once by openvave
    with a backup before and after: bypass on/off, MOD switch and LED colour in normal mode, loopback
    off/on (persists across a power cycle; on = Bluetooth audio in the USB recording), save to 1C (persists across a power cycle), restore of
    one slot, the stored-image write as a no-op and as restore all (persists across a power cycle).
    The pedal ended equal to its pre-session backup. Excerpts: captures/fw96/20261118-gate-*.jsonl.
  • Spec 004 gate session B on the same pedal (2026-11-18, after a power cycle, a new connection per
    command, loaded preset 1A, target slot 1D): bypass on/off, save to 1D (persists across a power
    cycle), restore of 1D, and restore all (persists across a power cycle). The pedal ended equal to
    its pre-session backup B0. Bypass, stored slot, commit and stored image are now confirmed;
    loopback, the block switches and the LED colour stay observed. Excerpts:
    captures/fw96/20261118-gate-*_b.jsonl.

Documentation

  • specs/protocol/app-features.md: inventory of the official
    app's Tank-G features and the messages behind each (edit mode, save, bypass, loopback, import /
    export, factory restore), with confidence, risk and a proposed scope for spec 004.