Help Led matix isn't lighting up correctly Is it a Hardware or software issue? I am trying to reverse engineer the project from this video: https://youtu.be/zc1zbwheyE0?t=50s.  

From the video a visible 10 wires are going from the LEDs to the Arduino mega, i am assuming that they are wired in a 5x5 matrix (5 rows, 5 columns) given that there are 25 keys on the Midi controller so there most be 25 LEDs.
I reconstructed the project the best a could from observing the video, but my issue is when i press 3 keys 5 LEDs light up unlike in the original video where 3 keys are pressed and 3 LEDs light up(as seen @ 0:50 of the video).
This is the issue i am having : http://imgur.com/a/9SOEJ.
I am thinking the issue is related to how i have my LEDs wired, but my LEDs are wired exactly the same as in the video. isn't it ? is there something i might have missed? How is the project in the video able to light up 3 LEDs without having an issue with extra LEDs lighting up in their matrix? how can i fix my circuit to replicate the video?  

Here is some of my coed for turning on an LED when a key is pressed:

&lt;include MIDI.h&gt;

MIDI_CREATE_DEFAULT_INSTANCE();

byte anodes[5] = {30, 32, 34, 36,38};

byte cathodes[5] = {31, 33, 35, 37,39};

byte data1 = 0;

void setPinTo5V(byte pin) //set a pin given to this function to a 5V voltage source

{
    pinMode(pin, OUTPUT);
    digitalWrite(pin, HIGH);
}

void setPinToGND(byte pin) //set a pin given to this function to a GROUND (GND pin)
{
    pinMode(pin, OUTPUT);
    digitalWrite(pin, LOW);
}

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

void MyHandleNoteOn(byte channel, byte pitch, byte velocity)
{
    data1 = MIDI.getData1();

    if (data1==48){//C3
        setPinTo5V(anodes[0]);//set pin 30 to 5V
        setPinToGND(cathodes[0]);//set pin 31 to GND

        delay(1); //do nothing for 1 ms
    } //this is done for all 25 keys

}


any help would be appreciated Thanks.
This was what i was able to come up with, once a notes is press the blink function turns the LED on and off really fast. i am now have trouble getting the led to turn off once the notes is being pressed am not sure if the code is exiting from the while loop.

include 

MIDI_CREATE_DEFAULT_INSTANCE();

define LedR 3   //

define LedC 4 //pin for each led

byte data1 = 0;

unsigned long previousMillisR[2]; //[x] = number of leds

unsigned long previousMillisC[2]; //[x] = number of leds

int Status [25];

void setup() { 

MIDI.begin(MIDI_CHANNEL_OMNI);

MIDI.setHandleNoteOn(MyHandleNoteOn);

MIDI.setHandleNoteOff(MyHandleNoteOff);

pinMode(LedR, OUTPUT);   

pinMode(LedC, OUTPUT);  

}

void loop() {

MIDI.read();

//BlinkLedR(LedR,2000, 0);   //BlinkLed( which led, interval, one of the 
stored prevMillis

//BlinkLedC(LedC, 10, 0);  //last parameters must be different for each 
led

}

void BlinkLedR (int led, int interval, int array){   

//(long) can be omitted if you dont plan to blink led for very long time I think

if (((long)millis() - previousMillisR[array]) >= interval){ 

previousMillisR[array]= millis(); //stores the millis value in the 


selected array

digitalWrite(led, !digitalRead(led)); //changes led state

}

}

void BlinkLedC (int led, int interval, int array){   

//(long) can be omitted if you dont plan to blink led for very long 
time I think

if (((long)millis() - previousMillisC[array]) >= interval){ 

previousMillisC[array]= millis(); //stores the millis value in the 


selected array

digitalWrite(led, !digitalRead(led)); //changes led state


}

}

void MyHandleNoteOn(byte channel, byte pitch, byte velocity) { 

data1 = MIDI.getData1();

if (data1==48){//C3

Status[0]=1;

while(Status[0]==1) {

BlinkLedR(LedR, 10, 0);   //BlinkLed( which led, interval, one of the 

stored prevMillis

BlinkLedC(LedC, 1, 0);  //last parameters must be different for each led

if (Status==!1){

break;

}

}

}

}

void MyHandleNoteOff(byte channel, byte pitch, byte velocity) { 

data1 = MIDI.getData1();

if (data1==48){//C3

Status[0]=0;

}

}