Hi,
I have been using a custom MIDI controller that I built successfully for about a year now - it has 4 faders and 4 pots. The one thing that has always bugged me though, is that if it is turned on when I open Nuendo (and previously Cubase), then it doesn't't work. It is recognised by Nuendo as being connected, but when moving any of the faders or pots, Nuendo receives nothing. Even turning it off and on doesn't't help. The only way, whilst Nuendo is open, to get it to work, is to go into the MIDI ports and hide it and then make it visible again. Then it works.
On the other hand, if it is turned off when I open Nuendo, and then turn it on when I have a project open, it all works fine straight away!
Obviously it is not a major issue, but the amount of times I have forgotten to make sure it is off before opening Nuendo and then had to go into the Port settings is rather annoying! So, is this normal behaviour for a MIDI device or is there something I should be adding to the code to help?
I am using a Teensy LC 3.2 and connecting via USB MIDI. Here is the code I am using:
Thanks!
I have been using a custom MIDI controller that I built successfully for about a year now - it has 4 faders and 4 pots. The one thing that has always bugged me though, is that if it is turned on when I open Nuendo (and previously Cubase), then it doesn't't work. It is recognised by Nuendo as being connected, but when moving any of the faders or pots, Nuendo receives nothing. Even turning it off and on doesn't't help. The only way, whilst Nuendo is open, to get it to work, is to go into the MIDI ports and hide it and then make it visible again. Then it works.
On the other hand, if it is turned off when I open Nuendo, and then turn it on when I have a project open, it all works fine straight away!
Obviously it is not a major issue, but the amount of times I have forgotten to make sure it is off before opening Nuendo and then had to go into the Port settings is rather annoying! So, is this normal behaviour for a MIDI device or is there something I should be adding to the code to help?
I am using a Teensy LC 3.2 and connecting via USB MIDI. Here is the code I am using:
Code:
#include <MIDI.h>
// the MIDI channel number to send messages
const int channel = 1;
//
int const numPins = 8; // number of analog inputs for CC
int currentVal[numPins];
int newVal[numPins];
int analogPins[] = {
1,2,3,4,5,6,7,8 // which analog pins to use
};
int analogPinsCC[] = {
1,11,15,7,16,17,18,19 // which CC to use
};
void setup() {
Serial.begin(38400);
}
elapsedMillis msec = 0;
void loop() {
// analog pins
if (msec >= 20) {
msec = 0;
for (int i = 0; i < numPins; i++) {
newVal[i] = analogRead(analogPins[i]);
if (abs(newVal[i] - currentVal[i])>10 ) {
usbMIDI.sendControlChange(analogPinsCC[i], newVal[i]>>3, channel);
currentVal[i] = newVal[i];
}
}
}
// output
while (usbMIDI.read()); // read and discard any incoming MIDI messages
delay(5);
}
Thanks!