Arduino drum machine

here’s a part of his answer :

Yes, please share it.
Please note I didn’t write the MIDI out code - someone else kindly shared it with me and I don’t know who originally added this to the O2 sketch, but I can’t take any credit for it.

here’s the schem

and code :