Added static glide/portamento control as pinky key setting. Use LEVEL control to set glide time.

This commit is contained in:
Johan Berglund 2019-10-20 14:16:10 +02:00
parent 053b954936
commit 58d7584f87
4 changed files with 35 additions and 7 deletions

View file

@ -598,6 +598,20 @@ void loop() {
writeSetting(LEVEL_VAL_ADDR,levelVal);
}
lastPinkyKey = pinkyKey;
} else if (pinkySetting == GLD){
if (pinkyKey){
ledMeter(levelVal);
if (K5 && (levelVal < 127)){
levelVal++;
midiSendControlChange(CCN_Port, levelVal);
} else if (K1 && (levelVal > 0)){
levelVal--;
midiSendControlChange(CCN_Port, levelVal);
}
} else if (lastPinkyKey){
writeSetting(LEVEL_VAL_ADDR,levelVal);
}
lastPinkyKey = pinkyKey;
}
} else if (mainState == RISE_WAIT) {
if ((pressureSensor > breathThrVal) || gateOpen) {
@ -783,7 +797,7 @@ void loop() {
}
if (currentTime - ccSendTime3 > CC_INTERVAL3) {
if (gateOpenEnable || gateOpen) doorKnobCheck();
if (((pinkySetting == LVL) || (pinkySetting == LVLP)) && pinkyKey){
if (((pinkySetting == LVL) || (pinkySetting == LVLP) || (pinkySetting == GLD)) && pinkyKey){
// show LVL indication
} else updateSensorLEDs();
ccSendTime3 = currentTime;
@ -1174,10 +1188,19 @@ void portamento_() {
if (biteJumper) { //PBITE (if pulled low with jumper, use pressure sensor instead of capacitive bite sensor)
biteSensor=analogRead(bitePressurePin); // alternative kind bite sensor (air pressure tube and sensor) PBITE
} else {
} else {
biteSensor = touchRead(bitePin); // get sensor data, do some smoothing - SENSOR PIN 17 - PCB PINS LABELED "BITE" (GND left, sensor pin right)
}
if (0 == vibControl) {
}
if (pinkySetting == GLD){
if (pinkyKey){
if (!portIsOn) {
portOn();
}
port();
} else if (portIsOn) { // pinky key released
portOff();
}
} else if (0 == vibControl) {
// Portamento is controlled with the bite sensor (variable capacitor) in the mouthpiece
if (portamento && (biteSensor >= portamThrVal)) { // if we are enabled and over the threshold, send portamento
if (!portIsOn) {
@ -1218,7 +1241,9 @@ void portOn() {
void port() {
int portCC;
if (1 != vibControl)
if (pinkySetting == GLD){
portCC = levelVal;
} else if (1 != vibControl)
portCC = map(constrain(biteSensor, portamThrVal, portamMaxVal), portamThrVal, portamMaxVal, 0, 127);
else
portCC = constrain((leverPortZero-leverPortThr-leverPortRead),0,127);

View file

@ -24,6 +24,7 @@
#define ECSW 26
#define LVL 27
#define LVLP 28
#define GLD 29
//Vibrato direction
#define UPWD 1

View file

@ -866,7 +866,7 @@ const MenuEntrySub deglitchMenu = {
};
const MenuEntrySub pinkyMenu = {
MenuType::ESub, "PINKY KEY", "PINKY KEY", &pinkySetting, 0, 28, MenuEntryFlags::ENone,
MenuType::ESub, "PINKY KEY", "PINKY KEY", &pinkySetting, 0, 29, MenuEntryFlags::ENone,
[](SubMenuRef __unused,char* textBuffer, const char** __unused unit) {
if (pinkySetting == PBD)
strncpy(textBuffer, "PBD", 4);
@ -878,6 +878,8 @@ const MenuEntrySub pinkyMenu = {
strncpy(textBuffer, "LVL", 4);
else if (pinkySetting == LVLP)
strncpy(textBuffer, "LVP", 4);
else if (pinkySetting == GLD)
strncpy(textBuffer, "GLD", 4);
else
numToString(pinkySetting-12, textBuffer, true);
},

View file

@ -133,7 +133,7 @@ void readEEPROM(const bool factoryReset) {
curve = readSettingBounded(BREATHCURVE_ADDR, 0, 12, BREATHCURVE_FACTORY);
velSmpDl = readSettingBounded(VEL_SMP_DL_ADDR, 0, 30, VEL_SMP_DL_FACTORY);
velBias = readSettingBounded(VEL_BIAS_ADDR, 0, 9, VEL_BIAS_FACTORY);
pinkySetting = readSettingBounded(PINKY_KEY_ADDR, 0, 28, PINKY_KEY_FACTORY);
pinkySetting = readSettingBounded(PINKY_KEY_ADDR, 0, 29, PINKY_KEY_FACTORY);
fastPatch[0] = readSettingBounded(FP1_ADDR, 0, 127, 0);
fastPatch[1] = readSettingBounded(FP2_ADDR, 0, 127, 0);
fastPatch[2] = readSettingBounded(FP3_ADDR, 0, 127, 0);