EXTRAS menu page added, with items LEGACY PB, LEGACY BR, GATE HOLD and SPECIAL KEY to enable/disable these special functions.
This commit is contained in:
parent
9f7fbb60c3
commit
1d34681c40
5 changed files with 154 additions and 63 deletions
135
NuEVI/NuEVI.ino
135
NuEVI/NuEVI.ino
|
@ -81,6 +81,9 @@ uint16_t rotations[4]; // semitones { -5, -10, -7, -14 };
|
||||||
uint16_t parallel; // = 7; // semitones
|
uint16_t parallel; // = 7; // semitones
|
||||||
|
|
||||||
byte gateOpen = 0; // setting for gate always open, note on sent for every time fingering changes, no matter the breath status
|
byte gateOpen = 0; // setting for gate always open, note on sent for every time fingering changes, no matter the breath status
|
||||||
|
uint16_t gateOpenEnable = 0;
|
||||||
|
|
||||||
|
uint16_t specialKeyEnable = 0;
|
||||||
|
|
||||||
int touch_Thr = 1300;
|
int touch_Thr = 1300;
|
||||||
|
|
||||||
|
@ -109,8 +112,8 @@ byte activeMIDIchannel; // MIDI channel
|
||||||
byte activePatch=0;
|
byte activePatch=0;
|
||||||
byte doPatchUpdate=0;
|
byte doPatchUpdate=0;
|
||||||
|
|
||||||
byte legacy = 0;
|
uint16_t legacy = 0;
|
||||||
byte legacyBrAct = 0;
|
uint16_t legacyBrAct = 0;
|
||||||
byte halfTime = 0;
|
byte halfTime = 0;
|
||||||
boolean programonce = false;
|
boolean programonce = false;
|
||||||
byte slowMidi = 0;
|
byte slowMidi = 0;
|
||||||
|
@ -350,6 +353,8 @@ void setup() {
|
||||||
legacy = dipSwBits & (1<<1);
|
legacy = dipSwBits & (1<<1);
|
||||||
legacyBrAct = dipSwBits & (1<<2);
|
legacyBrAct = dipSwBits & (1<<2);
|
||||||
slowMidi = dipSwBits & (1<<3);
|
slowMidi = dipSwBits & (1<<3);
|
||||||
|
gateOpenEnable = dipSwBits & (1<<4);
|
||||||
|
specialKeyEnable = dipSwBits & (1<<5);
|
||||||
activePatch = patch;
|
activePatch = patch;
|
||||||
|
|
||||||
touch_Thr = map(ctouchThrVal,ctouchHiLimit,ctouchLoLimit,ttouchLoLimit,ttouchHiLimit);
|
touch_Thr = map(ctouchThrVal,ctouchHiLimit,ctouchLoLimit,ttouchLoLimit,ttouchHiLimit);
|
||||||
|
@ -558,47 +563,54 @@ void loop() {
|
||||||
|
|
||||||
if (analogRead(breathSensorPin) > (breathCalZero - 800)) programonce = false;
|
if (analogRead(breathSensorPin) > (breathCalZero - 800)) programonce = false;
|
||||||
|
|
||||||
specialKey = (touchRead(specialKeyPin) > touch_Thr); //S2 on pcb
|
if (specialKeyEnable) {
|
||||||
if (lastSpecialKey != specialKey) {
|
specialKey = (touchRead(specialKeyPin) > touch_Thr); //S2 on pcb
|
||||||
if (specialKey) {
|
if (lastSpecialKey != specialKey) {
|
||||||
// special key just pressed, check other keys
|
if (specialKey) {
|
||||||
if (K4) {
|
// special key just pressed, check other keys
|
||||||
if (!slurSustain) {
|
if (K4) {
|
||||||
slurSustain = 1;
|
if (!slurSustain) {
|
||||||
parallelChord = 0;
|
slurSustain = 1;
|
||||||
rotatorOn = 0;
|
parallelChord = 0;
|
||||||
} else slurSustain = 0;
|
rotatorOn = 0;
|
||||||
}
|
} else slurSustain = 0;
|
||||||
if (K5) {
|
}
|
||||||
if (!parallelChord) {
|
if (K5) {
|
||||||
parallelChord = 1;
|
if (!parallelChord) {
|
||||||
slurSustain = 0;
|
parallelChord = 1;
|
||||||
rotatorOn = 0;
|
slurSustain = 0;
|
||||||
} else parallelChord = 0;
|
rotatorOn = 0;
|
||||||
}
|
} else parallelChord = 0;
|
||||||
if (K1) {
|
}
|
||||||
if (!subOctaveDouble) {
|
if (K1) {
|
||||||
subOctaveDouble = 1;
|
if (!subOctaveDouble) {
|
||||||
rotatorOn = 0;
|
subOctaveDouble = 1;
|
||||||
} else subOctaveDouble = 0;
|
rotatorOn = 0;
|
||||||
}
|
} else subOctaveDouble = 0;
|
||||||
if (!K1 && !K4 && !K5) {
|
}
|
||||||
slurSustain = 0;
|
if (!K1 && !K4 && !K5) {
|
||||||
parallelChord = 0;
|
|
||||||
subOctaveDouble = 0;
|
|
||||||
rotatorOn = 0;
|
|
||||||
}
|
|
||||||
if (pinkyKey) {
|
|
||||||
if (!rotatorOn) {
|
|
||||||
rotatorOn = 1;
|
|
||||||
slurSustain = 0;
|
slurSustain = 0;
|
||||||
parallelChord = 0;
|
parallelChord = 0;
|
||||||
subOctaveDouble = 0;
|
subOctaveDouble = 0;
|
||||||
} else rotatorOn = 0;
|
rotatorOn = 0;
|
||||||
|
}
|
||||||
|
if (pinkyKey) {
|
||||||
|
if (!rotatorOn) {
|
||||||
|
rotatorOn = 1;
|
||||||
|
slurSustain = 0;
|
||||||
|
parallelChord = 0;
|
||||||
|
subOctaveDouble = 0;
|
||||||
|
} else rotatorOn = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lastSpecialKey = specialKey;
|
||||||
|
} else {
|
||||||
|
rotatorOn = 0;
|
||||||
|
slurSustain = 0;
|
||||||
|
parallelChord = 0;
|
||||||
|
subOctaveDouble = 0;
|
||||||
}
|
}
|
||||||
lastSpecialKey = specialKey;
|
|
||||||
} else if (mainState == RISE_WAIT) {
|
} else if (mainState == RISE_WAIT) {
|
||||||
if ((pressureSensor > breathThrVal) || gateOpen) {
|
if ((pressureSensor > breathThrVal) || gateOpen) {
|
||||||
// Has enough time passed for us to collect our second
|
// Has enough time passed for us to collect our second
|
||||||
|
@ -1012,29 +1024,34 @@ void doorKnobCheck() {
|
||||||
for (byte i = 0; i < 12; i++) {
|
for (byte i = 0; i < 12; i++) {
|
||||||
touchValue[i] = touchSensor.filteredData(i);
|
touchValue[i] = touchSensor.filteredData(i);
|
||||||
}
|
}
|
||||||
if ((touchValue[K4Pin] < ctouchThrVal) && (touchValue[R1Pin] < ctouchThrVal) && (touchValue[R2Pin] < ctouchThrVal) && (touchValue[R3Pin] < ctouchThrVal)) { // doorknob grip on canister
|
if (gateOpenEnable){
|
||||||
if (pbUp > ((pitchbMaxVal + pitchbThrVal) / 2)) {
|
if ((touchValue[K4Pin] < ctouchThrVal) && (touchValue[R1Pin] < ctouchThrVal) && (touchValue[R2Pin] < ctouchThrVal) && (touchValue[R3Pin] < ctouchThrVal)) { // doorknob grip on canister
|
||||||
gateOpen = 1;
|
if (!gateOpen && (pbUp > ((pitchbMaxVal + pitchbThrVal) / 2))) {
|
||||||
digitalWrite(statusLedPin, LOW);
|
gateOpen = 1;
|
||||||
delay(50);
|
digitalWrite(statusLedPin, LOW);
|
||||||
digitalWrite(statusLedPin, HIGH);
|
delay(50);
|
||||||
delay(50);
|
digitalWrite(statusLedPin, HIGH);
|
||||||
} else if (pbDn > ((pitchbMaxVal + pitchbThrVal) / 2)) {
|
delay(50);
|
||||||
gateOpen = 0;
|
} else if (gateOpen && (pbDn > ((pitchbMaxVal + pitchbThrVal) / 2))) {
|
||||||
midiPanic();
|
gateOpen = 0;
|
||||||
digitalWrite(statusLedPin, LOW);
|
midiPanic();
|
||||||
delay(50);
|
digitalWrite(statusLedPin, LOW);
|
||||||
digitalWrite(statusLedPin, HIGH);
|
delay(50);
|
||||||
delay(50);
|
digitalWrite(statusLedPin, HIGH);
|
||||||
digitalWrite(statusLedPin, LOW);
|
delay(50);
|
||||||
delay(50);
|
digitalWrite(statusLedPin, LOW);
|
||||||
digitalWrite(statusLedPin, HIGH);
|
delay(50);
|
||||||
delay(50);
|
digitalWrite(statusLedPin, HIGH);
|
||||||
digitalWrite(statusLedPin, LOW);
|
delay(50);
|
||||||
delay(50);
|
digitalWrite(statusLedPin, LOW);
|
||||||
digitalWrite(statusLedPin, HIGH);
|
delay(50);
|
||||||
delay(700);
|
digitalWrite(statusLedPin, HIGH);
|
||||||
|
delay(700);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else if (gateOpen) {
|
||||||
|
gateOpen = 0;
|
||||||
|
midiPanic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
// Compile options, comment/uncomment to change
|
// Compile options, comment/uncomment to change
|
||||||
|
|
||||||
#define FIRMWARE_VERSION "1.3.6" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
|
#define FIRMWARE_VERSION "1.3.7" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
|
||||||
|
|
||||||
|
|
||||||
//#define CASSIDY
|
//#define CASSIDY
|
||||||
|
|
|
@ -61,6 +61,8 @@ extern unsigned short vibRetn; // vibrato return speed
|
||||||
extern unsigned short vibSquelch; //vibrato signal squelch
|
extern unsigned short vibSquelch; //vibrato signal squelch
|
||||||
extern unsigned short vibDirection; //direction of first vibrato wave UPWD or DNWD
|
extern unsigned short vibDirection; //direction of first vibrato wave UPWD or DNWD
|
||||||
extern unsigned short fastPatch[7];
|
extern unsigned short fastPatch[7];
|
||||||
|
extern uint16_t gateOpenEnable;
|
||||||
|
extern uint16_t specialKeyEnable;
|
||||||
extern byte rotatorOn;
|
extern byte rotatorOn;
|
||||||
extern byte currentRotation;
|
extern byte currentRotation;
|
||||||
extern uint16_t rotations[4];
|
extern uint16_t rotations[4];
|
||||||
|
@ -73,8 +75,8 @@ extern unsigned long cursorBlinkTime; // the last time the cursor was t
|
||||||
extern byte activePatch;
|
extern byte activePatch;
|
||||||
extern byte doPatchUpdate;
|
extern byte doPatchUpdate;
|
||||||
|
|
||||||
extern byte legacy;
|
extern uint16_t legacy;
|
||||||
extern byte legacyBrAct;
|
extern uint16_t legacyBrAct;
|
||||||
|
|
||||||
extern byte slowMidi;
|
extern byte slowMidi;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ enum CursorIdx {
|
||||||
EControl,
|
EControl,
|
||||||
ERotator,
|
ERotator,
|
||||||
EVibrato,
|
EVibrato,
|
||||||
|
EExtras,
|
||||||
// NEVER ADD ANYTHING AFTER THIS, ONLY ABOVE
|
// NEVER ADD ANYTHING AFTER THIS, ONLY ABOVE
|
||||||
NUM_CURSORS
|
NUM_CURSORS
|
||||||
};
|
};
|
||||||
|
@ -449,6 +449,72 @@ static void midiCustomDrawFunc(SubMenuRef __unused, char* __unused, const char**
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//***********************************************************
|
||||||
|
|
||||||
|
const MenuEntrySub legacyPBMenu = {
|
||||||
|
MenuType::ESub, "LEGACY PB", "LEGACY PB", &legacy, 0, 1, MenuEntryFlags::EMenuEntryWrap,
|
||||||
|
[](SubMenuRef __unused, char* out, const char ** __unused unit) {
|
||||||
|
strncpy(out, legacy?"ON":"OFF", 4);
|
||||||
|
}, [](const MenuEntrySub & __unused sub) {
|
||||||
|
dipSwBits = dipSwBits & ~(1<<1);
|
||||||
|
dipSwBits |= (legacy <<1);
|
||||||
|
writeSetting(DIPSW_BITS_ADDR,dipSwBits);
|
||||||
|
}
|
||||||
|
, nullptr
|
||||||
|
};
|
||||||
|
|
||||||
|
const MenuEntrySub legacyBRMenu = {
|
||||||
|
MenuType::ESub, "LEGACY BR", "LEGACY BR", &legacyBrAct, 0, 1, MenuEntryFlags::EMenuEntryWrap,
|
||||||
|
[](SubMenuRef __unused, char* out, const char ** __unused unit) {
|
||||||
|
strncpy(out, legacyBrAct?"ON":"OFF", 4);
|
||||||
|
}, [](const MenuEntrySub & __unused sub) {
|
||||||
|
dipSwBits = dipSwBits & ~(1<<2);
|
||||||
|
dipSwBits |= (legacyBrAct <<2);
|
||||||
|
writeSetting(DIPSW_BITS_ADDR,dipSwBits);
|
||||||
|
}
|
||||||
|
, nullptr
|
||||||
|
};
|
||||||
|
|
||||||
|
const MenuEntrySub gateOpenMenu = {
|
||||||
|
MenuType::ESub, "GATE HOLD", "GATE HOLD", &gateOpenEnable, 0, 1, MenuEntryFlags::EMenuEntryWrap,
|
||||||
|
[](SubMenuRef __unused, char* out, const char ** __unused unit) {
|
||||||
|
strncpy(out, gateOpenEnable?"ON":"OFF", 4);
|
||||||
|
}, [](const MenuEntrySub & __unused sub) {
|
||||||
|
dipSwBits = dipSwBits & ~(1<<4);
|
||||||
|
dipSwBits |= (gateOpenEnable <<4);
|
||||||
|
writeSetting(DIPSW_BITS_ADDR,dipSwBits);
|
||||||
|
}
|
||||||
|
, nullptr
|
||||||
|
};
|
||||||
|
|
||||||
|
const MenuEntrySub specialKeyMenu = {
|
||||||
|
MenuType::ESub, "SPEC KEY", "SPEC KEY", &specialKeyEnable, 0, 1, MenuEntryFlags::EMenuEntryWrap,
|
||||||
|
[](SubMenuRef __unused, char* out, const char ** __unused unit) {
|
||||||
|
strncpy(out, specialKeyEnable?"ON":"OFF", 4);
|
||||||
|
}, [](const MenuEntrySub & __unused sub) {
|
||||||
|
dipSwBits = dipSwBits & ~(1<<5);
|
||||||
|
dipSwBits |= (specialKeyEnable <<5);
|
||||||
|
writeSetting(DIPSW_BITS_ADDR,dipSwBits);
|
||||||
|
}
|
||||||
|
, nullptr
|
||||||
|
};
|
||||||
|
|
||||||
|
const MenuEntry* extrasMenuEntries[] = {
|
||||||
|
(MenuEntry*)&legacyPBMenu,
|
||||||
|
(MenuEntry*)&legacyBRMenu,
|
||||||
|
(MenuEntry*)&gateOpenMenu,
|
||||||
|
(MenuEntry*)&specialKeyMenu,
|
||||||
|
};
|
||||||
|
|
||||||
|
const MenuPage extrasMenuPage = {
|
||||||
|
"EXTRAS",
|
||||||
|
0,
|
||||||
|
CursorIdx::EExtras,
|
||||||
|
MAIN_MENU,
|
||||||
|
ARR_LEN(extrasMenuEntries), extrasMenuEntries
|
||||||
|
};
|
||||||
|
|
||||||
static bool midiEnterHandlerFunc() {
|
static bool midiEnterHandlerFunc() {
|
||||||
readSwitches();
|
readSwitches();
|
||||||
if (pinkyKey){
|
if (pinkyKey){
|
||||||
|
@ -470,6 +536,7 @@ const MenuEntrySub midiMenu = {
|
||||||
const MenuEntryStateCh adjustMenu = { MenuType::EStateChange, "ADJUST", ADJUST_MENU };
|
const MenuEntryStateCh adjustMenu = { MenuType::EStateChange, "ADJUST", ADJUST_MENU };
|
||||||
const MenuEntryStateCh breathMenu = { MenuType::EStateChange, "SETUP BR", SETUP_BR_MENU };
|
const MenuEntryStateCh breathMenu = { MenuType::EStateChange, "SETUP BR", SETUP_BR_MENU };
|
||||||
const MenuEntryStateCh controlMenu = { MenuType::EStateChange, "SETUP CTL", SETUP_CT_MENU };
|
const MenuEntryStateCh controlMenu = { MenuType::EStateChange, "SETUP CTL", SETUP_CT_MENU };
|
||||||
|
const MenuEntryStateCh extrasMenu = { MenuType::EStateChange, "EXTRAS", EXTRAS_MENU };
|
||||||
const MenuEntryStateCh aboutMenu = { MenuType::EStateChange, "ABOUT", ABOUT_MENU };
|
const MenuEntryStateCh aboutMenu = { MenuType::EStateChange, "ABOUT", ABOUT_MENU };
|
||||||
|
|
||||||
const MenuEntry* mainMenuEntries[] = {
|
const MenuEntry* mainMenuEntries[] = {
|
||||||
|
@ -479,6 +546,7 @@ const MenuEntry* mainMenuEntries[] = {
|
||||||
(MenuEntry*)&adjustMenu,
|
(MenuEntry*)&adjustMenu,
|
||||||
(MenuEntry*)&breathMenu,
|
(MenuEntry*)&breathMenu,
|
||||||
(MenuEntry*)&controlMenu,
|
(MenuEntry*)&controlMenu,
|
||||||
|
(MenuEntry*)&extrasMenu,
|
||||||
(MenuEntry*)&aboutMenu,
|
(MenuEntry*)&aboutMenu,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -825,6 +893,7 @@ const MenuPage vibratoMenuPage = {
|
||||||
"VIBRATO", 0, CursorIdx::EVibrato, SETUP_CT_MENU, ARR_LEN(vibratorMenuEntries), vibratorMenuEntries
|
"VIBRATO", 0, CursorIdx::EVibrato, SETUP_CT_MENU, ARR_LEN(vibratorMenuEntries), vibratorMenuEntries
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
||||||
static bool patchPageUpdate(KeyState& __unused input, uint32_t __unused timeNow);
|
static bool patchPageUpdate(KeyState& __unused input, uint32_t __unused timeNow);
|
||||||
|
@ -1337,6 +1406,8 @@ void menu() {
|
||||||
redraw |= updatePage(&vibratoMenuPage, input, timeNow);
|
redraw |= updatePage(&vibratoMenuPage, input, timeNow);
|
||||||
} else if (menuState == ABOUT_MENU) {
|
} else if (menuState == ABOUT_MENU) {
|
||||||
redraw |= updatePage((const MenuPage*)&aboutMenuPage, input, timeNow);
|
redraw |= updatePage((const MenuPage*)&aboutMenuPage, input, timeNow);
|
||||||
|
} else if (menuState == EXTRAS_MENU) {
|
||||||
|
redraw |= updatePage((const MenuPage*)&extrasMenuPage, input, timeNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(redraw) {
|
if(redraw) {
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#define ROTATOR_MENU 6
|
#define ROTATOR_MENU 6
|
||||||
#define VIBRATO_MENU 7
|
#define VIBRATO_MENU 7
|
||||||
#define ABOUT_MENU 8
|
#define ABOUT_MENU 8
|
||||||
|
#define EXTRAS_MENU 9
|
||||||
|
|
||||||
#define ARR_LEN(a) (sizeof (a) / sizeof (a[0]))
|
#define ARR_LEN(a) (sizeof (a) / sizeof (a[0]))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue