Arduino Micro MIDI Controller; Error: got an unexpected data byte 0x...

Hello,

I am using an Arduino Micro on a OS X Sierra with the latest & greatest arduino software.

I’m trying to make a MIDI controller with two pots and two buttons using code from a guy named Musico Nerd. The issue is that somewhere between; Hairless MIDI <–> Serial Bridge; an error is caused in Hairless when I push the buttons, and nothing happens when I turn the potentiometers:

Error: got an unexpected data byte 0x72.
Error: got an unexpected data byte 0x75.
Error: got an unexpected data byte 0x74.
Error: got an unexpected data byte 0x74.
Error: got an unexpected data byte 0x6f.
Error: got an unexpected data byte 0x6e.
Error: got an unexpected data byte 0x3a.
Error: got an unexpected data byte 0x20.
Error: got an unexpected data byte 0x31.
Error: got an unexpected data byte 0x34.
Error: got an unexpected data byte 0x34.
Error: got an unexpected data byte 0x37.
Error: got an unexpected data byte 0x32.
Error: got an unexpected data byte 0x31.
Error: got an unexpected data byte 0x32.
Error: got an unexpected data byte 0x37.
Error: got an unexpected data byte 0x42.
Error: got an unexpected data byte 0x75.
Error: got an unexpected data byte 0x74.
Error: got an unexpected data byte 0x74.

Additionally, turning my pots does not bring up any of these errors, so it shows no signs of my computer picking it up. I’m confident that my circuit is set up correctly.

I have not written the code for this project, and my coding knowledge is limited. However, I have tried the following after googling the error messages:

  1. Changing the Variation Threshold in line 53.

  2. Changing the ‘print’ in lines 110 and 122 to ‘write’ because that helped someone else with the same problem fix their code

I really have no clue how else I could fix this. Any suggestions would be much appreciated.

Attached is my code.

Thank you,
Jeff

TestController.ino (6.62 KB)

You have the Serial.begin() statement commented out, but there are Serial.print() statements that are not commented out. For Serial.print() to work, you must uncomment the Serial.begin() statement.

A link to the MidiUSB library would be useful.

Serial.print() statements in noteOn(), noteOff(), and controlChange() would tell you whether those functions ever get called.

Use Tools + Auto Format to correct that piss-poor indenting.

A link to the MidiUSB library would be useful.

The MidiUSB library is available in the library manager of the IDE, it’s from Arduino: https://github.com/arduino-libraries/MIDIUSB

Hairless MIDI <–> Serial Bridge

You shouldn’t use the Hairless MIDI Serial Bridge. The Micro with the MIDIUSB library should show up as a MIDI device on your PC. The additional serial interface that show up is the debugging channel and that one will not provide MIDI data, so it’s pretty normal that the bridge is complaining.

Thank you both for your help! The progress I've made from my last post is that the buttons AND potentiometers offically work in the DAW I'm using!!! I realized I was relying way too much on Hairless MIDI to receive correct signals like the ones I saw in this YouTube tutorial I was using for guidance:

Thanks again! This couldn't be better timing, as me and my buddies are recording today, so I can show off my new MIDI Controller! :slight_smile: