Commit 09aaf055 by PLN (Algolia)

fix(lcxl3): the lap clock could not survive its first tick — and values echo home

Two things, one restart.

The 10-second home-refresh ticker read last_home, which was never initialised:
my init patch targeted the pre-merge line and the merged code had renamed it
(last_labels joined the chain), so the replace silently no-opped — I had
asserted every replacement in that patch EXCEPT this one. The driver died at
its first tick, 10 s after start, while the surface kept showing the labels
the startup had already written: a dead translator behind a live-looking
display. Fixed, and verified past the tick this time.

And the stuck "0" PLN saw on row 3: arrangement 4's numeric value is drawn by
the FIRMWARE from its own internal control value, which never moves for a
relative encoder — the driver owns those values now. So the driver echoes each
integrated value back to the device on the encoder's own CC (plain DAW-style
feedback). --no-echo exists in case the echo ever fights the RGB paint; the
2 s paint reassert heals any skirmish regardless.

Next display experiment, deliberately not built blind: arrangement 1
(host-supplied TEXT value) on per-control targets, which would let
probability-style constructs (sometimesBy / someCyclesBy / midiOn ranges)
read as percentages instead of 0-127.
parent e7e441a9
......@@ -761,7 +761,7 @@ class Driver:
signal.signal(signal.SIGTERM, onsig)
print("\ntranslating — ctrl-c to stop\n")
last_recon = last_pulse = last_assert = last_labels = time.time()
last_recon = last_pulse = last_assert = last_labels = last_home = time.time()
while not self._stop:
for msg in self.surface.inp.iter_pending():
self.stats["in"] += 1
......@@ -797,6 +797,17 @@ class Driver:
if self.lang:
self.paint_cell(v2)
self.oled_touch(v2, value)
if not self.args.no_echo:
# DAW-style feedback: the firmware's per-control
# display draws ITS OWN numeric value, which never
# moves for a relative encoder (the driver owns the
# value). Echo the integrated value back on the
# encoder's own CC so the number on row 3 is true.
# If this ever fights the RGB paint, --no-echo; the
# 2 s reassert heals any ring skirmish meanwhile.
self.surface.out.send(mido.Message(
"control_change", channel=msg.channel,
control=base, value=value))
if self.args.verbose:
print(f" {L.control_name(base):<16} rel {d:+3d} "
f"-> v2 #{v2:<3} = {value}")
......@@ -952,6 +963,10 @@ def main(argv: list[str] | None = None) -> int:
"touched-control context). Needs --track for the mapped set.")
p.add_argument("--track", help=".tidal file whose ^NN set defines what is LIVE; "
"everything else paints dark (dark = unmapped)")
p.add_argument("--no-echo", action="store_true",
help="do not echo integrated encoder values back to the "
"device (the echo is what makes the firmware's numeric "
"display track relative encoders)")
p.add_argument("--no-latch", action="store_true",
help="row-E buttons pass through momentary instead of the "
"driver-owned toggle latch")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment