Sonic Pi Tutorial - Using Arrays to Make Drumbeats

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии •

  • @timcornell203
    @timcornell203 3 года назад +4

    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

  • @dorianhinkle5595
    @dorianhinkle5595 2 года назад +1

    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.

  • @emilianopintos2018
    @emilianopintos2018 3 года назад

    Another newbie to Sonic Pi here, we need more of this so well explained tutorials. Congrats man you totally nail it!

  • @jakebrown1879
    @jakebrown1879 Год назад

    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

  • @sennabullet
    @sennabullet 3 года назад

    Thank you so much for this clear and thorough explanation of Arrays for Sonic Pi. You got my thumb and sub!

  • @adriand1058
    @adriand1058 4 года назад +2

    This is brilliant. Great tutorial. Thank you very much!

  • @BruceHarms
    @BruceHarms 3 года назад

    Dope, Dope, Dope! Thank you for this great tutorial, just what the doctor ordered!

  • @artvartradioofficial
    @artvartradioofficial Год назад

    love this channel

  • @SteffenF
    @SteffenF Год назад +1

    @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

  • @purplebutterflyprod
    @purplebutterflyprod 6 месяцев назад +1

    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

    • @MrBombMusic
      @MrBombMusic  6 месяцев назад +1

      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.

    • @purplebutterflyprod
      @purplebutterflyprod 6 месяцев назад

      @@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 !

    • @purplebutterflyprod
      @purplebutterflyprod 6 месяцев назад

      @@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

  • @TheBabouchkah
    @TheBabouchkah 4 года назад +1

    nice, thanks for the video :) very useful

  • @thiagoskapata
    @thiagoskapata 4 года назад +2

    Nice. People can also create a matrix, that is, an array of arrays and use only one live_loop.

    • @MrBombMusic
      @MrBombMusic  4 года назад +4

      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

  • @BruceHarms
    @BruceHarms 3 года назад

    Finally was able to code smashing pumpkins 1979 drum loop!

  • @Alejandro213sk8
    @Alejandro213sk8 2 года назад

    Thanks!!!!

  • @ClaudioSoprano
    @ClaudioSoprano 3 года назад +1

    Couldn't you just have used one loop and 4 arrays, one for each track?

    • @MrBombMusic
      @MrBombMusic  3 года назад

      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

    • @mateovelasquez8983
      @mateovelasquez8983 3 года назад

      in computer science that is called a better desing

    • @AMurderOfLobs
      @AMurderOfLobs 2 года назад +2

      @@mateovelasquez8983 In spelling that is called design.