Web MIDI. Not Safari or Firefox, which do not implement it. On iPhone use MIDIWeb Browser — measured under 5ms jitter, against 30ms in Web MIDI Browser. With no MPC attached it falls back to a General MIDI note map, and with no MIDI at all to a drum kit synthesised in the page.
Record to MPC plays the phrase once in real time while arming the MPC's own sequencer. Put the MPC on the track you want to capture first — its storage is not writable from here, so recording is the only way in, and it takes as long as the phrase does.
Plays continuously until you press Stop, looping the phrase while it varies. Bar 1 as written; later bars drift. Bar height shows the velocity that will actually sound — metric dynamics make heavy beats louder, with of hits displaced onto weak steps.