Forum Rule: Always post complete source code & details to reproduce any issue!
-
Teensy 3.0 USB MIDI crashing?
Hello!
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() {
analogReadResolution(10);
analogReadAveraging(4);
}
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!
-
it stops sending? or stops receiving? my guess is that you might be sending your midi data a bit too fast. midi baud rate is just 31250bps, and certain hardware (and i figure software) can handle much less. try using a timer
Last edited by mxxx; 08-04-2013 at 02:09 PM.
-
I'm having a similar problem, just posted about it here: http://forum.pjrc.com/threads/24179-...ses-midi-crash
Did you ever figure this out?
-

Originally Posted by
mxxx
it stops sending? or stops receiving? my guess is that you might be sending your midi data a bit too fast. midi baud rate is just 31250bps, and certain hardware (and i figure software) can handle much less. try using a timer
MIDI baud rate over DIN is 31250. Over USB its 12000000 (12Mbit/sec).
As Paul posted in the other thread, this is likely due to the Teensy MIDI receive buffer not being read, and eventually filling up. The sending is fine. The problem is that Ableton is talking back.
Last edited by Nantonos; 09-06-2013 at 05:15 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules