Run-length encoding
Compression saves space: instead of "x...x..." write "x3x3" — a hit, then 3 rests. Decoding it back into beats is a great puzzle.
Challenge A:Decode rests: code = [0, 3, 2] lists how many rests come before each kick. b = 1; for gap in code: b += gap, kick(b), then b += 1.