Spreading hits evenly
How do you spread 3 hits across 8 beats as evenly as possible? Beat i gets a hit when (i * hits) % steps < hits. This one rule makes rhythms heard all over the world.
Challenge A:3 hits over 8 beats: loop i over range(8); when (i * 3) % 8 < 3, play kick(i + 1).