can't get basic midi sketch to work

I had similar problems getting the Midi sketch as supplied in 1.0 to work, and having had some experience with Picaxes and Midi knew the hardware was OK. In the end I transferred the essentials from my own Picaxe code, modified the Arduino example with a more formal midi structure, and found it worked without any further hardware modifications. I have tested it on a ROLAND MT-32, an old machine, but a classic and a standard.

/*
 MIDI note player
 
 This sketch shows how to use the serial transmit pin (pin 1) to send MIDI note data.
 If this circuit is connected to a MIDI synth, it will repeat 
 the chromatic scale from F#-0 (0x1E) to F#-5 (0x5A).

 The circuit:
 * digital in 1 connected to MIDI jack pin 5 through 100-ohm resistor
 * MIDI jack pin 2 + shield connected to ground
 * MIDI jack pin 4 connected to +5V through 100-ohm resistor
 Attach a MIDI cable to the jack, then to a MIDI synth, and play music.

 created 13 Jun 2006
 modified 30 Aug 2011
 by Tom Igoe
 Modified by Rob Ward
 23 March 2012
 Tested on a Roland MT-32 (a classic!) 

 This example code is in the public domain.
 
 http://www.arduino.cc/en/Tutorial/MIDI
 
 */

const int my_channel=1;  // on Channel 1 :-)
const int my_instrument=1;  // Acoustic Piano
      int my_velocity=96;  //max=127, min=0 volume
void setup() {
  //  Set MIDI baud rate:
  Serial.begin(31250); //standard midi serial baud rate
  delay (200);
  //Establish channel and Instrument
  midi_com(my_channel,my_instrument);
  delay(200);  
}

void loop() {
  // play notes from F#-0 (0x1E) to F#-5 (0x5A):
  for (int pitch = 0x1E; pitch < 0x5A; pitch ++) {
    //
    midi_note_on(my_channel, pitch, my_velocity);
    delay(100);// sets duration of the note
    //Turn off the note begun above
    midi_note_off(my_channel, pitch, 0);   
    delay(100);// sets separation between notes
  }
}

//  Starts a MIDI note.  Doesn't check to see that
//  1<=channel<=16, or that data values are less than 127
void midi_note_on(int channel, int pitch, int velocity) {
  Serial.write(0x90+channel);
  Serial.write(pitch);
  Serial.write(velocity);
}
//  Stops a MIDI note.  Doesn't check to see that
//  1<=channel<=16, or that data values are less than 127
void midi_note_off(int channel, int pitch, int velocity) {
  Serial.write(0x80+channel);
  Serial.write(pitch);
  Serial.write(velocity);
}
//  Sends a midi command. Does not check if 
//  1<=channel<=16 or 1<=instrument<=128
void midi_com(int channel, int instrument) {
  Serial.write(0xC0+channel);
  Serial.write(instrument);
}

Obviously it does not address any midi input into the Arduino, but the chances of this sketch at least getting you to first base in sending midi from your Arduino are greatly improved.
The original Arduino sketch was too simplified for me, and apparently the same for my old Roland.

Rob

PS I used two 200ohm resistors, one from the 5V to the midi socket, and the other 200ohm from the output pin to the midi socket. If either accidentally get shorted to ground or 5V then no damage will be done.