Pages: [1]   Go Down
Author Topic: I am tearing my heir out over MIDI!  (Read 839 times)
0 Members and 1 Guest are viewing this topic.
Norway@Oslo
Offline Offline
Edison Member
*
Karma: 13
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I can not get my Arduino to play my keyboards through MIDI smiley-sad 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
Logged

0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 13
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

And no, it does not work..
Logged

Greenwood, Indiana
Offline Offline
God Member
*****
Karma: 0
Posts: 508
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://itp.nyu.edu/physcomp/Labs/MIDIOutput
http://www.arduino.cc/playground/Main/InterfacingWithHardware#MIDI

Ton of info
« Last Edit: July 05, 2010, 02:17:33 am by mrmeval » Logged

If it was designed by man it can be repaired by man.

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: July 05, 2010, 02:52:58 am by scswift » Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 13
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

smiley
« Last Edit: July 05, 2010, 03:53:36 am by AlphaBeta » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34210
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 13
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Grumpy!  smiley

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

Pages: [1]   Go Up
Jump to: