Flexible building blocks
The best functions are small and flexible: give them the right inputs and they can build any part of a song.
Challenge A:def beat_at(measure, beat): return (measure - 1) * 4 + beat. Play kick(beat_at(2, 1)) and snare(beat_at(1, 3)).