Problem With MIDI Library

Hi Guys, Total noob here so go easy on me please,
I’m trying to make a piano led visualizer using a 8*8 led dot matrix and MAX7219 and an Arduino UNO R3.
I use Loopbe1 and Hairless midi and Synthesia to mimic a midi instrument and tunnel midi signal to arduino serial.
Using MIDI Library it’s supposed to be easy but my code doesn’t work.
I changed Baud Rate in MIDISetting.h to 115200 as hairless midi is.

#include <MIDI.h>
#include <LedControl.h>
/*pin 4 is connected to the DataIn 
  pin 11 is connected to the CLK 
  pin 12 is connected to LOAD 
We have only a single MAX72XX*/
LedControl lc = LedControl(4, 11, 12, 1);

MIDI_CREATE_DEFAULT_INSTANCE();

void handleNoteOn(byte channel, byte note, byte velocity)
{
  if (note==36){lc.setLed(0,0,0,true);}
  if (note==37){lc.setLed(0,1,0,true);}
  if (note==38){lc.setLed(0,2,0,true);}
  if (note==39){lc.setLed(0,3,0,true);}
  if (note==40){lc.setLed(0,4,0,true);}
  if (note==41){lc.setLed(0,5,0,true);}
  if (note==42){lc.setLed(0,6,0,true);}
  if (note==43){lc.setLed(0,7,0,true);}
  if (note==44){lc.setLed(0,0,1,true);}
  if (note==45){lc.setLed(0,1,1,true);}
  if (note==46){lc.setLed(0,2,1,true);}
  if (note==47){lc.setLed(0,3,1,true);}
  if (note==48){lc.setLed(0,4,1,true);}
  if (note==49){lc.setLed(0,5,1,true);}
  if (note==50){lc.setLed(0,6,1,true);}
  if (note==51){lc.setLed(0,7,1,true);}
  if (note==52){lc.setLed(0,0,2,true);}
  if (note==53){lc.setLed(0,1,2,true);}
  if (note==54){lc.setLed(0,2,2,true);}
  if (note==55){lc.setLed(0,3,2,true);}
  if (note==56){lc.setLed(0,4,2,true);}
  if (note==57){lc.setLed(0,5,2,true);}
  if (note==58){lc.setLed(0,6,2,true);}
  if (note==59){lc.setLed(0,7,2,true);}
  if (note==60){lc.setLed(0,0,3,true);}
  if (note==61){lc.setLed(0,1,3,true);}
  if (note==62){lc.setLed(0,2,3,true);}
  if (note==63){lc.setLed(0,3,3,true);}
  if (note==64){lc.setLed(0,4,3,true);}
  if (note==65){lc.setLed(0,5,3,true);}
  if (note==66){lc.setLed(0,6,3,true);}
  if (note==67){lc.setLed(0,7,3,true);}
  if (note==68){lc.setLed(0,0,4,true);}
  if (note==69){lc.setLed(0,1,4,true);}
  if (note==70){lc.setLed(0,2,4,true);}
  if (note==71){lc.setLed(0,3,4,true);}
  if (note==72){lc.setLed(0,4,4,true);}
  if (note==73){lc.setLed(0,5,4,true);}
  if (note==74){lc.setLed(0,6,4,true);}
  if (note==75){lc.setLed(0,7,4,true);}
  if (note==76){lc.setLed(0,0,5,true);}
  if (note==77){lc.setLed(0,1,5,true);}
  if (note==78){lc.setLed(0,2,5,true);}
  if (note==79){lc.setLed(0,3,5,true);}
  if (note==80){lc.setLed(0,4,5,true);}
  if (note==81){lc.setLed(0,5,5,true);}
  if (note==82){lc.setLed(0,6,5,true);}
  if (note==83){lc.setLed(0,7,5,true);}
  if (note==84){lc.setLed(0,0,6,true);}
  if (note==85){lc.setLed(0,1,6,true);}
  if (note==86){lc.setLed(0,2,6,true);}
  if (note==87){lc.setLed(0,3,6,true);}
  if (note==88){lc.setLed(0,4,6,true);}
  if (note==89){lc.setLed(0,5,6,true);}
  if (note==90){lc.setLed(0,6,6,true);}
  if (note==91){lc.setLed(0,7,6,true);}
  if (note==92){lc.setLed(0,0,7,true);}
  if (note==93){lc.setLed(0,1,7,true);}
  if (note==94){lc.setLed(0,2,7,true);}
  if (note==95){lc.setLed(0,3,7,true);}
  if (note==96){lc.setLed(0,4,7,true);} 
}

void handleNoteOff(byte channel, byte note, byte velocity)
{
  if (note==36){lc.setLed(0,0,0,false);}
  if (note==37){lc.setLed(0,1,0,false);}
  if (note==38){lc.setLed(0,2,0,false);}
  if (note==39){lc.setLed(0,3,0,false);}
  if (note==40){lc.setLed(0,4,0,false);}
  if (note==41){lc.setLed(0,5,0,false);}
  if (note==42){lc.setLed(0,6,0,false);}
  if (note==43){lc.setLed(0,7,0,false);}
  if (note==44){lc.setLed(0,0,1,false);}
  if (note==45){lc.setLed(0,1,1,false);}
  if (note==46){lc.setLed(0,2,1,false);}
  if (note==47){lc.setLed(0,3,1,false);}
  if (note==48){lc.setLed(0,4,1,false);}
  if (note==49){lc.setLed(0,5,1,false);}
  if (note==50){lc.setLed(0,6,1,false);}
  if (note==51){lc.setLed(0,7,1,false);}
  if (note==52){lc.setLed(0,0,2,false);}
  if (note==53){lc.setLed(0,1,2,false);}
  if (note==54){lc.setLed(0,2,2,false);}
  if (note==55){lc.setLed(0,3,2,false);}
  if (note==56){lc.setLed(0,4,2,false);}
  if (note==57){lc.setLed(0,5,2,false);}
  if (note==58){lc.setLed(0,6,2,false);}
  if (note==59){lc.setLed(0,7,2,false);}
  if (note==60){lc.setLed(0,0,3,false);}
  if (note==61){lc.setLed(0,1,3,false);}
  if (note==62){lc.setLed(0,2,3,false);}
  if (note==63){lc.setLed(0,3,3,false);}
  if (note==64){lc.setLed(0,4,3,false);}
  if (note==65){lc.setLed(0,5,3,false);}
  if (note==66){lc.setLed(0,6,3,false);}
  if (note==67){lc.setLed(0,7,3,false);}
  if (note==68){lc.setLed(0,0,4,false);}
  if (note==69){lc.setLed(0,1,4,false);}
  if (note==70){lc.setLed(0,2,4,false);}
  if (note==71){lc.setLed(0,3,4,false);}
  if (note==72){lc.setLed(0,4,4,false);}
  if (note==73){lc.setLed(0,5,4,false);}
  if (note==74){lc.setLed(0,6,4,false);}
  if (note==75){lc.setLed(0,7,4,false);}
  if (note==76){lc.setLed(0,0,5,false);}
  if (note==77){lc.setLed(0,1,5,false);}
  if (note==78){lc.setLed(0,2,5,false);}
  if (note==79){lc.setLed(0,3,5,false);}
  if (note==80){lc.setLed(0,4,5,false);}
  if (note==81){lc.setLed(0,5,5,false);}
  if (note==82){lc.setLed(0,6,5,false);}
  if (note==83){lc.setLed(0,7,5,false);}
  if (note==84){lc.setLed(0,0,6,false);}
  if (note==85){lc.setLed(0,1,6,false);}
  if (note==86){lc.setLed(0,2,6,false);}
  if (note==87){lc.setLed(0,3,6,false);}
  if (note==88){lc.setLed(0,4,6,false);}
  if (note==89){lc.setLed(0,5,6,false);}
  if (note==90){lc.setLed(0,6,6,false);}
  if (note==91){lc.setLed(0,7,6,false);}
  if (note==92){lc.setLed(0,0,7,false);}
  if (note==93){lc.setLed(0,1,7,false);}
  if (note==94){lc.setLed(0,2,7,false);}
  if (note==95){lc.setLed(0,3,7,false);}
  if (note==96){lc.setLed(0,4,7,false);} 
}

void setup()
{
    MIDI.setHandleNoteOn(handleNoteOn);
    MIDI.setHandleNoteOff(handleNoteOff);
    MIDI.begin(MIDI_CHANNEL_OMNI);
}

void loop()
{
    MIDI.read();
}

It would be appreciated if someone debug my code :slight_smile: Thanks
(I used LedControl library to drive dot matrix and MIDILibrary to extract note on and off commands from serial data flow)

i Have no experience with 'Hairless' but maybe you can elaborate on

Using MIDI Library it's supposed to be easy but my code doesn't work.

what part doesn't work ? are you receiving MIDI ? Use the built-in led to signal a note-on or a note-off command (any command not one of the ones you want the leds to respond to)
Do the leds work ? run a small sequence to verify that the commands you are sending actually do something to the led-matrix.
btw, there must be a more elegant way of doing this (i mean there is !)

 if (note==65){lc.setLed(0,5,3,true);}
  if (note==66){lc.setLed(0,6,3,true);}
  if (note==67){lc.setLed(0,7,3,true);}
  if (note==68){lc.setLed(0,0,4,true);}
  if (note==69){lc.setLed(0,1,4,true);}
  if (note==70){lc.setLed(0,2,4,true);}
  if (note==71){lc.setLed(0,3,4,true);}
  if (note==72){lc.setLed(0,4,4,true);}
  if (note==73){lc.setLed(0,5,4,true);}
  if (note==74){lc.setLed(0,6,4,true);}
  if (note==75){lc.setLed(0,7,4,true);}
  if (note==76){lc.setLed(0,0,5,true);}