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
selector.hpp File Reference

A continuous control read as one of N positions. More...

Detailed Description

A continuous control read as one of N positions.

For a knob, a fader or a CC standing in for a switch. select() is the stateless form: N equal shares of the control's travel. Selector adds hysteresis, so a control resting on a boundary does not chatter between two positions.

const uint8_t ratio = sbl::control::select(loop_ratio, 3); // 0, 1 or 2
const uint8_t position = selector.update(knob.smoothed());
uint8_t update(float control)
Definition selector.hpp:50
constexpr uint8_t select(float control, uint8_t positions)
Definition selector.hpp:29

Definition in file selector.hpp.

#include <cstdint>

Go to the source code of this file.

Classes

class  sbl::control::Selector< Positions >
 

Namespaces

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

Functions

constexpr uint8_t sbl::control::select (float control, uint8_t positions)