I'm try to make velocity midi keboard by using two keypad, and two keypad have the same row pin, can anyone help me fix this code?

On the underside of that keyboard with all the wires coming out, are those components diodes ?
If you are going to arrange the keys in a matrix and you want to press multiple keys simultaneously, then there has to be diodes in the circuit. However, then you must then connect these correctly. See What is the actual circuitry of a keypad and the switch - #2 by LarryD