stopping a played midi note in functions

You need to send:

Serial.write(0xB0+channel_number);
Serial.write(0x7B);
Serial.write((byte)0x00);