xevi/NuEVI/src/icm.cpp
Brian Hrebec a2f2fb260d Improved menu status display
Added ability to adjust key params from status and load preset
2024-11-09 11:39:35 -06:00

21 lines
No EOL
713 B
C++

#include "hardware.h"
#include "midi.h"
void checkICM(state_t &state) {
icm_result_t icmSignal = readICM();
byte roll = mapConstrain(abs(icmSignal.roll), 0, 40, 127, 0);
if (ExtraControl::CC == state.currentPreset->icmRollMode) {
if (roll != state.instrument->rollCCVal) {
midiSendControlChange(state.currentPreset->icmRollCC, roll);
}
}
state.instrument->rollCCVal = roll;
byte tilt = mapConstrain(abs(icmSignal.tilt), -20, 40, 0, 127);
if (ExtraControl::CC == state.currentPreset->icmTiltMode) {
if (tilt != state.instrument->tiltCCVal) {
midiSendControlChange(state.currentPreset->icmTiltCC, tilt);
}
}
state.instrument->tiltCCVal = tilt;
}