I am simply trying to read the value of a linear potentiometer with the Teensy 3.1, and convert this to MIDI.

Click image for larger version. 

Name:	photo.jpg 
Views:	152 
Size:	177.9 KB 
ID:	1576

here is the code
_____________________
int a0 =0;
void setup(){
pinMode(15, INPUT);
}

void loop(){
a0 = analogRead(15);
usbMIDI.sendControlChange(1, a0, 1);
Serial.println(a0);
}

______________________

when I read the voltage of pin 15 - it linearly increases as I slide the pot. as its supposed to.
when I look at the values on the arduino serial monitor - it linearly increases (from 0 -1023) as I slide the pot. as its supposed to.

but the actual MIDI data that is sent is very hectic. It seems as though the slider is scrolling through random numbers 0-127...(except when all the way down it stays at 0, and all the way up, at 127) it isnt linear and is constantly jumping around. the only trend is that i tend to see values>100 mostly when the slider is in the middle of its track



any ideas??