psyn/control.h

17 lines
299 B
C

struct control_t
{
float value;
float step;
};
static inline void control_setstep(struct control_t *control, float value, uint32_t samples)
{
control->step = (value - control->value) / samples;
}
static inline void control_tick(struct control_t *control)
{
control->value += control->step;
}