New to coding and sonic pi! Was working through the sonic pi's website tutorial but learning how to do this was exactly what I was looking for to get me started. You're a great teacher
So greatful to find this channel, I was looking for a better tutorial than the one that comes with the program and this is very clear and easy to follow.
to consolidate your code just make an array for each sound and you can still use i to sort through it in the same loop.... only reason youd want to seperate into different loop is if you need to change the beat or something... @ 16:15
@Mister Bomb this would be the same like arrays but more compact use_bpm 98 define :pattern do |pattern| return pattern.ring.tick == "x" end live_loop :drums1 do sample :bd_haus if pattern "x-x-x----x----x--" sample :sn_zome if pattern "----x--------x---" sample :drum_cymbal_closed if pattern "xxx-x-x-x-x-xx-x-x" sample :drum_cymbal_pedal if pattern "---x----------x---" sleep 0.25 end
Great tuto, thanks a lot. Silly question, is there a way to do : sample :bd_haus if a[i] == 1 or 3 sleep 0.25 or the only way is to make two lines like that : sample :bd_haus if a[i] == 1 sample :bd_haus if a[i] == 3 sleep 0.25
Hello! You can do it in one line of code like this: sample :bd_haus if a[i] == 1 or a[i] == 3 Full example: a = [1, 0, 1, 0, 3, 3, 0, 0] live_loop :a do 8.times do |i| sample :bd_haus if a[i] == 1 or a[i] == 3 sleep 0.25 end end Hope that helps. Thanks for watching.
@@MrBombMusic Aaaaaaand it's me again XD I tried to mess arround with this sequencer style code with synth instead of sample and when the loop is replayed, I have a "parasite" note who comes with the first note of the loop. The way I solved it is to put a rest during a ridiculous short time and on the journal, instead of à 128 I've got a rest, do you think it's normal ? (feel free to take your time to answer of course) Here is my code : use_bpm 80 a = [1, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 5, 0, 4, 0, 3, 0, 2, 0, 3, 0, 4, 0, 2, 0, 0, 0,
7, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 5, 0, 4, 0, 3, 0, 2, 0, 3, 0, 4, 0, 6, 0, 4, 0] define :intro do play c4 sleep define :maintheme do 128.times do |i| play :c4 if a[i] == 1 play :g4 if a[i] == 2 play :a4 if a[i] == 3 play :b4 if a[i] == 4 play :c5 if a[i] == 5 play :d5 if a[i] == 6 play :d4 if a[i] == 7 play :e4 if a[i] == 8 sleep 0.25 end sleep 0.00001 ##Told you it's ridiculous end
Definitely. Someone wrote a blog post about doing that with this concept, but by using emojis in their code to really replicate the use of a grid. Pretty awesome. You can check it out here: gistlog.co/manualbashing/f7b91ecb9ad2169edd7844d7c7f0c07c
You certainly could go that route as that would be a more accurate representation of the drumgrid example I am modeling from. Someone actually did a version of this using strings of emojis for each drum track. Check it out here: gistlog.co/manualbashing/f7b91ecb9ad2169edd7844d7c7f0c07c These videos were originally made for my middle school students só I wanted to keep things somewhat simple for them. Also when I teach about making drumbeats, I have them not do the kick and the snare at the same time so that seemed to be more easily represented in a single array. Same with an open and closed hihat sound
New to coding and sonic pi! Was working through the sonic pi's website tutorial but learning how to do this was exactly what I was looking for to get me started. You're a great teacher
So greatful to find this channel, I was looking for a better tutorial than the one that comes with the program and this is very clear and easy to follow.
🙏🏻
Another newbie to Sonic Pi here, we need more of this so well explained tutorials. Congrats man you totally nail it!
to consolidate your code just make an array for each sound and you can still use i to sort through it in the same loop.... only reason youd want to seperate into different loop is if you need to change the beat or something... @ 16:15
Thank you so much for this clear and thorough explanation of Arrays for Sonic Pi. You got my thumb and sub!
This is brilliant. Great tutorial. Thank you very much!
Dope, Dope, Dope! Thank you for this great tutorial, just what the doctor ordered!
love this channel
@Mister Bomb
this would be the same like arrays but more compact
use_bpm 98
define :pattern do |pattern|
return pattern.ring.tick == "x"
end
live_loop :drums1 do
sample :bd_haus if pattern "x-x-x----x----x--"
sample :sn_zome if pattern "----x--------x---"
sample :drum_cymbal_closed if pattern "xxx-x-x-x-x-xx-x-x"
sample :drum_cymbal_pedal if pattern "---x----------x---"
sleep 0.25
end
Great tuto, thanks a lot.
Silly question, is there a way to do :
sample :bd_haus if a[i] == 1 or 3
sleep 0.25
or the only way is to make two lines like that :
sample :bd_haus if a[i] == 1
sample :bd_haus if a[i] == 3
sleep 0.25
Hello!
You can do it in one line of code like this:
sample :bd_haus if a[i] == 1 or a[i] == 3
Full example:
a = [1, 0, 1, 0, 3, 3, 0, 0]
live_loop :a do
8.times do |i|
sample :bd_haus if a[i] == 1 or a[i] == 3
sleep 0.25
end
end
Hope that helps. Thanks for watching.
@@MrBombMusic You have no idea how much you helped me to clean the mess that I name "code" of one of my tracks XD Thanks a lot !
@@MrBombMusic Aaaaaaand it's me again XD I tried to mess arround with this sequencer style code with synth instead of sample and when the loop is replayed, I have a "parasite" note who comes with the first note of the loop. The way I solved it is to put a rest during a ridiculous short time and on the journal, instead of à 128 I've got a rest, do you think it's normal ? (feel free to take your time to answer of course)
Here is my code :
use_bpm 80
a = [1, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0,
5, 0, 4, 0, 3, 0, 2, 0, 3, 0, 4, 0, 2, 0, 0, 0,
7, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0,
5, 0, 4, 0, 3, 0, 2, 0, 3, 0, 4, 0, 6, 0, 4, 0,
8, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0,
5, 0, 4, 0, 3, 0, 2, 0, 3, 0, 4, 0, 2, 0, 0, 0,
7, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0,
5, 0, 4, 0, 3, 0, 2, 0, 3, 0, 4, 0, 6, 0, 4, 0]
define :intro do
play c4
sleep
define :maintheme do
128.times do |i|
play :c4 if a[i] == 1
play :g4 if a[i] == 2
play :a4 if a[i] == 3
play :b4 if a[i] == 4
play :c5 if a[i] == 5
play :d5 if a[i] == 6
play :d4 if a[i] == 7
play :e4 if a[i] == 8
sleep 0.25
end
sleep 0.00001 ##Told you it's ridiculous
end
nice, thanks for the video :) very useful
Nice. People can also create a matrix, that is, an array of arrays and use only one live_loop.
Definitely. Someone wrote a blog post about doing that with this concept, but by using emojis in their code to really replicate the use of a grid. Pretty awesome. You can check it out here: gistlog.co/manualbashing/f7b91ecb9ad2169edd7844d7c7f0c07c
Finally was able to code smashing pumpkins 1979 drum loop!
Thanks!!!!
Couldn't you just have used one loop and 4 arrays, one for each track?
You certainly could go that route as that would be a more accurate representation of the drumgrid example I am modeling from. Someone actually did a version of this using strings of emojis for each drum track. Check it out here: gistlog.co/manualbashing/f7b91ecb9ad2169edd7844d7c7f0c07c
These videos were originally made for my middle school students só I wanted to keep things somewhat simple for them. Also when I teach about making drumbeats, I have them not do the kick and the snare at the same time so that seemed to be more easily represented in a single array. Same with an open and closed hihat sound
in computer science that is called a better desing
@@mateovelasquez8983 In spelling that is called design.