Nested loops
A loop can go inside another loop. Every time the outer loop goes around once, the inner loop runs all the way through.
🔢 Math connection: 2 measures × 4 beats = 8 beats. Loops inside loops are equal groups, and m * 4 + b finds each beat. RockBlocks Math: Grade 3 · Multiplication as Equal Groups ↗
Challenge A:Two measures of hihat: for m in range(2): (m is 0, then 1), and inside it for b in range(1, 5): play hihat(m * 4 + b).