I'm playing with some super simple USB MIDI code, but it keeps crashing. Anyone have any ideas why?

I'm running Arduino 1.0.4 on OSX 10.6.8, Teensyduino version 1.15

byte cc = 0;
byte last_cc = 0;
void setup() {

void loop() {
cc = analogRead(0) >> 3;

if(abs(last_cc - cc) > 3) {
usbMIDI.sendControlChange(1, cc, 1);
last_cc = cc;


Not much goin on here. I have a pot wired as a voltage divider with the wiper connected to A0. It starts up fine, then I map it to a parameter in ableton live, works for about 30 seconds, then stops sending any midi. If I reset, it works again (but only for ~30s, then stops again)

Thanks in advance!