First off, I promised days ago that I'd post the source and I will, just as soon as I tidy it up and make it safe and accessible for others.
Right, it works like this: You've got a sample that fits in around 24k of memory. It's an 8-bit low-samplerate sample, so pretty crunchy. Now, the MIDI notes are mapped so that each one plays a slice 3K long. If you play each slice in sequence at the right speed you get the original beat. You can speed it up, and they overlap slightly - this works for a few BPM up without making it sound "stumbly", and it works for a few BPM slower without the gaps between being noticable - a bit of reverb will mask them anyway. You can play the slices out of sequence for that traditional breakcore broken beat stuff, snare rinses and so on.
Okay but what about the glitchyness? Well the sample playback is done by a counter. Load the counter with the start address of the sample, and when it reaches start+3k stop playback. Simple. To get the glitching, you bitwise AND the address counter with a bitmask. If you AND it with 0x0f then it will always play the first sample of a block of 16, 16 times in a row. Mask off 0x01 and it will play all the even-numbered samples twice. Mask off 0x80 and it will play a block of 127 samples twice giving a stutter effect. There are two parameters, bitmask and shift, which work to give you a total of about 1000 different bitmasks you can apply to the address counter. Some sound musically useful, some just make clicky noises. You have to experiment to find the good bits.