Serial to MIDI

Hi,

First post, first project, first headache :P! Help please
I’m trying to send MIDI to ableton live using the Spikenzielabs Serial to Midi converter. I’ve got 1 pot connected to the Mega2560 so it’s the whole USB-MIDI problem…
I thought I’d try programming the bytes needed for a control change even though that seems a bit easy…

const int analogInPin = A0;
const int analogOutPin = 13;

int senseval = 0;
int val = 0;


void setup() {
  Serial.begin(38400);
}

void loop() {
  
    senseval= analogRead(analogInPin);
    val = map(senseval, 0, 1023, 0, 127);      
    analogWrite(analogOutPin, val);             // 1 LED to check that the Mega is reading voltage
	 
    Serial.write("10110001");                   // Control Change + Channel 1 
    Serial.write("00000111");                   // Control number 7
    Serial.println(val, BIN);                   // Mapped Reading in Binary
    
    delay(10);
 
}

Here’s what I get in the Serial Port… 10110001 for CC and Channel, 00000111 for Control Number, and 0 to 111111 depending the pot’s position

10110001000001110
10110001000001110
10110001000001110
10110001000001110
10110001000001110
10110001000001110
10110001000001110
10110001000001110
1011000100000111111
101100010000011110001
101100010000011111011
1011000100000111100100
1011000100000111101110
1011000100000111111010
10110001000001111000110
10110001000001111010111
10110001000001111101000
10110001000001111111101
10110001000001111111110
10110001000001111111111
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111111110
10110001000001111100001
10110001000001111000000
1011000100000111100100
10110001000001111011
10110001000001110
10110001000001110
10110001000001110
10110001000001110
10110001000001110
10110001000001110

[/table]

Ableton live sees the MIDI ports but can’t feel any control change.
Not sure at all if this is the way go…

I love a good poll. This one isn't. I voted 2, anyway.

Antoine,

I know very little about Ableton, but I've done several successful MIDI projects with Arduino.

The first thing I noticed was your baud rate. MIDI is 31250 baud, not 38400. From a computer standpoint, 31250 seems like a pretty arbitrary data rate, but the MIDI specification is what it is. MIDI interfaces are designed to expect this exact baud rate.

If you're feeding MIDI into the computer, you are effectively emulating an outboard MIDI device, so you should use 31250 as the baud rate. It always works for me, so I don't question it.

Hope this helps.

Hi andylama,

Thanks for your reply. The Serial to MIDI converter doesn't work when I set the Baud rate to 31250. It doesn't let me select any MIDI Out Port but it can only start converting once everything is set up.

So I guess as long as I can't use the MIDI rate, no MIDI messages for me. I'll maybe try using Hiduino...