Advertisement
teromakotero

Teromakotero_music_Sonic_pi

May 3rd, 2022
1,445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.52 KB | None | 0 0
  1. base = 16.35
  2. live_loop :bass do
  3.   play hz_to_midi(base)
  4.   sleep(2)
  5. end
  6. base_notes=[2*base,3*base,4*base]
  7. live_loop :base_music do
  8.   play hz_to_midi(base_notes[0])
  9.   sleep(0.75)
  10.   play hz_to_midi(base_notes[1])
  11.   sleep(0.75)
  12.   play hz_to_midi(base_notes[2])
  13.   sleep(0.5)
  14. end
  15. middle_base_notes=[4*base,6*base,8*base]
  16. live_loop :middle_base_music do
  17.   play hz_to_midi(middle_base_notes[0])
  18.   sleep(0.75)
  19.   play hz_to_midi(middle_base_notes[1])
  20.   sleep(0.75)
  21.   play hz_to_midi(middle_base_notes[2])
  22.   sleep(0.5)
  23. end
  24. middle_melody_notes=[8*base,9*base,10*base,11*base,12*base,13*base,14*base,15*base,16*base]
  25. notes = [16*base,17*base,18*base,19*base,20*base,21*base,22*base,23*base,24*base,25*base,26*base,27*base,28*base,29*base,30*base,31*base,32*base]
  26. length = [0.25,0.5,1,2]
  27. live_loop :middle_melody do
  28.   play hz_to_midi(middle_melody_notes[rrand(0,8)])
  29.   sleep(length[rrand(2,3)])
  30.   play hz_to_midi(middle_melody_notes[rrand(0,8)])
  31.   sleep(length[rrand(2,3)])
  32.   play hz_to_midi(middle_melody_notes[rrand(0,8)])
  33.   sleep(length[rrand(2,3)])
  34.   play hz_to_midi(middle_melody_notes[rrand(0,8)])
  35.   sleep(length[rrand(2,3)])
  36.   play hz_to_midi(middle_melody_notes[rrand(0,8)])
  37.   sleep(length[rrand(2,3)])
  38.   play hz_to_midi(middle_melody_notes[rrand(0,8)])
  39.   sleep(length[rrand(2,3)])
  40.   play hz_to_midi(middle_melody_notes[rrand(0,8)])
  41.   sleep(length[rrand(2,3)])
  42. end
  43. live_loop :melody do
  44.   play hz_to_midi(notes[rrand(0,16)])
  45.   sleep(length[rrand(0,2)])
  46.   play hz_to_midi(notes[rrand(0,16)])
  47.   sleep(length[rrand(0,2)])
  48.   play hz_to_midi(notes[rrand(0,16)])
  49.   sleep(length[rrand(0,2)])
  50.   play hz_to_midi(notes[rrand(0,16)])
  51.   sleep(length[rrand(0,2)])
  52.   play hz_to_midi(notes[rrand(0,16)])
  53.   sleep(length[rrand(0,2)])
  54.   play hz_to_midi(notes[rrand(0,16)])
  55.   sleep(length[rrand(0,2)])
  56.   play hz_to_midi(notes[rrand(0,16)])
  57.   sleep(length[rrand(0,2)])
  58.   play hz_to_midi(notes[rrand(0,16)])
  59.   sleep(length[rrand(0,2)])
  60.   play hz_to_midi(notes[rrand(0,16)])
  61.   sleep(length[rrand(0,2)])
  62.   play hz_to_midi(notes[rrand(0,16)])
  63.   sleep(length[rrand(0,2)])
  64.   play hz_to_midi(notes[rrand(0,16)])
  65.   sleep(length[rrand(0,2)])
  66.   play hz_to_midi(notes[rrand(0,16)])
  67.   sleep(length[rrand(0,2)])
  68.   play hz_to_midi(notes[rrand(0,16)])
  69.   sleep(length[rrand(0,2)])
  70.   play hz_to_midi(notes[rrand(0,16)])
  71.   sleep(length[rrand(0,2)])
  72.   play hz_to_midi(notes[rrand(0,16)])
  73.   sleep(length[rrand(0,2)])
  74.   play hz_to_midi(notes[rrand(0,16)])
  75.   sleep(length[rrand(0,2)])
  76.   play hz_to_midi(notes[rrand(0,16)])
  77.   sleep(length[rrand(0,2)])
  78. end
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement