Browse Source

sonicpi attempt to automate drums

rorist 1 month ago
parent
commit
27dbf225fa
1 changed files with 47 additions and 0 deletions
  1. 47 0
      sonicpi/drums-functions.txt

+ 47 - 0
sonicpi/drums-functions.txt

@@ -0,0 +1,47 @@
+use_bpm 60
+
+# Straight
+#$kick = [1, 0, 1, 0]
+#$hh = [0, 1, 0, 1]
+
+# More HH
+$kick = [1, 0, 1, 0]
+$hh = [1, 1, 1, 1]
+
+# double kick
+#$kick = [1, 0, 1, 1]
+#$hh = [0, 1, 0, 1]
+
+# triple kick
+#$kick = [1, 1, 1, 0]
+#$hh = [0, 0, 0, 1]
+
+# More times
+#$kick = [1, 0, 1, 1, 0]
+#$hh = [1, 0, 1, 0, 1]
+
+live_loop :drums_kick do
+  $i = 0
+  $len = $kick.length
+  $len.times do
+    if $kick[$i] != 0
+      sample :drum_heavy_kick
+    end
+    sleep 1 / $len
+    $i += 1
+  end
+end
+
+live_loop :drums_hh do
+  $i = 0
+  $len = $hh.length
+  $len.times do
+    if $hh[$i] != 0
+      sample :drum_cymbal_closed
+    end
+    sleep 1 / $len
+    $i += 1
+  end
+  
+end
+