Added secondary breath CC setting (free 1-127) with a rise multiplier to make this CC rise faster than primary CC, for example to get a fast rising VCA control together with a less steep VCF slope. Changed portamento sensor name to BITE. Put SNS dots for MPR121 and Teensy touch keys on separate rows to avoid blanking when redrawn. Note: Update resets to factory settings.

This commit is contained in:
Johan Berglund 2019-07-15 13:46:34 +02:00
parent 1d34681c40
commit 1cc50cff63
6 changed files with 60 additions and 13 deletions

View file

@ -52,6 +52,8 @@ unsigned short ctouchThrVal;// = 120;
unsigned short transpose;
unsigned short MIDIchannel;
unsigned short breathCC; // OFF:MW:BR:VL:EX:MW+:BR+:VL+:EX+:CF
unsigned short breathCC2; // OFF:1-127
unsigned short breathCC2Rise; // 1X:2X:3X:4X:5X
unsigned short breathAT;
unsigned short velocity;
unsigned short portamento;// switching on cc65? just cc5 enabled? SW:ON:OFF
@ -87,7 +89,7 @@ uint16_t specialKeyEnable = 0;
int touch_Thr = 1300;
byte ccList[11] = {0,1,2,7,11,1,2,7,11,74,20}; // OFF, Modulation, Breath, Volume, Expression (then same sent in hires), CC74 (cutoff/brightness), CC20
byte ccList[13] = {0,1,2,7,11,19,1,2,7,11,19,74,20}; // OFF, Modulation, Breath, Volume, Expression, Sirin Cutoff (then same sent in hires), CC74 (cutoff/brightness), CC20 (UNO Cutoff)
int pbDepthList[13] = {8192,8192,4096,2731,2048,1638,1365,1170,1024,910,819,744,683};
@ -120,6 +122,7 @@ byte slowMidi = 0;
int breathLevel=0; // breath level (smoothed) not mapped to CC value
int oldbreath=0;
int oldbreathcc2=0;
unsigned int oldbreathhires=0;
float filterFreq = 30.0;
@ -304,6 +307,8 @@ void setup() {
writeSetting(VIB_RETN_ADDR,VIB_RETN_FACTORY);
writeSetting(VIB_SQUELCH_ADDR,VIB_SQUELCH_FACTORY);
writeSetting(VIB_DIRECTION_ADDR,VIB_DIRECTION_FACTORY);
writeSetting(BREATH_CC2_ADDR,BREATH_CC2_FACTORY);
writeSetting(BREATH_CC2_RISE_ADDR,BREATH_CC2_RISE_FACTORY);
}
// read settings from EEPROM
breathThrVal = readSetting(BREATH_THR_ADDR);
@ -349,6 +354,8 @@ void setup() {
vibRetn = readSetting(VIB_RETN_ADDR);
vibSquelch = readSetting(VIB_SQUELCH_ADDR);
vibDirection = readSetting(VIB_DIRECTION_ADDR);
breathCC2 = readSetting(BREATH_CC2_ADDR);
breathCC2Rise = readSetting(BREATH_CC2_RISE_ADDR);
legacy = dipSwBits & (1<<1);
legacyBrAct = dipSwBits & (1<<2);
@ -897,7 +904,7 @@ void statusLEDs() {
//**************************************************************
void breath() {
int breathCCval, breathCCvalFine;
int breathCCval, breathCCvalFine,breathCC2val;
unsigned int breathCCvalHires;
breathLevel = constrain(pressureSensor, breathThrVal, breathMaxVal);
//breathLevel = breathLevel*0.6+pressureSensor*0.4; // smoothing of breathLevel value
@ -905,6 +912,7 @@ void breath() {
breathCCvalHires = breathCurve(map(constrain(breathLevel, breathThrVal, breathMaxVal), breathThrVal, breathMaxVal, 0, 16383));
breathCCval = (breathCCvalHires >> 7) & 0x007F;
breathCCvalFine = breathCCvalHires & 0x007F;
breathCC2val = constrain(breathCCval*breathCC2Rise,0,127);
if (breathCCval != oldbreath) { // only send midi data if breath has changed from previous value
if (breathCC) {
@ -919,11 +927,17 @@ void breath() {
}
if (breathCCvalHires != oldbreathhires) {
if ((breathCC > 4) && (breathCC < 9)) { // send high resolution midi
if ((breathCC > 5) && (breathCC < 11)) { // send high resolution midi
midiSendControlChange(ccList[breathCC] + 32, breathCCvalFine);
}
oldbreathhires = breathCCvalHires;
}
if (breathCC2val != oldbreathcc2){
if (breathCC2 && (breathCC2 != ccList[breathCC])){
midiSendControlChange(breathCC2, breathCC2val);
}
oldbreathcc2 = breathCC2val;
}
}
//**************************************************************

View file

@ -52,7 +52,7 @@ static void portamentoSave(const AdjustMenuEntry& e) {
}
const AdjustMenuEntry portamentoAdjustMenu = {
"PORTAMENTO",
"BITE",
{
{ &portamThrVal, portamLoLimit, portamHiLimit },
{ &portamMaxVal, portamLoLimit, portamHiLimit }
@ -226,10 +226,10 @@ void plotSensorPixels(){
redraw = updateSensorPixel(pos, -1);
}
else if(adjustOption == 4) {
display.drawLine(28,38,118,38,BLACK);
display.drawLine(28,39,118,39,BLACK);
for (byte i=0; i<12; i++){
int pos = map(constrain(touchSensor.filteredData(i), ctouchLoLimit, ctouchHiLimit), ctouchLoLimit, ctouchHiLimit, 28, 118);
display.drawPixel(pos, 38, WHITE);
display.drawPixel(pos, 39, WHITE);
}
int posRead = map(touchRead(halfPitchBendKeyPin),ttouchLoLimit,ttouchHiLimit,ctouchHiLimit,ctouchLoLimit);
@ -371,4 +371,3 @@ int updateAdjustMenu(uint32_t timeNow, KeyState &input, bool firstRun, bool draw
return result;
}

View file

@ -5,7 +5,7 @@
// Compile options, comment/uncomment to change
#define FIRMWARE_VERSION "1.3.7" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
#define FIRMWARE_VERSION "1.3.8" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
//#define CASSIDY

View file

@ -40,7 +40,9 @@ extern unsigned short extracMaxVal;
extern unsigned short ctouchThrVal;
extern unsigned short transpose;
extern unsigned short MIDIchannel;
extern unsigned short breathCC; // OFF:MW:BR:VL:EX:MW+:BR+:VL+:EX+:CF
extern unsigned short breathCC; // OFF:MW:BR:VL:EX:SR:MW+:BR+:VL+:EX+:SR+:CF:UNO
extern unsigned short breathCC2; // OFF:1-127
extern unsigned short breathCC2Rise; // 1X:2X:3X:4X:5X
extern unsigned short breathAT;
extern unsigned short velocity;
extern unsigned short portamento;// switching on cc65? just cc5 enabled? SW:ON:OFF

View file

@ -641,10 +641,10 @@ const MenuPage rotatorMenuPage = {
//***********************************************************
// Breath menu
const MenuEntrySub breathCCMenu = {
MenuType::ESub, "BREATH CC", "BREATH CC", &breathCC, 0, 10, MenuEntryFlags::EMenuEntryWrap,
MenuType::ESub, "BRTH CC1", "BRTH CC1", &breathCC, 0, 12, MenuEntryFlags::EMenuEntryWrap,
[](SubMenuRef __unused, char* out, const char** __unused unit) {
const char* breathCCMenuLabels[] = { "OFF", "MW", "BR", "VL", "EX", "MW+",
"BR+", "VL+", "EX+", "CF", "20" };
const char* breathCCMenuLabels[] = { "OFF", "MW", "BR", "VL", "EX","SR", "MW+",
"BR+", "VL+", "EX+", "SR+", "CF", "UNO" };
strncpy(out, breathCCMenuLabels[breathCC], 4);
},
[](const MenuEntrySub & __unused sub){
@ -656,6 +656,32 @@ const MenuEntrySub breathCCMenu = {
, nullptr
};
const MenuEntrySub breathCC2Menu = {
MenuType::ESub, "BRTH CC2", "BRTH CC2", &breathCC2, 0, 127, MenuEntryFlags::EMenuEntryWrap,
[](SubMenuRef __unused, char* out, const char** __unused unit) {
if(breathCC2) numToString(breathCC2, out);
else strncpy(out, "OFF", 4);
},
[](const MenuEntrySub & __unused sub){
if (readSetting(BREATH_CC2_ADDR) != breathCC2) {
writeSetting(BREATH_CC2_ADDR,breathCC2);
midiReset();
}
}
, nullptr
};
const MenuEntrySub breathCC2RiseMenu = {
MenuType::ESub, "CC2 RISE", "CC2 RISE", &breathCC2Rise, 1, 10, MenuEntryFlags::EMenuEntryWrap,
[](SubMenuRef __unused, char *out, const char** label) {
numToString(breathCC2Rise, out);
*label = "X";
},
[](const MenuEntrySub & __unused sub) { writeSetting(BREATH_CC2_RISE_ADDR,breathCC2Rise); }
, nullptr
};
const MenuEntrySub breathATMenu = {
MenuType::ESub, "BREATH AT", "BREATH AT", &breathAT, 0, 1, MenuEntryFlags::EMenuEntryWrap,
[](SubMenuRef __unused, char* out, const char ** __unused unit) {
@ -726,6 +752,8 @@ const MenuEntrySub velBiasMenu = {
const MenuEntry* breathMenuEntries[] = {
(MenuEntry*)&breathCCMenu,
(MenuEntry*)&breathCC2Menu,
(MenuEntry*)&breathCC2RiseMenu,
(MenuEntry*)&breathATMenu,
(MenuEntry*)&velocityMenu,
(MenuEntry*)&curveMenu,

View file

@ -49,9 +49,11 @@
#define VIB_RETN_ADDR 82
#define VIB_SQUELCH_ADDR 84
#define VIB_DIRECTION_ADDR 86
#define BREATH_CC2_ADDR 88
#define BREATH_CC2_RISE_ADDR 90
//"factory" values for settings
#define VERSION 31
#define VERSION 32
#define BREATH_THR_FACTORY 1400
#define BREATH_MAX_FACTORY 4000
#define PORTAM_THR_FACTORY 2600
@ -90,5 +92,7 @@
#define VIB_RETN_FACTORY 2 // 0, no return, 1 slow return, higher faster return
#define VIB_SQUELCH_FACTORY 15 // 0 to 30, vib signal squelch
#define VIB_DIRECTION_FACTORY 0
#define BREATH_CC2_FACTORY 0 //OFF,1-127
#define BREATH_CC2_RISE_FACTORY 1
#endif