Parameters
Smoothed, range-clamped values — the unit ui_menu edits and the encoder drives
A params_t holds a target and a smoothed current value. You set the target; param_update_fast() walks val toward it and returns true on the frames it changed, which is your cue to redraw. Set refresh = true or val never follows target.
Driving a param from the encoder
// in tick() param_write_delta_coarse(&m->cutoff, os_controls_encoder_get_delta()); if (param_update_fast(&m->cutoff, m)) m->dirty = true; // in redraw() gfx_draw_strf(gfx, 10, 40, "cutoff %d%%", (int)(param_val_percent(&m->cutoff) * 100));
Put the same params_t in a ui_menu_node_t's param field and the menu edits it for you — the two paths are interchangeable.
Note — There is no param_init(): it hands back a slot from a firmware-owned pool. Declare params_t values in your own model and fill the fields directly.
Set the value immediately (clamped to min/max), skipping smoothing
| params_t* | param | |
| const float | value |
Set the value with no clamp and no smoothing — fast path for audio code
| params_t* | param | |
| const float | value |
Set the target; `val` then eases toward it on param_update_fast()
| params_t* | param | |
| const float | value |
Add to the target (clamped)
| params_t* | param | |
| const float | value |
Subtract from the target (clamped)
| params_t* | param | |
| const float | value |
Advance `val` toward `target`; true if it moved this call (redraw cue)
| params_t* | param | |
| void* | ctx |
Advance `val` toward `target` without firing the callback
| params_t* | param |
Did the value change since the last check?
| const params_t* | param |
Apply an encoder delta using the param's `coarse` step
| params_t* | param | |
| int32_t | acc |
Apply an encoder delta using the param's `fine` step
| params_t* | param | |
| int32_t | acc |
Called whenever the value changes; receives the param and your ctx
| params_t* | param | |
| void (*callback)(params_t* self, void* context) |
Raw current value, before range mapping
| const params_t* | param |
Current value rescaled from the param's range into [min, max]
| const params_t* | param | |
| const float | min | |
| const float | max |
Current value as 0.0-1.0 across the param's own range
| const params_t* | param |
Do two params hold the same value?
| const params_t* | p1 | |
| const params_t* | p2 |