Hairless Midi "Warning:got a status byte..."

Hello!

I'm new to the forum, and attempting to trigger midi notes using an FSR. In hairless debug, I'm receiving the error:

Warning: got a status byte when we were expecting 1 more data bytes, sending possibly incomplete MIDI message 0x90

and:

Warning: got a status byte when we were expecting 2 more data bytes, sending possibly incomplete MIDI message 0xa2

I've read the other post about this, and changed the baud to 115200. Didn't help. Setting flow control to XON/XOFF seems to help for 80% of these errors. It is sending the notes, but It keeps crashing hairless. Any help would be appreciated :wink:

Code:

//credit to thedude77 & rogue

int fsrC = 0;                  //FSR is on pin 0
int fsrVal = 0;                //variable for reading FSR value
int mappedFsrVal = 0;          //variable for holding remapped FSR value

void setup() {
  Serial.begin(115200);            //MIDI communicates at 31250 baud
}

void loop(){

   fsrVal = analogRead(fsrC);         //read input from FSR
   mappedFsrVal = map(fsrVal, 0, 127, 0, 127);  //map value to 0-127
   if(analogRead(fsrC)){
     midiOUT(0xB0, 6, mappedFsrVal); //CC Volume message
     midiOUT(0x90, 60, mappedFsrVal); //MIDI noteOn message/Ply Middle C
     prevFsrVal = mappedFsrVal;
    delay(250);
    
    }
    
}

void midiOUT(char command, char value1, char value2) {
  Serial.print(command);
  Serial.print(value1);
  Serial.print(value2);

}

I'd like to add that I'm using the serial conversion method because I've tried two different builds of the "direct-as-midi" firmware, both of which don't seem to function on the ATMega16u2.

After the flash and reset, it simply isn't recognized by the arduino compiler. So, back to the stock firmware...

mappedFsrVal = map(fsrVal, 0, 127, 0, 127);  //map value to 0-127

Should be remapped, something like:

mappedFsrVal = map(fsrVal, 0, 1000, 0, 127);  //map value to 0-127

I received this error a lot at first while setting up my project. Make sure to try each of the settings, even all the baud rate options to see which eliminates the problem.

1 Like