Otherwise wont be able to quantise, to start with. All it could do would be replay at same time you did, but then to find a right end of 4 beats/8 beats( depend on time signature) would be a bit of a guess ?!? and if you were able to overcome that, then whatever inconsistency you might have misplayed( cause you would do) it would be more and more noticeable as the track/loop keeps playing.
Sorry if i sound discouraging, but i am a just trying to find the logic in it and see if it works( which at the moment, i dont think it will just with the arduino, unless you have other peripherals connected to it in order to work).
Is it making sense to you ?!?
for what you aresaying you would be better off with a behringer controller like the BCF or BCR 2000 and a live performance sequencer /DAW like reason/ableton and a PC!! Cheap and 100% effective !
And im not on about the buttons you need but the BPM clock in which the code to base it self. Im assuming you d have a good knowledge of all the intricacies of MID and sequencing