Declare the five momentary actions as write-only triggers - #1
Open
charlesvestal wants to merge 1 commit into
Open
charlesvestal wants to merge 1 commit into
charlesvestal wants to merge 1 commit into
Conversation
Rnd Patch, Init Freq, Rnd Mod, Rnd Pan and Rnd Voice are one-shot actions:
set_param fires on any non-zero write and stores nothing, and get_param
returns a hardcoded "0". They were declared as readable floats 0..1 step 1,
so the host had to treat them as ordinary knobs.
Three consequences on device, all from that one declaration:
- ~200 detents to cross 0..1, because a float's declared step is not used
for the detent size (the host derives it from the range)
- the value visibly snaps back, because the read cursor re-reads and
get_param always answers "0"
- they draw as value knobs rather than as buttons
Declaring them enum + access:"write" gives the behaviour they were always
meant to have: fire on a single jog-click, no read-back, and the host's
existing bang widget with its flash animation.
No engine change. The host sends "1" for a write-only trigger, which the
existing `if (atof(val)!=0)` already fires on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi — I hit this while poking at knob behaviour across a few modules on my Move, and Essaim turned out to have a clean one-line-per-param fix. Five params behave as one-shot actions but are declared as ordinary readable floats, so the host has no choice but to treat them as knobs.
What's happening
Rnd Patch,Init Freq,Rnd Mod,Rnd PanandRnd Voiceare momentary. Inessaim.c:But they're declared as values:
{"key":"rnd_patch","name":"Rnd Patch","type":"float","min":0,"max":1,"step":1}Three symptoms on device, all from that single declaration:
stepisn't used for detent size — the host derives it from the range (perDetentStepinknob_engine.mjshonourssteponly forint). Sostep: 1has no effect and each detent moves 0.005.get_paramalways answers"0", so the display reverts.The change
Declaration only — one line per param:
access: "write"is the host's existing declaration for a momentary action. It gives you:isTurnablefalse, so it stops occupying a knob as a valueNo engine change needed
Worth being explicit, since it's the part that could have bitten: for a write-only param the host sends the option index, i.e. the string
"1". I checked this through the host's own code rather than assuming —isTriggerisTurnableatof(val)!=0fires?"1.000""1"So your existing
if (atof(val)!=0)handler fires unchanged.get_paramreturning"0"is now simply never called for these, and I left it alone.One thing to avoid if you tweak this: don't add
options_as_string. That switches the wire to the option label ("Trigger"),atofgives 0, and the actions would silently stop firing.The
"Idle"/"Trigger"strings are deliberately plain ASCII — the bang widget draws no text, but the labels still surface in the list editor and to the screen reader, and the 5x7 font atlas can't render an em-dash.Testing
Verified the metadata resolution and wire format against the host's
param_meta/param_formatmodules, and confirmed thechain_paramsJSON still parses (34 entries). I have not rebuilt the module or run it on hardware — I don't have your build set up — so a quick on-device check that the five still fire would be worth doing before merging.Thanks for Essaim, it's a lovely thing to have on the Move.
Disclosure: I used Claude to help investigate and draft this. The diff is five declaration lines and I verified the wire-format claim above myself.