Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
param_bank.hpp File Reference

An app's parameters: one merge each, their defaults, and a reset. More...

Detailed Description

An app's parameters: one merge each, their defaults, and a reset.

The merge layer of the control tick for a parameter list declared in the app's params manifest. Each parameter has one merge, by default Latest: the last source to move it holds it. Polled sources, a knob read every tick, report through poll(); event sources, a CC, through write().

Seeding. Until its first update, and again after reset(), a bank is due a seed: begin_update() writes every parameter's default, and the polls of that update take their parameters outright, so a parameter with a knob starts on its knob and the rest on their defaults. reset() is what MIDI's Reset All Controllers asks for.

Context
The control tick only. Stage order: events write in Drain; the polls and begin_update() run in Update; the app reads value() in Merge.
using Param = sbl::app::Param;
enum : uint8_t { SRC_KNOB, SRC_CC };
params.write(SRC_CC, Param::Mass, 0.25f); // Drain: a CC
const bool seeded = params.begin_update(sbl::app::PARAM_DEFAULTS, SRC_CC); // Update
sbl::app::for_each_control(board, [](Param p, const auto& control) {
params.poll(SRC_KNOB, p, control.smoothed());
});
controls.mass = params.value(Param::Mass); // Merge
bool begin_update(const float(&defaults)[Count], uint8_t source)
void write(uint8_t source, Param param, float value)
void poll(uint8_t source, Param param, float value)
float value(Param param) const

Definition in file param_bank.hpp.

#include <cstdint>
#include <sbl/control/merge.hpp>

Go to the source code of this file.

Classes

class  sbl::control::ParamBank< Param, Count, Sources, Merge >
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::control
 The control stack: scheduler, event queue, merge, CC mapping, calibration.