Arduino only sending MIDI reset messanges

I have been trying to get my Arduino mega to send midi messages using the following tutorial: https://docs.arduino.cc/built-in-examples/communication/Midi

However, according to my midi monitor, it is only sending reset messages, no notes. Is there a fix for this?

Please post the sketch that you have a problem with here, using code tags when you do

/*
  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 play the notes
  F#-0 (0x1E) to F#-5 (0x5A) in sequence.

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

  created 13 Jun 2006
  modified 13 Aug 2012
  by Tom Igoe

  This example code is in the public domain.

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Midi
*/

void setup() {
  // Set MIDI baud rate:
  Serial.begin(31250);
}

void loop() {
  // play notes from F#-0 (0x1E) to F#-5 (0x5A):
  for (int note = 0x1E; note < 0x5A; note ++) {
    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, note, 0x45);
    delay(100);
    //Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
    noteOn(0x90, note, 0x00);
    delay(100);
  }
}

// plays a MIDI note. Doesn't check to see that cmd is greater than 127, or that
// data values are less than 127:
void noteOn(int cmd, int pitch, int velocity) {
  Serial.write(cmd);
  Serial.write(pitch);
  Serial.write(velocity);
}


Change all those ints into chr

Still no luck

Try swapping over the two pins on the MIDI socket.

Otherwise post a photo of your wiring.

Here's a picture of my board. I tried swapping the pins, and now it won't even send reset, even when switched back.

I was hoping for a good photograph, one that was well lit so that I could actually make out where the wires go.
Can you tell me what are the colour bands on the resistors, it is hard to see them on the photograph.

It looks like you have connected pin 13 to ground of the MIDI socket but that could just be because it is too dark to see where exactly it goes.

What are you plugging this into?

Does the MIDI port show up in the MIDI monitor list of active devices? Have you ticked the box to say you want to monitor it?

Well I just tested this and it works for me. I prefer soldering. Here is the setup.

Note the ground isn't necessary for it to work.
And this is the MIDI monitor screen.

Plug it into the input connector of your MIDI to USB lead.

Maybe your MIDI to USB lead is not working or your resistors are wrong, or you have got a faulty connection on your bread board?

Edit :- Just spotted that you have not got the signal going to the TX pin but to one of the analogue pins. That would explain why it didn't work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.