Skip to content

Instantly share code, notes, and snippets.

@dandrake
Last active October 22, 2025 21:13
Show Gist options
  • Select an option

  • Save dandrake/4d5e1f99f3c08ead419b99b3742acdbf to your computer and use it in GitHub Desktop.

Select an option

Save dandrake/4d5e1f99f3c08ead419b99b3742acdbf to your computer and use it in GitHub Desktop.
Sonic Pi code for Steve Reich's "Clapping"
# my version of Steve Reich's Clapping for Sonic Pi:
# https://en.wikipedia.org/wiki/Clapping_Music
# https://youtu.be/lzkOFJMI5i8?si=oaBTc4WBR_DC2SJJ
# https://sonic-pi.net/
use_bpm 120
claps = [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0].ring
live_loop :clapping do
sample :perc_snap, amp: claps.tick, pan: 1
sleep 0.5
end
counter = 0
live_loop :skipper do
if counter % 24 == 23 then
counter = tick(step: 2)
else
counter = tick
end
sample :perc_snap2, amp: claps[counter], pan: -1
sleep 0.5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment