From 150290a9cbcda289545c0ac5a34c284eae7d37e5 Mon Sep 17 00:00:00 2001 From: Johan Berglund Date: Sun, 2 Sep 2018 11:35:19 +0200 Subject: [PATCH] USB MIDI device name file added. Made breath CC update every CC_INTERVAL, while all others every other. --- NuEVI.ino | 20 ++++++++++++-------- name.c | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 name.c diff --git a/NuEVI.ino b/NuEVI.ino index 40c2ef5..e2b373a 100644 --- a/NuEVI.ino +++ b/NuEVI.ino @@ -25,7 +25,7 @@ PROGRAMME FUNCTION: EVI Wind Controller using the Freescale MP3V5004GP breath #define REVB //Uncomment the following line if you have Teensyduino 1.4.1 or later, to make pitch bend over USB-MIDI work. -//#define NEWTEENSYDUINO +#define NEWTEENSYDUINO // Pin definitions @@ -474,7 +474,7 @@ byte doPatchUpdate=0; byte legacy = 0; byte legacyBrAct = 0; - +byte halfTime = 0; byte FPD = 0; int breathLevel=0; // breath level (smoothed) not mapped to CC value @@ -740,7 +740,7 @@ void setup() { display.setTextColor(WHITE); display.setTextSize(1); display.setCursor(85,52); - display.println("v.1.2.5"); // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<< + display.println("v.1.2.6"); // FIRMWARE VERSION NUMBER HERE <<<<<<<<<<<<<<<<<<<<<<< display.display(); delay(1500); @@ -1083,11 +1083,15 @@ void mainLoop() { if (millis() - ccSendTime > CC_INTERVAL) { // deal with Breath, Pitch Bend, Modulation, etc. breath(); - pitch_bend(); - portamento_(); - extraController(); - statusLEDs(); - doorKnobCheck(); + halfTime = !halfTime; + if (halfTime){ + pitch_bend(); + portamento_(); + } else { + extraController(); + statusLEDs(); + doorKnobCheck(); + } ccSendTime = millis(); } if (millis() - pixelUpdateTime > pixelUpdateInterval){ diff --git a/name.c b/name.c new file mode 100644 index 0000000..1e9a706 --- /dev/null +++ b/name.c @@ -0,0 +1,19 @@ +// To give your project a unique name, this code must be +// placed into a .c file (its own tab). It can not be in +// a .cpp file or your main sketch (the .ino file). + +#include "usb_names.h" + +// Edit these lines to create your own name. The length must +// match the number of characters in your custom name. + +#define MIDI_NAME {'N','u','E','V','I',' ','M','I','D','I'} +#define MIDI_NAME_LEN 10 + +// Do not change this part. This exact format is required by USB. + +struct usb_string_descriptor_struct usb_string_product_name = { + 2 + MIDI_NAME_LEN * 2, + 3, + MIDI_NAME +};