home/ atoms/ sonic-pi-play-sleep

play and sleep are the two primitives for pitch and timing in Sonic Pi

play N sends a MIDI note number (or symbol like :C3) to the default synth. sleep N pauses execution for N beats, separating events in time. Together they form the sequencing foundation: play sets what to hear, sleep sets when the next sound starts. Non-integer sleep values (e.g., sleep 0.5) allow subdivisions. Sonic Pi maps MIDI 60 to middle C; note symbols like :Fs3 and :Eb4 work for accidentals. Multiple consecutive play calls without sleep sound simultaneously.

Examples

play 72 sleep 0.5 play 75 sleep 0.5 play 79

Assessment

Write a rising scale of 8 notes using only play and sleep. Then add a second play inside each step to create parallel harmony.

“low numbers make lower beeps_ and _high numbers make higher beeps”
corpus · sonic-pi-built-in-tutorial · chunk 3