Version 1.2.7
This commit is contained in:
parent
205689dbdf
commit
24c9480c5b
3 changed files with 223 additions and 139 deletions
Binary file not shown.
Binary file not shown.
100
NuEVI.ino
100
NuEVI.ino
|
@ -22,11 +22,11 @@ PROGRAMME FUNCTION: EVI Wind Controller using the Freescale MP3V5004GP breath
|
|||
|
||||
// Compile options, comment/uncomment to change
|
||||
|
||||
#define FIRMWARE_VERSION "1.2.6" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
|
||||
#define FIRMWARE_VERSION "1.2.7" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
#define REVB
|
||||
|
||||
//Uncomment the following line if you have Teensyduino 1.4.0 or earlier, to make pitch bend over USB-MIDI work.
|
||||
//Comment out the following line if you have Teensyduino 1.4.0 or earlier, to make pitch bend over USB-MIDI work.
|
||||
#define NEWTEENSYDUINO
|
||||
|
||||
|
||||
|
@ -122,9 +122,9 @@ PROGRAMME FUNCTION: EVI Wind Controller using the Freescale MP3V5004GP breath
|
|||
#define CCN_PortOnOff 65// Controller number for portamento on/off
|
||||
|
||||
|
||||
// Send CC data no more than every CC_INTERVAL
|
||||
// milliseconds
|
||||
#define CC_INTERVAL 5
|
||||
// Send breath CC data no more than every CC_INTERVAL (other CC is sent with double interval)
|
||||
// milliseconds (due to timing errors, the value should be about half the actual wanted value)
|
||||
#define CC_INTERVAL 2
|
||||
|
||||
|
||||
// The three states of our main state machine
|
||||
|
@ -479,6 +479,7 @@ byte legacy = 0;
|
|||
byte legacyBrAct = 0;
|
||||
byte halfTime = 0;
|
||||
byte FPD = 0;
|
||||
boolean programonce = false;
|
||||
|
||||
int breathLevel=0; // breath level (smoothed) not mapped to CC value
|
||||
int oldbreath=0;
|
||||
|
@ -562,6 +563,8 @@ byte halfPitchBendKey;
|
|||
byte specialKey;
|
||||
byte pinkyKey;
|
||||
byte lastSpecialKey = 0;
|
||||
byte pitchlatch;
|
||||
int reverb;
|
||||
|
||||
byte slurSustain = 0;
|
||||
byte parallelChord = 0;
|
||||
|
@ -798,7 +801,7 @@ void mainLoop() {
|
|||
mainState = RISE_WAIT; // Go to next state
|
||||
}
|
||||
if (legacy || legacyBrAct) {
|
||||
if (((pbUp > ((pitchbMaxVal + pitchbThrVal)/2)) && (pbDn > ((pitchbMaxVal + pitchbThrVal)/2)) && legacy) || ((analogRead(0) < (breathCalZero - 500)) && legacyBrAct)){ // both pb pads touched
|
||||
if (((pbUp > ((pitchbMaxVal + pitchbThrVal) / 2)) && (pbDn > ((pitchbMaxVal + pitchbThrVal) / 2)) && legacy) || ((analogRead(0) < (breathCalZero - 500)) && legacyBrAct) && (pbDn < ((pitchbMaxVal + pitchbThrVal) / 2))) { // both pb pads touched or br suck
|
||||
readSwitches();
|
||||
fingeredNoteUntransposed = patchLimit(fingeredNoteUntransposed + 1);
|
||||
if (exSensor >= ((extracThrVal + extracMaxVal) / 2)) { // instant midi setting
|
||||
|
@ -838,7 +841,90 @@ void mainLoop() {
|
|||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pbDn > (pitchbMaxVal + pitchbThrVal) / 2 && (analogRead(0) < (breathCalZero - 500)) && programonce == false) { // down bend for suck programming button
|
||||
programonce = true;
|
||||
readSwitches();
|
||||
|
||||
if (octaveR == 0) { //lowest octave position
|
||||
if (K1 && K2 && !K3 && K4) { // e28 send patch change -10
|
||||
patch = patch - 10;
|
||||
doPatchUpdate = 1;
|
||||
}
|
||||
else if (K1 && !K2 && !K3 && K4) { //f29 decrement and send patch change
|
||||
patch--;
|
||||
doPatchUpdate = 1;
|
||||
}
|
||||
else if (!K1 && K2 && !K3 && K4) { //f#30 send patch change +10
|
||||
patch = patch + 10;
|
||||
doPatchUpdate = 1;
|
||||
}
|
||||
else if (!K1 && !K2 && !K3 && K4) { //g31 increment and send patch change
|
||||
patch++;
|
||||
doPatchUpdate = 1;
|
||||
}
|
||||
if (!K1 && !K2 && K3 && !K4) { //send reverb pitchlatch value
|
||||
reverb = ((pitchlatch - 36) * 2);
|
||||
if (reverb > 127) { reverb = 127; }
|
||||
if (reverb < 0) { reverb = 0; }
|
||||
usbMIDI.sendControlChange(91, reverb, activeMIDIchannel);
|
||||
dinMIDIsendControlChange(91, reverb, activeMIDIchannel - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (octaveR == 3) { //middle octave position to set breath parameters
|
||||
// breathCC value is from cclist[] which assigns controller number
|
||||
|
||||
if (K1) { //turn on midi volume
|
||||
breathCC = 3;
|
||||
usbMIDI.sendControlChange(7, 0, activeMIDIchannel); //midi vol to 0
|
||||
dinMIDIsendControlChange(7, 0, activeMIDIchannel - 1);
|
||||
usbMIDI.sendControlChange(11, 127, activeMIDIchannel); //midi expression to 127
|
||||
dinMIDIsendControlChange(11, 127, activeMIDIchannel - 1);
|
||||
}
|
||||
if (K3) { //turn on midi breath controller
|
||||
breathCC = 2;
|
||||
usbMIDI.sendControlChange(7, 127, activeMIDIchannel); //midi vol to 127
|
||||
dinMIDIsendControlChange(7, 127, activeMIDIchannel - 1);
|
||||
usbMIDI.sendControlChange(11, 127, activeMIDIchannel); //midi expression to 127
|
||||
dinMIDIsendControlChange(11, 127, activeMIDIchannel - 1);
|
||||
}
|
||||
if (K4) { //sb turn on midi expression
|
||||
breathCC = 4;
|
||||
usbMIDI.sendControlChange(7, 127, activeMIDIchannel); //midi vol to 127
|
||||
dinMIDIsendControlChange(7, 127, activeMIDIchannel - 1);
|
||||
usbMIDI.sendControlChange(11, 0, activeMIDIchannel); //midi expression to 0
|
||||
dinMIDIsendControlChange(11, 0, activeMIDIchannel - 1);
|
||||
}
|
||||
if (K2) { //2v turn on aftertouch
|
||||
breathAT = 1;
|
||||
usbMIDI.sendControlChange(7, 127, activeMIDIchannel); //midi vol to 127
|
||||
dinMIDIsendControlChange(7, 127, activeMIDIchannel - 1);
|
||||
usbMIDI.sendControlChange(11, 127, activeMIDIchannel); //midi expression to 0
|
||||
dinMIDIsendControlChange(11, 127, activeMIDIchannel - 1);
|
||||
}
|
||||
else { breathAT = 0; }
|
||||
if (K5) { //1tr turn on velocity
|
||||
velocity = 0;
|
||||
usbMIDI.sendControlChange(7, 127, activeMIDIchannel); //midi vol to 127
|
||||
dinMIDIsendControlChange(7, 127, activeMIDIchannel - 1);
|
||||
usbMIDI.sendControlChange(11, 127, activeMIDIchannel); //midi expression to 0
|
||||
dinMIDIsendControlChange(11, 127, activeMIDIchannel - 1);
|
||||
}
|
||||
else { velocity = 127; }
|
||||
if (!K1 && !K3 && !K4) {
|
||||
breathCC = 0;
|
||||
usbMIDI.sendControlChange(7, 127, activeMIDIchannel); //midi vol to 127
|
||||
dinMIDIsendControlChange(7, 127, activeMIDIchannel - 1);
|
||||
usbMIDI.sendControlChange(11, 127, activeMIDIchannel); //midi expression to 127
|
||||
dinMIDIsendControlChange(11, 127, activeMIDIchannel - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (analogRead(0) > (breathCalZero - 400)) programonce = false;
|
||||
specialKey = (touchRead(specialKeyPin) > touch_Thr); //S2 on pcb
|
||||
if (lastSpecialKey != specialKey) {
|
||||
if (specialKey) {
|
||||
|
@ -1034,8 +1120,6 @@ void mainLoop() {
|
|||
usbMIDI.sendNoteOff(activeNote, velocitySend, activeMIDIchannel); // send Note Off message for old note
|
||||
dinMIDIsendNoteOff(activeNote, velocitySend, activeMIDIchannel - 1);
|
||||
}
|
||||
|
||||
|
||||
fingeredNote = noteValueCheck(fingeredNote);
|
||||
if (priority) {
|
||||
usbMIDI.sendNoteOn(fingeredNote, velocitySend, activeMIDIchannel); // send Note On message for new note
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue