Last week, I gave a workshop at the
University of Iowa College of Engineering, introducing students to the
Sonic Pi language and environment. This music-oriented programming language is designed for
live coding. It can also be used to introduce text-based coding to people with no programming experience. The students were very curious and active: we had the time to go through all of the examples and to introduce what live coding is in the electronic music community. Find below the code excerpts I used for this one-hour workshop.Play a noteplay 70
Cmd-R to run the codeChordplay 72
play 75
play 79Melodyplay 72
sleep 1
play 75
sleep 1
play 79Play with durations & pitchDuration is in “beats”. Default BPM is 60, i.e. 1 beat is 1 second.
Pitch is the MIDI note number. Try 60.25 if you like eighth tones.First option: amp
play 50, amp: 0.1
sleep 0.25
play 55, amp: 0.2
sleep 0.25
play 57, amp: 0.4
sleep 0.25
play 62, amp: 1Using synthesizersuse_synth :saw
play 38
sleep 0.25
play 50
sleep 0.25…