Missing data bytes while receiving MIDI [solved]

Hello!

So, I just stared a project where I want to control a servo-motor with MIDI. I set up a MIDI-receiver circuit (see attachment) and connected it to my Arduino (the data-"output" to RX, 5V to 5V, ground to ground). Then I tried triggering the servo with different MIDI notes but that didn't work somehow. So I downloaded MegunoLink(can be used as a serial monitor @ 31250 Baud) to look what's going on and weirdly I am missing all the data bytes. (see below)

This is my code:

#include <Servo.h> 

Servo myservo;

byte commandByte;
byte noteByte;
byte velocityByte;

byte noteOn = 144;

void setup() {
  Serial.begin(38400);
  myservo.attach(9);
}

void checkMIDI(){
  do{
    if (Serial.available()){
      commandByte = Serial.read();
      noteByte = Serial.read();
      velocityByte = Serial.read();
    }
    if(commandByte == noteOn){
      Serial.print(commandByte, HEX);
      Serial.print(" ");
      Serial.print(noteByte, HEX);
      Serial.print(" ");
      Serial.println(velocityByte, HEX);
    }
  }
  while (Serial.available() > 2);
}

void loop() {
  checkMIDI();
}

and this is my output when pressing any note (in this case 5 notes successively):

90 FF FF
90 FF FF
90 FF FF
90 FF FF
90 FF FF

For outputting MIDI I tried my audio interface with Ableton, and directly from my MIDI keyboard so the problem (probably) has to be the circuit or the code.

Why do I receive only the command byte and nothing else? {

Why do I receive only the command byte and nothing else?

Because you look at the serial buffer and if it contains one byte you read three from it and two of them havent arrived yet. When you read an empty buffer you get a value of 0xFF.

So use :-
if (Serial.available() >= 3 ){

Ah okay thank you!
It works now.