simple midi contoller

Status
Not open for further replies.
Ya because I can't use the previously linked code on my PC because it crashes my midi driver+overloads the midi inputs on my DAW Causing it to lock up. The sketch looks pretty nice despite this problem.

If you are getting hundreds of MIDI messages you very likely had an analog pin set to send MIDI but it was not connected to hot or ground or anywhere in between (called leaving an analog pin floating).

I just spent a hour figuring out I had a cold-solder joint was leaving one of two pins floating... and until I did I was getting massive MIDI garbage...
Last week I had the same thing when I misread the pinout... it's very easy to have this problem come up and the only evidence is the MIDI barrage.

With the time-limit feature it would stop crashing your host but it would still produce garbage MIDI.

It's best to have a utility that can act as a MIDI monitor to make sure the MIDI you are seeing is the MIDI you are expecting.

I now leave a delay command commented out in the analog loop and I make it active when I need to see the MIDI coming from the device at a reasonable speed.
Code:
//************ANALOG SECTION**************
void getAnalogData(){  
  for (int i=0;i<A_PINS;i++){
    // update the ResponsiveAnalogRead object every loop
    analog[i].update(); 
    // if the repsonsive value has change, print out 'changed'
    if(analog[i].hasChanged()) {
      data[i] = analog[i].getValue()>>3;
      if (data[i] != dataLag[i] && CCsentElapsed[i] > MIDIdelay )
        dataLag[i] = data[i];
        usbMIDI.sendControlChange(CCID[i], data[i], channel);
        //delay(100); //un-comment to slow loop down to see what's happening...
      }
    }
  }
}
 
Status
Not open for further replies.
Back
Top