Download - Coding Music with Sonic Pi
![Page 1: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/1.jpg)
Coding Music with
Allen Heard
![Page 2: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/2.jpg)
Sonic Pi @sonic_pi is written and developed by Sam Aaron @samaaron and is supported by the Raspberry Pi
Foundation and Broadcom
There are also versions for Mac and Windows
The software
![Page 3: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/3.jpg)
![Page 4: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/4.jpg)
PlayControls
EditorControls
Help & Info
CodeEditor
LogViewer
The Interface
![Page 5: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/5.jpg)
First Beeps
Type play 67 and click run
![Page 6: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/6.jpg)
First Beeps
Change the number to 70 and click run
Then try 60
So, low numbers make lower beeps!
![Page 7: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/7.jpg)
Chords
Multiple plays = plays the notes at the same time
![Page 8: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/8.jpg)
Melody
What if we want to play one note after another?
Sleep 1 here is 1 beat but for now think of it as 1 second
![Page 9: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/9.jpg)
Melody
Reduce the value of sleep to make it faster
![Page 10: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/10.jpg)
Midi Values
You could even convert the midi note values to actual notes and code them like this too by adding a colon!
(s for #, number for octave)But we’ll stick to midi values for this workshop
![Page 11: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/11.jpg)
Melody
Let’s add some more code to our tune
![Page 12: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/12.jpg)
Synthesisers
Sonic Pi comes with a range of synthesisers
![Page 13: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/13.jpg)
No, it's Frozen!!!
Complete this intro from the sheet, also try changing the synth
![Page 14: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/14.jpg)
Samples
Open a new workspace and try some samples
There are lots listed in the sample section, it also shows you how to write them in your code
![Page 15: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/15.jpg)
Looping
Simple looping forever
![Page 16: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/16.jpg)
Looping
Looping a set amount of times
![Page 17: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/17.jpg)
Functions
We can ‘call’ a piece of code when we need it
![Page 18: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/18.jpg)
Threads
We can then have multiple functions playing at once,
called threads
![Page 19: Coding Music with Sonic Pi](https://reader031.vdocuments.site/reader031/viewer/2022030309/58f2a1961a28ab9a498b4587/html5/thumbnails/19.jpg)
Allen HeardYsgol Bryn Elian