We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65f78bb commit 06877fdCopy full SHA for 06877fd
devils_staircase.rb
@@ -0,0 +1,33 @@
1
+# Welcome to Sonic Pi v2.0
2
+#volume, octave(frequency, finger/hand
3
+amount_fingers = 5
4
+
5
+define :finger do |n|
6
+ in_thread do
7
+ t = 0
8
+ loop do
9
+ puts "finger is #{n}"
10
+ if n == 0
11
+ audio_level = t/11.0
12
+ elsif n == amount_fingers-1
13
+ audio_level = 1.0-(t/11.0)
14
+ else
15
+ audio_level = 1
16
+ end
17
+ audio_level
18
+ play 12 * n + 50 + t, amp: audio_level
19
+ sleep 0.5
20
+ if t < 11
21
+ t = t + 1
22
23
24
25
+ puts t
26
27
28
29
+end
30
31
+amount_fingers.times do |n|
32
+ finger(n)
33
0 commit comments