Skip to content

feat: let apps write back their own params and notify the host - #640

Closed
kosmar wants to merge 1 commit into
ATOVproject:mainfrom
kosmar:feat/app-param-writeback
Closed

kosmar wants to merge 1 commit into
ATOVproject:mainfrom
kosmar:feat/app-param-writeback

Conversation

@kosmar

@kosmar kosmar commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Params travel host→device: the configurator sets them, the app reads them. An
app that lets the user pick a value on the hardware (a gesture that cycles a
genre or a voice, say) has no way to close the loop — the value is neither
persisted nor reflected, so the configurator keeps showing the old one until
the app task restarts.

Adds ParamStore::update(), which mutates, saves, and pushes the new values to
the host.

The push needs its own channel. APP_PARAM_CHANNEL carries request/response
replies, and an unsolicited push queued there gets drained as a stale reply to
a later GetAppParams — the host would see the wrong layout's state. So
APP_PARAM_PUSH_CHANNEL is separate, and the config loop selects on it while
idle. The select is cancel-safe: read_msg awaits on the frame channel, so no
partial frame is lost when the select flips.

#[allow(dead_code)] because the first callers are the WIP app branches
(#633, #604), which cannot compile against main without this.

Note for review: cargo clippy -D warnings currently fails on main itself
with a chunks_exact lint in tasks/midi.rs, unrelated to this change.

Test checklist (hardware)

  • Configurator open, change a param on the device (Bassment genre gesture):
    the configurator updates live without a reconnect
  • The changed value survives a power cycle
  • GetAppParams for another layout still returns that layout's own state
    (no stale reply crossover)

Made with Cursor

@ArthurGibert

ArthurGibert commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Hi @kosmar ,

This is a significant UX change that I am not sure we'll go forward with.

Here is the reasoning. Parameters are meant to be set and forget settings and are meant to be fixed and never change unless the user changes it with the configurator. Anything that is that is dynamic has to be accessible with the channel UI and have LED feedback.

This goes with the UX intent that we have with Faderpunk which is to have a two stage workflow. First, one would create their layout and set the params. Second, the user would use the setup they created to perform and play the Faderpunk. The goal if this UX is to replicate the workflow of a modular synth were one select modules and put them into a case with limited space and play with it.

The goal of this are:

  • Dissociate the performance aspect from the setup aspect and make Faderpunk feel like a instrument despite its morphability.
  • Make the user stick with the apps for a longer period of time to make the user learn the function and sub functions of the device.

I want to avoid the dependence to the configurator for any apps.

Now, these are not points that are blocking this PR but I'd like to consider this longer.

However I don't think the implementation of this PR should be a blocker for all the apps that are currently stacked on top of it. I would suggest that the apps stacked on this PR are modified so that these can be reviewed independently.

@kosmar

kosmar commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

i think its mainly #642, that wants this. but more a convenience than necessity.
the idea is nice, i probably would not need a Pull button on presetpunk anymore, but its no roadblock for me, if we dont get it.

@kosmar

kosmar commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor Author

only UX issue might be:
eg #642 allows to change settings via device interaction that are also config fields,
im not sure if other apps do that for smth like base notes or voltage ranges.
which means the config doesnt show the reality when the device is reconnected.
both behaviours are a tradeoff in some way.

kosmar added a commit to kosmar/faderpunk that referenced this pull request Aug 14, 2026
ParamStore writeback push stays out; apps use the save-only polyfill.

Authored by an AI coding agent on behalf of kosmar.

Co-authored-by: Cursor <cursoragent@cursor.com>
kosmar added a commit to kosmar/faderpunk that referenced this pull request Aug 14, 2026
Keep Mode B/C/D as configurator params for setup. On-device Shift+long
writes scene storage (survives jack reconfigure restart) and calls
params.update so ParamStore/FRAM stay aligned. Host UI stays stale
until ATOVproject#640 adds the AppState push.

Authored by an AI coding agent on behalf of kosmar.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kosmar

kosmar commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Split the non-blocking part into #647: ParamStore::update that mutates + saves to FRAM only (no host push). That unblocks the WIP apps that already call params.update without waiting on the configurator live-sync UX discussion here. When you are ready for the AppState push, it can land on top of #647 as a drop-in.

@ArthurGibert

Copy link
Copy Markdown
Member

Superseded by #691, which takes a different approach: the device never pushes an unsolicited message (that broke the open configurator — see the review on this PR), and it adds the SDK mirror needed for installed apps to actually use this, which this PR never had. Thanks for opening the discussion that led to it.

ArthurGibert added a commit that referenced this pull request Sep 17, 2026
Replaces #640. Apps can change their own parameters (a panel gesture that picks a value the user could otherwise only set from the configurator), and the change reaches the configurator without a reconnect. The device never pushes an unsolicited message; the configurator polls GetChangedAppParams alongside its existing connection check. ParamStore::update() persists and marks a channel dirty on both the firmware store and its fpapp-sdk mirror, so installed apps get it too. Also fixes the configurator never displaying a live update: react-hook-form's fields are uncontrolled and never revisit a changed defaultValue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants