Guys, I dont think I am double posting here, because this is a much more general question than my others, but has anyone actually had any REAL success with midi firmware on the 16U2 chip.
Ive been trying this out:
http://hunt.net.nz/users/darran/weblog/52882/
His example code suggests you need to set Serial to 115200 to use it. I adjusted the example to a simpler one:
/* Arduino USB MIDI demo */
void setup()
{
Serial.begin(31250);
delay(200);
}
void loop()
{
noteOn();
delay(500);
noteOff();
delay(500);
}
// Send a MIDI note-on message. Like pressing a piano key
// channel ranges from 0-15
void noteOn() {
digitalWrite(4,HIGH); // indicate we're sending MIDI data (led)
midiMsg( (0x90 | 0x01), 0x3d, 0x40);
}
// Send a MIDI note-off message. Like releasing a piano key
void noteOff() {
digitalWrite(4,LOW);
midiMsg( (0x80 | 0x01), 0x3d, 0x40);
}
// Send a general MIDI message
void midiMsg(byte cmd, byte data1, byte data2) {
Serial.write(cmd);
Serial.write(data1);
Serial.write(data2);
}
[code]
which should turn a note on and off once a second. My led is blinking, however my midi monitor (MIDI-OX) is producing sparadic data. at sparadic times. I have tried loads of different baud rates - 115200, 57600 (because I saw someone else using this) and the obvious 31250.
Some feedback would be really appreciated over this.
[/code]