Added input processing to state
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "input.h"
|
||||
#include "vco.h"
|
||||
|
||||
@@ -25,5 +27,17 @@ typedef struct {
|
||||
bool amen_enabled;
|
||||
} state_t;
|
||||
|
||||
static inline float map_linear(float v, float min, float max) {
|
||||
return min + v * (max - min);
|
||||
}
|
||||
|
||||
static inline float map_exponential(float v, float min, float max) {
|
||||
return min + powf(max / min, v);
|
||||
}
|
||||
|
||||
static inline float map_squared(float v, float min, float max) {
|
||||
return min + (v * v) * (max - min);
|
||||
}
|
||||
|
||||
void update_state(state_t* state, input_t* input);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user