Arduino Uno MIDI OUT to PC, wrong messages displayed

I am trying to use Arduino Uno to generate MIDI Out Messages, use DIN 5 connector, and then read the message via MIDI to USB cable.

I changed the baudrate to 115200 and used hairless MIDI to read the values using Arduino's own USB, and this works.

On Hairless MIDI, directly using USB Serial:

After changing baudrate back to 31250, the cable also receives messages via its MIDI in (turns the LED on). But the displayed MIDI message is wrong.´

On MIDI to USB cable, using RTMIDI listener:

midiprob2

Schematics are from: Arduino MIDI Output Basics – MIDI.org

My code is:

#include <MIDI.h>

// Simple tutorial on how to receive and send MIDI messages.
// Here, when receiving any message on channel 4, the Arduino
// will blink a led and play back a note for 1 second.


struct SerialMidiSettings {
    static unsigned long BaudRate;  // dynamic baudrate
};

// MIDI serial interface
midi::SerialMIDI<HardwareSerial, SerialMidiSettings> serialMIDI(Serial);
midi::MidiInterface<midi::SerialMIDI<HardwareSerial, SerialMidiSettings>> MIDI(serialMIDI);

unsigned long SerialMidiSettings::BaudRate = 31250; // Başlangıç baudrate

void setup()
{
    pinMode(LED_BUILTIN, OUTPUT);
    MIDI.begin(4);                      // Launch MIDI and listen to channel 4
}
 
void loop()
{

        digitalWrite(LED_BUILTIN, HIGH);
        MIDI.sendNoteOn(42, 127, 1);    // Send a Note (pitch 42, velo 127 on channel 1)
        delay(1000);		            // Wait for a second
        MIDI.sendNoteOff(42, 0, 1);     // Stop the note
        digitalWrite(LED_BUILTIN, LOW);
}

Posting my schematic also as a photo, in case I am missing something:

Any idea what I am doing wrong?

Thanks in advance.

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