Go Down

Topic: I am tearing my heir out over MIDI! (Read 903 times) previous topic - next topic

AlphaBeta

I can not get my Arduino to play my keyboards through MIDI :( I've done it before but it just won't work now.

So I am a bit embarrased to ask but I'm desperate...


I've tried multiple keyboards (and checked by running a keyboard off another through MIDI) and multiple arduinos (diecimila 168 and Mini Pro 328 16MHz).

I've wired according to this diagram:


I have tried to run the arduino off an external powersupply (with the USB disconnected) but that did not work either...

WHAT IS WRONG!?

Here is the code:
Quote

//from examples *modified
int note = 60;

void setup() {
  //  Set MIDI baud rate:
  //Serial.begin(31250);
  Serial.begin(9600);
  pinMode(13,OUTPUT);
}

void loop() {
    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, note, 0x45);
    digitalWrite(13,HIGH);
    delay(1000);
    //Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
    noteOn(0x90, note, 0x00);   
    digitalWrite(13,LOW);
    delay(1000);
}

void noteOn(int cmd, int pitch, int velocity) {
  Serial.print(cmd, BYTE);
  Serial.print(pitch, BYTE);
  Serial.print(velocity, BYTE);
}


/me fail

billroy

The baud rate appears to be set to 9600 instead of the proper 31250.  Does it work if you comment out the 9600 and enable the 31250?

-br
http://bitlash.net
http://entropymouse.com

AlphaBeta

How embarrasing!
The 9600 was just for some debugging. I use the 31250 when testing :)

And no, it does not work..

mrmeval

#3
Jul 05, 2010, 09:16 am Last Edit: Jul 05, 2010, 09:17 am by mrmeval Reason: 1
http://itp.nyu.edu/physcomp/Labs/MIDIOutput
http://www.arduino.cc/playground/Main/InterfacingWithHardware#MIDI

Ton of info
If it was designed by man it can be repaired by man.

scswift

#4
Jul 05, 2010, 09:51 am Last Edit: Jul 05, 2010, 09:52 am by scswift Reason: 1
I don't know anything about midi, so I can't help you here but...  I'm guessing english is your second language. :-)

http://en.wikipedia.org/wiki/Heir
http://en.wikipedia.org/wiki/Hair

AlphaBeta

#5
Jul 05, 2010, 10:51 am Last Edit: Jul 05, 2010, 10:53 am by AlphaBeta Reason: 1
Using 220ohm (I think the image says 228 [ch937]), read all the info, english is my second language and the post was written as fast as my fingers could type.

:)

Grumpy_Mike

Normally it is pins 4 & 5 that get swapped, is the diagram you posted looking at the front of the socket or looking at the back?

The ground on pin 2 is not needed and a proper MIDI lead will not have a wire in this position. In fact a ground on pin 2 can cause problems sometimes. Yes I know the ITP web sit has one on but that is one hell of a bad site for errors.

AlphaBeta

Thank you Grumpy!  :)

I think the MIDI page should mention that it views the connector from the front (got to blame someone right ;)).

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy