Cleanup pair octaves
This commit is contained in:
parent
00cdfc08e0
commit
c09177c0ee
9 changed files with 119 additions and 70 deletions
25
NuEVI/src/icm.cpp
Normal file
25
NuEVI/src/icm.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include "hardware.h"
|
||||
#include "midi.h"
|
||||
|
||||
void checkICM(state_t &state) {
|
||||
icm_result_t icmSignal = readICM();
|
||||
Serial.print(">roll: ");
|
||||
Serial.println(icmSignal.roll);
|
||||
Serial.print(">tilt: ");
|
||||
Serial.println(icmSignal.tilt);
|
||||
if (ExtraControl::CC == state.currentPreset->icmRollMode) {
|
||||
byte roll = mapConstrain(abs(icmSignal.roll), 0, 40, 127, 0);
|
||||
if (roll != state.instrument->rollCCVal) {
|
||||
midiSendControlChange(state.currentPreset->icmRollCC, roll);
|
||||
state.instrument->rollCCVal = roll;
|
||||
}
|
||||
}
|
||||
|
||||
if (ExtraControl::CC == state.currentPreset->icmTiltMode) {
|
||||
byte tilt = mapConstrain(abs(icmSignal.tilt), -20, 40, 0, 127);
|
||||
if (tilt != state.instrument->tiltCCVal) {
|
||||
midiSendControlChange(state.currentPreset->icmTiltCC, tilt);
|
||||
state.instrument->tiltCCVal = tilt;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue