@@ -7,10 +7,10 @@ Sonic Pi on stage and gig with it.
77
88## Free your mind
99
10- Before we get into the real details of how Sonic Pi works in this
11- tutorial, I'd like to give you an experience of what it's like to live
12- code. Don't worry if you don't understand much (or any) of this. Just
13- try to hold onto your seats and enjoy...
10+ Before we get into the real details of how Sonic Pi works in the rest of
11+ this tutorial, I'd like to give you an experience of what it's like to
12+ live code. Don't worry if you don't understand much (or any) of
13+ this. Just try to hold onto your seats and enjoy...
1414
1515## A live loop
1616
2424```
2525
2626Now, press the ` Run ` button and you'll hear a nice fast bass drum
27- beating away. Now, whilst it's still running, change the sleep
28- value. Try something higher like ` 1 ` . Press the ` Run ` button again -
29- notice how the drum speed has changed. Also, * remember this moment* , this
30- is the first time you've live coded with Sonic Pi and it's unlikely to
31- be your last...
27+ beating away. If at any time you wish to stop the sound just hit the
28+ ` Stop ` button. Although don't hit it just yet... Instead, follow these steps:
3229
33- Let's add something else into the mix. Above ` sample :bd_haus ` add the
34- line ` sample :ambi_choir, rate: 0.3 ` . Your code should look like this:
30+ 1 . Make sure the bass drum sound is still running
31+ 2 . Change the ` sleep ` value from ` 0.5 ` to something higher like ` 1 ` .
32+ 3 . Press the ` Run ` button again
33+ 4 . Notice how the drum speed has changed.
34+ 5 . Finally, * remember this moment* , this is the first time you've live
35+ coded with Sonic Pi and it's unlikely to be your last...
36+
37+ Ok, that was simple enough. Let's add something else into the mix. Above
38+ ` sample :bd_haus ` add the line ` sample :ambi_choir, rate: 0.3 ` . Your
39+ code should look like this:
3540
3641
3742```
4348```
4449
4550Now, play around. Change the rates - what happens when you use high
46- values, or small values? What happens if you choose a really small
47- ` sleep ` value? Can you make it go so fast your computer can't keep up?
51+ values, or small values or negative values? See what happens when you
52+ change the ` rate: ` value for the ` :ambi_choir ` sample just slightly (say
53+ to 0.29). What happens if you choose a really small ` sleep ` value? See
54+ if you can make it go so fast your computer will stop with an error
55+ because it can't keep up (if that happens, just choose a bigger ` sleep `
56+ time and hit ` Run ` again).
4857
4958Try commenting one of the ` sample ` lines out by adding a ` # ` to the
5059beginning:
@@ -62,18 +71,19 @@ Notice how it tells the computer to ignore it, so we don't hear it. This
6271is called a comment. In Sonic Pi we can use comments to remove and add
6372things into the mix.
6473
65- Finally, let me leave you something to play with. Take the code below,
74+ Finally, let me leave you something to fun play with. Take the code below,
6675and copy it into a spare workspace. Now, don't try to understand it too
6776much other than see that there are two loops - so two things going round
6877at the same time. Now, do what you do best - experiment and play
6978around. Here are some suggestions
7079
7180* Try changing the blue ` rate: ` values to hear the sample sound change
72- * Try changing the ` sleep ` times and hear that both loops can spin round at
73- different rates.
74- * Try uncommenting the two sample lines and enjoy the sound of the
75- guitar played backwards.
76- * Try changing any of the blue numbers
81+ * Try changing the ` sleep ` times and hear that both loops can spin round
82+ at different rates.
83+ * Try uncommenting the sample line (remove the ` # ` ) and enjoy the sound
84+ of the guitar played backwards.
85+ * Try changing any of the blue ` mix: ` values to numbers between ` 0 ` (not
86+ in the mix) and ` 1 ` (fully in the mix).
7787
7888
7989Remember to press ` Run ` and you'll hear the change next time the loop
@@ -84,19 +94,23 @@ jam again. Making mistakes is how you'll learn the quickest...
8494
8595```
8696live_loop :guit do
87- with_fx :flanger , mix: 1, depth: 5 do
97+ with_fx :echo , mix: 0.3, phase: 0.25 do
8898 sample :guit_em9, rate: 0.5
8999 end
90100# sample :guit_em9, rate: -0.5
91- # sample :guit_em9, rate: -0.25
92101 sleep 8
93102end
94103
95104live_loop :boom do
96- with_fx :reverb, room: 0.9 do
105+ with_fx :reverb, room: 1 do
97106 sample :bd_boom, amp: 10, rate: 1
98107 end
99108 sleep 8
100109end
101110```
102111
112+ Now, keep playing and experimenting until your curiosity about how this
113+ all actually works kicks in and you start wondering what else you can do
114+ with this. You're now ready to read the rest of the tutorial.
115+
116+ So what are you waiting for...
0 commit comments