21 lines
No EOL
713 B
C++
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;
|
|
} |