Skip to content

Commit 0f65c0d

Browse files
committed
Added fingerings for NuRAD - SAX, EVI, EVR and EWX. Added setting for extra pinky key (NuRAD). Fix for quickpatch function (NuEVI/NuRAD). Rotator menu moved to main menu (NuEVI/NuRAD). Activation of legacy patch selection and settings now only done in extras menu. Changed zero setting in rotator to set rotators off and move on to next one (you can now rotate between 2-4 notes or set to static chord or interval). Changed order of some menu items.
1 parent 7eccf7e commit 0f65c0d

File tree

7 files changed

+301
-104
lines changed

7 files changed

+301
-104
lines changed

NuEVI/NuEVI.ino

Lines changed: 103 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ unsigned short priority; // mono priority for rotator chords
8888
unsigned short extraCT2; // OFF:1-127
8989
unsigned short levelCC; // 0-127
9090
unsigned short levelVal; // 0-127
91+
unsigned short fingering; // 0-4 EWI,EWX,SAX,EVI,EVR
92+
unsigned short lpinky3; // 0-25 (OFF, -12 - MOD - +12)
9193

9294
unsigned short vibSens = 2; // vibrato sensitivity
9395
unsigned short vibRetn = 2; // vibrato return speed
@@ -228,6 +230,36 @@ const unsigned short* const curves[] = {
228230
curveP3, curveP4 , curveS1, curveS2, curveZ1, curveZ2
229231
};
230232

233+
// NuRAD Sax fingering
234+
// LH1, LHb, LH2, LH3, LHp1, -LHp2-, -RHsx-, RH1, RH2, RH3, RHp1, RHp2, RHp3 -excluded- LHp2 always -1, RHs always +1
235+
// 0 = not touched, 1 = touched, 2 = whatever
236+
237+
const byte saxFingerMatch[17][11] =
238+
{
239+
{1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1}, // B (-14 semis)
240+
{1, 2, 1, 1, 0, 1, 1, 1, 2, 0, 1}, // C (-13 semis)
241+
{1, 2, 1, 1, 1, 1, 1, 1, 2, 0, 1}, // C# (-12 semis)
242+
{1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 0}, // C# (-12 semis)
243+
{1, 2, 1, 1, 2, 1, 1, 1, 0, 0, 0}, // D (-11 semis)
244+
{1, 2, 1, 1, 2, 1, 1, 1, 1, 0, 0}, // D# (-10 semis)
245+
{1, 2, 1, 1, 2, 1, 1, 0, 2, 2, 2}, // E (-9 semis)
246+
{1, 2, 1, 1, 2, 1, 0, 2, 2, 2, 2}, // F (-8 semis)
247+
{1, 2, 1, 1, 2, 0, 1, 2, 2, 2, 2}, // F# (-7 semis)
248+
{1, 2, 1, 1, 0, 0, 0, 2, 2, 2, 2}, // G (-6 semis)
249+
{1, 2, 1, 1, 1, 0, 0, 2, 2, 2, 2}, // G# (-5 semis)
250+
{1, 2, 1, 0, 2, 2, 2, 2, 2, 2, 2}, // A (-4 semis)
251+
{1, 2, 0, 2, 2, 1, 2, 2, 2, 2, 2}, // A# (-3 semis)
252+
{1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2}, // A# (-3 semis)
253+
{1, 0, 0, 2, 2, 0, 2, 2, 2, 2, 2}, // B (-2 semis)
254+
{0, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2}, // C (-1 semis)
255+
{0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2}, // C# (-0 semis)
256+
};
257+
258+
const int saxFingerResult[17] = {-14, -13, -12, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -3, -2, -1, 0};
259+
260+
byte saxFinger[11];
261+
262+
231263
int vibThr; // this gets auto calibrated in setup
232264
int vibThrLo;
233265
int vibZero;
@@ -387,7 +419,7 @@ void setup() {
387419

388420
#if defined(NURAD)
389421
digitalWrite(statusLedPin,HIGH);
390-
if (!touchSensorRollers.begin(0x5D)) {
422+
if (!touchSensorRollers.begin(0x5D)) { //should be D
391423
while (1); // Touch sensor initialization failed - stop doing stuff
392424
}
393425
if (!touchSensorLH.begin(0x5C)) {
@@ -748,10 +780,16 @@ void loop() {
748780
}
749781
}
750782
if (rotatorOn) {
751-
midiSendNoteOn(noteValueCheck(fingeredNote + parallel-24), velocitySend); // send Note On message for new note
783+
if (parallel-24) midiSendNoteOn(noteValueCheck(fingeredNote + parallel-24), velocitySend); // send Note On message for new note
752784
if (currentRotation < 3) currentRotation++;
753785
else currentRotation = 0;
754-
midiSendNoteOn(noteValueCheck(fingeredNote + rotations[currentRotation]-24), velocitySend); // send Note On message for new note
786+
int allCheck=4;
787+
while ((0 == rotations[currentRotation]-24) && allCheck){
788+
if (currentRotation < 3) currentRotation++;
789+
else currentRotation = 0;
790+
allCheck--;
791+
}
792+
if (rotations[currentRotation]-24) midiSendNoteOn(noteValueCheck(fingeredNote + rotations[currentRotation]-24), velocitySend); // send Note On message for new note
755793
}
756794
if (!priority) { // mono prio to base note
757795
midiSendNoteOn(fingeredNote, velocitySend); // send Note On message for new note
@@ -785,8 +823,8 @@ void loop() {
785823
}
786824
}
787825
if (rotatorOn) {
788-
midiSendNoteOff(noteValueCheck(activeNote + parallel-24 )); // send Note Off message for old note
789-
midiSendNoteOff(noteValueCheck(activeNote + rotations[currentRotation]-24)); // send Note Off message for old note
826+
if (parallel - 24) midiSendNoteOff(noteValueCheck(activeNote + parallel-24 )); // send Note Off message for old note
827+
if (rotations[currentRotation]-24) midiSendNoteOff(noteValueCheck(activeNote + rotations[currentRotation]-24)); // send Note Off message for old note
790828
}
791829
if (!priority) {
792830
midiSendNoteOff(activeNote); // send Note Off message
@@ -826,8 +864,8 @@ void loop() {
826864
}
827865
}
828866
if (rotatorOn) {
829-
midiSendNoteOff(noteValueCheck(activeNote + parallel-24)); // send Note Off message for old note
830-
midiSendNoteOff(noteValueCheck(activeNote + rotations[currentRotation]-24)); // send Note Off message for old note
867+
if (parallel-24) midiSendNoteOff(noteValueCheck(activeNote + parallel-24)); // send Note Off message for old note
868+
if (rotations[currentRotation]-24) midiSendNoteOff(noteValueCheck(activeNote + rotations[currentRotation]-24)); // send Note Off message for old note
831869
}
832870
if ((parallelChord || subOctaveDouble || rotatorOn) && !priority) { // poly playing, send old note off before new note on
833871
midiSendNoteOff(activeNote); // send Note Off message for old note
@@ -851,10 +889,16 @@ void loop() {
851889
}
852890
}
853891
if (rotatorOn) {
854-
midiSendNoteOn(noteValueCheck(fingeredNote + parallel-24), velocitySend); // send Note On message for new note
892+
if (parallel-24) midiSendNoteOn(noteValueCheck(fingeredNote + parallel-24), velocitySend); // send Note On message for new note
855893
if (currentRotation < 3) currentRotation++;
856894
else currentRotation = 0;
857-
midiSendNoteOn(noteValueCheck(fingeredNote + rotations[currentRotation]-24), velocitySend); // send Note On message for new note
895+
int allCheck=4;
896+
while ((0 == rotations[currentRotation]-24) && allCheck){
897+
if (currentRotation < 3) currentRotation++;
898+
else currentRotation = 0;
899+
allCheck--;
900+
}
901+
if (rotations[currentRotation]-24) midiSendNoteOn(noteValueCheck(fingeredNote + rotations[currentRotation]-24), velocitySend); // send Note On message for new note
858902
}
859903

860904
if (!priority) {
@@ -1445,16 +1489,61 @@ void readSwitches() {
14451489
K6=RHp2;
14461490
K7=RHp3;
14471491

1448-
pinkyKey = LHs;
1492+
pinkyKey = LHs || ((lpinky3==MOD) && LHp3);
14491493

1450-
int qTransp = (pinkyKey && (pinkySetting < 25)) ? pinkySetting-12 : 0;
1494+
int qTransp = ((pinkyKey && (pinkySetting < 25)) ? pinkySetting-12 : 0) + ((LHp3 && lpinky3) ? lpinky3-13 : 0);
14511495

14521496

14531497
// Calculate midi note number from pressed keys
1454-
1455-
//fingeredNote=startNote+1-2*LH1-(LHb && !(LH1 && LH2))-LH2-(LH2 && LH1)-2*LH3+LHp1-LHp2+(RHs && !LHp1)-RH1-(RH1 && LH3)-RH2-2*RH3+RHp1-RHp2-2*RHp3+octaveR*12+(octave-3)*12+transpose-12+qTransp;
14561498

1457-
fingeredNoteUntransposed=startNote+1-2*LH1-(LHb && !(LH1 && LH2))-LH2-(LH2 && LH1)-2*LH3+LHp1-LHp2+(RHs && !LHp1)-RH1-(RH1 && LH3)-RH2-2*RH3+RHp1-RHp2-2*RHp3+octaveR*12;
1499+
if (0==fingering){ //EWI standard fingering
1500+
//fingeredNote=startNote+1-2*LH1-(LHb && !(LH1 && LH2))-LH2-(LH2 && LH1)-2*LH3+LHp1-LHp2+(RHs && !LHp1)-RH1-(RH1 && LH3)-RH2-2*RH3+RHp1-RHp2-2*RHp3+octaveR*12+(octave-3)*12+transpose-12+qTransp;
1501+
1502+
fingeredNoteUntransposed=startNote+1-2*LH1-(LHb && !(LH1 && LH2))-LH2-(LH2 && LH1)-2*LH3+LHp1-LHp2+(RHs && !LHp1)-RH1-(RH1 && LH3)-RH2-2*RH3+RHp1-RHp2-2*RHp3+octaveR*12;
1503+
} else if (1==fingering) { //EWX extended EWI fingering - lift LH1 for extended range up, touch RHp3 for extended range down
1504+
fingeredNoteUntransposed=startNote+1-2*LH1-(LHb && !(LH1 && LH2))-LH2-(LH2 && LH1)-2*LH3+LHp1-LHp2+(RHs && !LHp1)-RH1-(RH1 && LH3)-RH2-2*RH3+RHp1-RHp2-2*RHp3+9*(!LH1 && LH2 && LH3)-10*(!RH3 && RHp3)+octaveR*12;
1505+
} else if (2==fingering) { //Sax fingering
1506+
saxFinger[0] = LH1;
1507+
saxFinger[1] = LHb;
1508+
saxFinger[2] = LH2;
1509+
saxFinger[3] = LH3;
1510+
saxFinger[4] = LHp1;
1511+
saxFinger[5] = RH1;
1512+
saxFinger[6] = RH2;
1513+
saxFinger[7] = RH3;
1514+
saxFinger[8] = RHp1;
1515+
saxFinger[9] = RHp2;
1516+
saxFinger[10] = RHp3;
1517+
1518+
byte matched = 0;
1519+
byte combo = 0;
1520+
1521+
while (matched<11 && combo<17)
1522+
{
1523+
combo++;
1524+
matched = 0;
1525+
for (byte finger=0; finger < 11; finger++)
1526+
{
1527+
if ((saxFinger[finger] == saxFingerMatch[combo-1][finger]) || (saxFingerMatch[combo-1][finger] == 2)) matched++;
1528+
}
1529+
}
1530+
if (matched<11 && combo==17) fingeredNoteUntransposed=lastFingering; else fingeredNoteUntransposed = startNote+1+saxFingerResult[combo-1]-LHp2+RHs+octaveR*12;
1531+
} else if (3==fingering) { // EVI fingering
1532+
fingeredNoteUntransposed = startNote
1533+
- 2*RH1 - RH2 - 3*RH3 //"Trumpet valves"
1534+
- 5*LH1 //Fifth key
1535+
+ 2*RHs + 4*RHp3 //Trill keys +2 and +4
1536+
+ (!LH2 || !LH3 || LHp2) // Trill +1 achieved by lifting finger from LH2 or LH3, or touching LHp2
1537+
+ octaveR*12; //Octave rollers
1538+
} else { // EVI fingering with reversed octave rollers
1539+
fingeredNoteUntransposed = startNote
1540+
- 2*RH1 - RH2 - 3*RH3 //"Trumpet valves"
1541+
- 5*LH1 //Fifth key
1542+
+ 2*RHs + 4*RHp3 //Trill keys +2 and +4
1543+
+ (!LH2 || !LH3 || LHp2) // Trill +1 achieved by lifting finger from LH2 or LH3, or touching LHp2
1544+
+ (6-octaveR)*12; //Octave rollers, reversed
1545+
}
1546+
14581547
int fingeredNoteRead = fingeredNoteUntransposed + transpose - 12 + qTransp;
14591548

14601549
if (pinkyKey) pitchlatch = fingeredNoteUntransposed; //use pitchlatch to make settings based on note fingered

NuEVI/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Compile options, comment/uncomment to change
77

8-
#define FIRMWARE_VERSION "1.4.4" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
8+
#define FIRMWARE_VERSION "1.4.5" // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<<
99

1010
#define ON_Delay 20 // Set Delay after ON threshold before velocity is checked (wait for tounging peak)
1111
#define CCN_Port 5 // Controller number for portamento level

NuEVI/globals.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#define LVLP 28
2727
#define GLD 29
2828

29+
#define MOD 13
30+
31+
2932
//Vibrato direction
3033
#define UPWD 1
3134
#define DNWD 0
@@ -80,6 +83,8 @@ extern unsigned short fastPatch[7];
8083
extern unsigned short extraCT2; // OFF:1-127
8184
extern unsigned short levelCC; // 0-127
8285
extern unsigned short levelVal; // 0-127
86+
extern unsigned short fingering; // 0-4 EWI,EWX,SAX,EVI,EVR
87+
extern unsigned short lpinky3; // 0-25 (OFF, -12 - MOD - +12)
8388
extern uint16_t gateOpenEnable;
8489
extern uint16_t specialKeyEnable;
8590
extern byte rotatorOn;
@@ -133,6 +138,28 @@ extern int breathLevel;
133138
extern byte portIsOn;
134139
extern int oldport;
135140

141+
#if defined(NURAD)
142+
// Key variables, TRUE (1) for pressed, FALSE (0) for not pressed
143+
extern byte LHs;
144+
extern byte LH1; // Left Hand key 1 (pitch change -2)
145+
extern byte LHb; // Left Hand bis key (pitch change -1 unless both LH1 and LH2 are pressed)
146+
extern byte LH2; // Left Hand key 2 (with LH1 also pressed pitch change is -2, otherwise -1)
147+
extern byte LH3; // Left Hand key 3 (pitch change -2)
148+
extern byte LHp1; // Left Hand pinky key 1 (pitch change +1)
149+
extern byte LHp2; // Left Hand pinky key 2 (pitch change -1)
150+
extern byte LHp3;
151+
extern byte RHs; // Right Hand side key (pitch change -2 unless LHp1 is pressed)
152+
extern byte RH1; // Right Hand key 1 (with LH3 also pressed pitch change is -2, otherwise -1)
153+
extern byte RH2; // Right Hand key 2 (pitch change -1)
154+
extern byte RH3; // Right Hand key 3 (pitch change -2)
155+
extern byte RHp1; // Right Hand pinky key 1 (pitch change +1)
156+
extern byte RHp2; // Right Hand pinky key 2 (pitch change -1)
157+
extern byte RHp3; // Right Hand pinky key 3 (pitch change -2)
158+
extern byte Tr1; // Trill key 1 (pitch change +2) (EVI fingering)
159+
extern byte Tr2; // Trill key 2 (pitch change +1)
160+
extern byte Tr3; // Trill key 3 (pitch change +4)
161+
#endif
162+
136163
// Key variables, TRUE (1) for pressed, FALSE (0) for not pressed
137164
extern byte K1; // Valve 1 (pitch change -2)
138165
extern byte K2; // Valve 2 (pitch change -1)

NuEVI/hardware.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define __HARDWARE_H
33

44
#define REVB
5-
//#define NURAD
5+
#define NURAD
66

77
#if defined(NURAD) //NuRAD <<<<<<<<<<<<<<<<<<<<<<<
88

0 commit comments

Comments
 (0)