Skip to content

Commit 7bf7e7a

Browse files
committed
Articles - fix code indentation level of coded beats
1 parent ac02f2a commit 7bf7e7a

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

etc/doc/tutorial/en/A.03-coded-beats.md

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ styles such as drum and bass, breakbeat, hardcore techno and breakcore.
2929

3030
I'm sure you're excited to hear that it's also built right into Sonic
3131
Pi. Clear up a buffer and throw in the following code:
32-
33-
sample :loop_amen
32+
33+
sample :loop_amen
3434

3535
Hit *Run* and boom! You're listening to one of the most influential
3636
drum breaks in the history of dance music. However, this sample wasn't famous
@@ -42,10 +42,10 @@ for being played as a one-shot, it was built for being looped.
4242
Let's loop the Amen Break by using our old friend the `live_loop`
4343
introduced in this tutorial last month:
4444

45-
live_loop :amen_break do
46-
sample :loop_amen
47-
sleep 2
48-
end
45+
live_loop :amen_break do
46+
sample :loop_amen
47+
sleep 2
48+
end
4949

5050
OK, so it is looping, but there's an annoying pause every time
5151
round. That is because we asked it to sleep for `2` beats and with
@@ -62,10 +62,10 @@ of control via optional parameters such as `amp:`, `cutoff:` and
6262
we just call them *opts* to keep things nice and simple.
6363
[Breakout box end]
6464

65-
live_loop :amen_break do
66-
sample :loop_amen, beat_stretch: 2
67-
sleep 2
68-
end
65+
live_loop :amen_break do
66+
sample :loop_amen, beat_stretch: 2
67+
sleep 2
68+
end
6969

7070
Now we're dancing! Although, perhaps we want to speed it up or slow it down
7171
to suit the mood.
@@ -77,11 +77,11 @@ breakcore? One simple way of doing this is to play with time - or in
7777
other words mess with the tempo. This is super easy in Sonic Pi - just
7878
throw in a `use_bpm` into your live loop:
7979

80-
live_loop :amen_break do
81-
use_bpm 30
82-
sample :loop_amen, beat_stretch: 2
83-
sleep 2
84-
end
80+
live_loop :amen_break do
81+
use_bpm 30
82+
sample :loop_amen, beat_stretch: 2
83+
sleep 2
84+
end
8585

8686
Whilst you're rapping over those slow beats, notice that we're still
8787
sleeping for 2 and our BPM is 30, yet everything is in time. The
@@ -101,11 +101,11 @@ cutoff filter of the sampler. By default this is disabled but you can
101101
easily turn it on:
102102

103103

104-
live_loop :amen_break do
105-
use_bpm 50
106-
sample :loop_amen, beat_stretch: 2, cutoff: 70
107-
sleep 2
108-
end
104+
live_loop :amen_break do
105+
use_bpm 50
106+
sample :loop_amen, beat_stretch: 2, cutoff: 70
107+
sleep 2
108+
end
109109

110110
Go ahead and change the `cutoff:` opt. For example, increase it to 100,
111111
hit *Run* and wait for the loop to cycle round to hear the change in the
@@ -122,13 +122,13 @@ left over.
122122
Another great tool to play with is the slicer FX. This will chop (slice)
123123
the sound up. Wrap the `sample` line with the FX code like this:
124124

125-
live_loop :amen_break do
126-
use_bpm 50
127-
with_fx :slicer, phase: 0.25, wave: 0, mix: 1 do
128-
sample :loop_amen, beat_stretch: 2, cutoff: 100
129-
end
130-
sleep 2
131-
end
125+
live_loop :amen_break do
126+
use_bpm 50
127+
with_fx :slicer, phase: 0.25, wave: 0, mix: 1 do
128+
sample :loop_amen, beat_stretch: 2, cutoff: 100
129+
end
130+
sleep 2
131+
end
132132

133133
Notice how the sound bounces up and down a little more. (You can hear
134134
the original sound without the FX by changing the `mix:` opt to `0`.)
@@ -150,27 +150,27 @@ all this means, just type it in, hit Run, then start live coding it by
150150
changing opt numbers and see where you can take it. Please do share what
151151
you create! See you next time...
152152

153-
use_bpm 100
154-
155-
live_loop :amen_break do
156-
p = [0.125, 0.25, 0.5].choose
157-
with_fx :slicer, phase: p, wave: 0, mix: rrand(0.7, 1) do
158-
r = [1, 1, 1, -1].choose
159-
sample :loop_amen, beat_stretch: 2, rate: r, amp: 2
160-
end
161-
sleep 2
162-
end
163-
164-
live_loop :bass_drum do
165-
sample :bd_haus, cutoff: 70, amp: 1.5
166-
sleep 0.5
167-
end
168-
169-
live_loop :landing do
170-
bass_line = (knit :e1, 3, [:c1, :c2].choose, 1)
171-
with_fx :slicer, phase: [0.25, 0.5].choose, invert_wave: 1, wave: 0 do
172-
s = synth :square, note: bass_line.tick, sustain: 4, cutoff: 60
173-
control s, cutoff_slide: 4, cutoff: 120
174-
end
175-
sleep 4
176-
end
153+
use_bpm 100
154+
155+
live_loop :amen_break do
156+
p = [0.125, 0.25, 0.5].choose
157+
with_fx :slicer, phase: p, wave: 0, mix: rrand(0.7, 1) do
158+
r = [1, 1, 1, -1].choose
159+
sample :loop_amen, beat_stretch: 2, rate: r, amp: 2
160+
end
161+
sleep 2
162+
end
163+
164+
live_loop :bass_drum do
165+
sample :bd_haus, cutoff: 70, amp: 1.5
166+
sleep 0.5
167+
end
168+
169+
live_loop :landing do
170+
bass_line = (knit :e1, 3, [:c1, :c2].choose, 1)
171+
with_fx :slicer, phase: [0.25, 0.5].choose, invert_wave: 1, wave: 0 do
172+
s = synth :square, note: bass_line.tick, sustain: 4, cutoff: 60
173+
control s, cutoff_slide: 4, cutoff: 120
174+
end
175+
sleep 4
176+
end

0 commit comments

Comments
 (0)