Skip to content

MIDI VFO tuning: binary 0/127 encoder direction wrong; step size ignores UI setting #2993

Description

@M8WLO

Bug Report

AetherSDR version: 26.5.2.1
Radio: FLEX-8600, firmware 4.2.18
OS: Windows 11 Pro

Description

Two related bugs in the MIDI VFO tuning (rx.tuneKnob) path.

Bug 1 — Binary 0/127 encoder: wrong direction / one direction dead

When a MIDI controller uses binary relative encoding (CW = CC value 127, CCW = CC value 0) — the style used by MidiController and handled as "standard" in Thetis — AetherSDR's VFO tuning misbehaves:

  • Value 127 (CW): relativeCcDelta(127) returns -1 (two's-complement CCW), so the VFO tunes in the wrong direction.
  • Value 0 (CCW): relativeCcDelta(0) returns 0, so the VFO does not move at all.

Thetis handles this correctly via ProcessStdMIDIWheelAsVFO, treating direction > 125 as CW and anything <= 125 (including 0) as CCW.

Bug 2 — Step size UI control does not affect MIDI tuning

The relativeAction MIDI handler in MainWindow reads s->stepHz(), which is only updated after the radio acknowledges a slice set step=N round-trip. Changing the step size in AetherSDR's UI does not immediately affect MIDI VFO steps, even though the same change immediately affects keyboard and HID encoder tuning (both use spectrum()->stepSize()).

Steps to Reproduce

  1. Bind a relative encoder to rx.tuneKnob via MIDI Learn.
  2. Use a controller that sends binary 0/127 relative CC.
  3. Turn CW: VFO tunes CCW (wrong direction).
  4. Turn CCW: VFO does not move.
  5. Change step size in AetherSDR UI: MIDI step is unchanged.

Root Cause

relativeCcDelta is a two's-complement decoder: 127 decodes as -1 (CCW) and 0 decodes as 0 (no movement). Binary/Thetis convention treats 127 as CW (+1) and 0 as CCW (-1).

The relativeAction handler uses s->stepHz() (radio echo delayed) rather than spectrum()->stepSize() (immediate), inconsistent with keyboard and HID encoder paths.

Fix

  • Override two's-complement decode for values 0 and 127 on the VFO binding: treat as binary unit pulses (0 = -1 CCW, 127 = +1 CW). Extend backward-compat tier to handle center-64 encoded controllers.
  • In MainWindow relativeAction handler, use spectrum()->stepSize() (with s->stepHz() fallback), matching keyboard and HID encoder behaviour.

Principle VIII (Evidence Over Assertion): root cause confirmed by comparing AetherSDR decode path against Thetis Midi2CatCommands.cs source.
Principle XI (Fixes Are Demonstrated): fix confirmed on real FLEX-8600 hardware.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions