Fixes; additional input filtering

This commit is contained in:
Brian Hrebec 2023-08-30 19:49:22 -05:00
parent 209959e2de
commit 7740c09375
11 changed files with 802 additions and 513 deletions

View file

@ -18,6 +18,9 @@
// A note is sounding
#define NOTE_ON 3
// We turned the note off due to a HF spike
#define SPIKE_HOLD 4
enum PinkyMode : uint8_t {
PBD = 12,
GLD = 25,
@ -86,6 +89,7 @@ struct instrument_state_t {
// Raw sensor signals
int16_t breathSignal = 0; // breath level (smoothed) not mapped to CC value
int16_t breathAltSignal = 0;
int16_t spikeSignal = 0; // breath level (smoothed) not mapped to CC value
int16_t biteSignal = 0; // capacitance data from bite sensor, for midi cc and threshold checks
int16_t leverSignal = 0;
int16_t pbUpSignal = 0;
@ -130,6 +134,10 @@ struct instrument_state_t {
extern const std::array<const unsigned short*, 13> curves;
extern const unsigned short curveIn[];
// Re-zero floating calibration values
extern void rezero();
extern void fullAutoCal();
extern unsigned int multiMap(unsigned short val, const unsigned short * _in, const unsigned short * _out, uint8_t size);
#define mapConstrain(val, in_lo, in_hi, out_lo, out_hi) map(constrain(val, in_lo, in_hi), in_lo, in_hi, out_lo, out_hi)