Added automatic sensor calibration performed at factory reset. Changed some default values for settings.
This commit is contained in:
parent
1f2fff8b47
commit
51f5ab54f6
5 changed files with 10769 additions and 8 deletions
|
@ -657,6 +657,8 @@ void setup() {
|
|||
vibThrBite = vibZeroBite - vibSquelchBite;
|
||||
vibThrBiteLo = vibZeroBite + vibSquelchBite;
|
||||
|
||||
if (factoryReset) autoCal();
|
||||
|
||||
if(!fastBoot) {
|
||||
statusLedFlash(500);
|
||||
statusLedOff();
|
||||
|
@ -1848,6 +1850,90 @@ void portOff() {
|
|||
oldport = 0;
|
||||
}
|
||||
|
||||
//***********************************************************
|
||||
|
||||
void autoCal() {
|
||||
int calRead;
|
||||
int calReadNext;
|
||||
// NuRAD/NuEVI sensor calibration
|
||||
// Extra Controller
|
||||
calRead = touchRead(extraPin);
|
||||
extracThrVal = constrain(calRead+200, extracLoLimit, extracHiLimit);
|
||||
extracMaxVal = constrain(extracThrVal+600, extracLoLimit, extracHiLimit);
|
||||
writeSetting(EXTRAC_THR_ADDR, extracThrVal);
|
||||
writeSetting(EXTRAC_MAX_ADDR, extracMaxVal);
|
||||
// Breath sensor
|
||||
calRead = analogRead(breathSensorPin);
|
||||
breathThrVal = constrain(calRead+200, breathLoLimit, breathHiLimit);
|
||||
breathMaxVal = constrain(breathThrVal+2000, breathLoLimit, breathHiLimit);
|
||||
writeSetting(BREATH_THR_ADDR, breathThrVal);
|
||||
writeSetting(BREATH_MAX_ADDR, breathMaxVal);
|
||||
// Pitch Bend
|
||||
calRead = touchRead(pbUpPin);
|
||||
calReadNext = touchRead(pbDnPin);
|
||||
if (calReadNext > calRead) calRead = calReadNext; //use highest value
|
||||
pitchbThrVal = constrain(calRead+200, pitchbLoLimit, pitchbHiLimit);
|
||||
pitchbMaxVal = constrain(pitchbThrVal+800, pitchbLoLimit, pitchbHiLimit);
|
||||
writeSetting(PITCHB_THR_ADDR, pitchbThrVal);
|
||||
writeSetting(PITCHB_MAX_ADDR, pitchbMaxVal);
|
||||
#if defined(NURAD) // NuRAD sensor calibration
|
||||
// Pressure sensor
|
||||
calRead = analogRead(bitePressurePin);
|
||||
portamThrVal = constrain(calRead+300, portamLoLimit, portamHiLimit);
|
||||
portamMaxVal = constrain(portamThrVal+600, portamLoLimit, portamHiLimit);
|
||||
writeSetting(PORTAM_THR_ADDR, portamThrVal);
|
||||
writeSetting(PORTAM_MAX_ADDR, portamMaxVal);
|
||||
// Touch sensors
|
||||
calRead = ctouchHiLimit;
|
||||
for (byte i = 0; i < 6; i++) {
|
||||
calReadNext = touchSensorRollers.filteredData(i) * (300-calOffsetRollers[i])/300;
|
||||
if (calReadNext < calRead) calRead = calReadNext; //use lowest value
|
||||
}
|
||||
for (byte i = 0; i < 12; i++) {
|
||||
calReadNext = touchSensorRH.filteredData(i) * (300-calOffsetRH[i])/300;
|
||||
if (calReadNext < calRead) calRead = calReadNext; //use lowest value
|
||||
}
|
||||
for (byte i = 0; i < 12; i++) {
|
||||
calReadNext = touchSensorLH.filteredData(i) * (300-calOffsetLH[i])/300;
|
||||
if (calReadNext < calRead) calRead = calReadNext; //use lowest value
|
||||
}
|
||||
ctouchThrVal = constrain(calRead-20, ctouchLoLimit, ctouchHiLimit);
|
||||
touch_Thr = map(ctouchThrVal,ctouchHiLimit,ctouchLoLimit,ttouchLoLimit,ttouchHiLimit);
|
||||
writeSetting(CTOUCH_THR_ADDR, ctouchThrVal);
|
||||
#else // NuEVI sensor calibration
|
||||
// Bite sensor
|
||||
if (digitalRead(biteJumperPin)){ //PBITE (if pulled low with jumper, pressure sensor is used instead of capacitive bite sensing)
|
||||
// Capacitive sensor
|
||||
calRead = touchRead(bitePin);
|
||||
portamThrVal = constrain(calRead+200, portamLoLimit, portamHiLimit);
|
||||
portamMaxVal = constrain(portamThrVal+600, portamLoLimit, portamHiLimit);
|
||||
writeSetting(PORTAM_THR_ADDR, portamThrVal);
|
||||
writeSetting(PORTAM_MAX_ADDR, portamMaxVal);
|
||||
} else {
|
||||
// Pressure sensor
|
||||
calRead = analogRead(bitePressurePin);
|
||||
portamThrVal = constrain(calRead+300, portamLoLimit, portamHiLimit);
|
||||
portamMaxVal = constrain(portamThrVal+600, portamLoLimit, portamHiLimit);
|
||||
writeSetting(PORTAM_THR_ADDR, portamThrVal);
|
||||
writeSetting(PORTAM_MAX_ADDR, portamMaxVal);
|
||||
}
|
||||
// Touch sensors
|
||||
calRead = ctouchHiLimit;
|
||||
for (byte i = 0; i < 12; i++) {
|
||||
calReadNext = touchSensor.filteredData(i);
|
||||
if (calReadNext < calRead) calRead = calReadNext; //use lowest value
|
||||
}
|
||||
calReadNext=map(touchRead(halfPitchBendKeyPin),ttouchLoLimit,ttouchHiLimit,ctouchHiLimit,ctouchLoLimit);
|
||||
if (calReadNext < calRead) calRead = calReadNext; //use lowest value
|
||||
calReadNext=map(touchRead(specialKeyPin),ttouchLoLimit,ttouchHiLimit,ctouchHiLimit,ctouchLoLimit);
|
||||
if (calReadNext < calRead) calRead = calReadNext; //use lowest value
|
||||
ctouchThrVal = constrain(calRead-20, ctouchLoLimit, ctouchHiLimit);
|
||||
touch_Thr = map(ctouchThrVal,ctouchHiLimit,ctouchLoLimit,ttouchLoLimit,ttouchHiLimit);
|
||||
writeSetting(CTOUCH_THR_ADDR, ctouchThrVal);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//***********************************************************
|
||||
|
||||
void readSwitches() {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
// Compile options, comment/uncomment to change
|
||||
|
||||
#define FIRMWARE_VERSION "1.4.8" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
|
||||
#define FIRMWARE_VERSION "1.5b1" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
#define ON_Delay 20 // Set Delay after ON threshold before velocity is checked (wait for tounging peak)
|
||||
#define CCN_Port 5 // Controller number for portamento level
|
||||
|
|
|
@ -100,16 +100,17 @@
|
|||
|
||||
//"factory" values for settings
|
||||
#define EEPROM_VERSION 39
|
||||
|
||||
#define BREATH_THR_FACTORY 1400
|
||||
#define BREATH_MAX_FACTORY 4000
|
||||
#define PORTAM_THR_FACTORY 2600
|
||||
#define PORTAM_MAX_FACTORY 3300
|
||||
#define PORTPR_THR_FACTORY 1200
|
||||
#define PORTPR_MAX_FACTORY 2000
|
||||
#define PITCHB_THR_FACTORY 1400
|
||||
#define PITCHB_MAX_FACTORY 2300
|
||||
#define EXTRAC_THR_FACTORY 1200
|
||||
#define EXTRAC_MAX_FACTORY 2400
|
||||
#define PITCHB_THR_FACTORY 2000
|
||||
#define PITCHB_MAX_FACTORY 3000
|
||||
#define EXTRAC_THR_FACTORY 2800
|
||||
#define EXTRAC_MAX_FACTORY 3500
|
||||
#define TRANSP_FACTORY 12 // 12 is 0 transpose
|
||||
#define MIDI_FACTORY 1 // 1-16
|
||||
#define BREATH_CC_FACTORY 2 //thats CC#2, see ccList
|
||||
|
@ -117,7 +118,7 @@
|
|||
#define VELOCITY_FACTORY 0 // 0 is dynamic/breath controlled velocity
|
||||
#define PORTAM_FACTORY 2 // 0 - OFF, 1 - ON, 2 - SW
|
||||
#define PB_FACTORY 1 // 0 - OFF, 1 - 12
|
||||
#define EXTRA_FACTORY 2 // 0 - OFF, 1 - Modulation wheel, 2 - Foot pedal, 3 - Filter Cutoff, 4 - Sustain pedal
|
||||
#define EXTRA_FACTORY 1 // 0 - OFF, 1 - Modulation wheel, 2 - Foot pedal, 3 - Filter Cutoff, 4 - Sustain pedal
|
||||
#define VIBRATO_FACTORY 4 // 0 - OFF, 1 - 9 depth
|
||||
#define DEGLITCH_FACTORY 20 // 0 - OFF, 5 to 70 ms in steps of 5
|
||||
#define PATCH_FACTORY 1 // MIDI program change 1-128
|
||||
|
@ -140,7 +141,7 @@
|
|||
#define VIB_DIRECTION_FACTORY 0
|
||||
#define BREATH_CC2_FACTORY 0 //OFF,1-127
|
||||
#define BREATH_CC2_RISE_FACTORY 1
|
||||
#define VIB_SENS_BITE_FACTORY 3
|
||||
#define VIB_SENS_BITE_FACTORY 8
|
||||
#define VIB_SQUELCH_BITE_FACTORY 10
|
||||
#define VIB_CONTROL_FACTORY 0
|
||||
#define TRILL3_INTERVAL_FACTORY 4
|
||||
|
@ -164,7 +165,7 @@
|
|||
#define ROTC3_FACTORY 17 // -7 (+24) Rotation 3
|
||||
#define ROTC4_FACTORY 10 // -14 (+24) Rotation 4
|
||||
#define POLYSEL_FACTORY 0
|
||||
#define FWCTYPE_FACTORY 1
|
||||
#define FWCTYPE_FACTORY 0
|
||||
#define HMZKEY_FACTORY 0
|
||||
#define FWCLCH_FACTORY 0
|
||||
#define FWCDP2_FACTORY 0
|
||||
|
|
5281
uploadable hex files/NuEVI-v15b1.ino.hex
Normal file
5281
uploadable hex files/NuEVI-v15b1.ino.hex
Normal file
File diff suppressed because it is too large
Load diff
5393
uploadable hex files/NuRAD-v15b1.ino.hex
Normal file
5393
uploadable hex files/NuRAD-v15b1.ino.hex
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue