220515 Sonic Pi and Hydra practise

220515 Sonic Pi and Hydra practise

Sonic Pi code


# 220515 from scratch (with Hydra code)

use_bpm 70

live_loop :met do
  sleep 1
end

with_fx :reverb do
  
  n = 0  # -2 -4 -5 -7 -9  3 5 7 12
  live_loop :picknotesToBass do
    n=(ring -2, -4, -5, -7, -9,  3, 5, 7, 12).choose
    sleep (ring 2,4,8).choose
  end
  live_loop :mel0, sync: :met do
    notes = (ring :c2, :c2, :c2, :c2, :c4)+n
    synth :saw, note: notes.tick(:a), cutoff: rrand(70,110), release: 0.25, amp: 4 if spread(3,5).tick(:a)
    sleep 0.25
  end
  live_loop :mel1, sync: :met do
    #stop
    notes = (ring :c2, :c2, :c2, :c2, :c4)+n
    synth :saw, note: notes.tick(:a)+12, cutoff: rrand(70,110), release: 0.25, amp: 4 if spread(3,5).tick(:a)
    sleep 0.25
  end
  
  
  live_loop :mel2, sync: :met do
    notesriff = 4
    notesriff = rrand_i(1,4)
    #puts notesriff
    case notesriff
    when 1
      notes = (ring :c2, :c3, :g2, :as2, :c4)+12
    when 2
      notes = (ring :c2, :f3, :g2, :as2, :c4)+12
    when 3
      notes = (ring :c2, :ds3, :g2, :as2, :g3)+12
    when 4
      notes = (ring :c2, :c4, :g2, :as2, :c3)+12
    end
    
    synth :tri, note: notes.tick(:a)+12, cutoff: rrand(70,110), release: 0.25, amp: 2 if spread(5,7).tick(:a)
    sleep 0.25
  end
  
  
  live_loop :kick, sync: :met do
    sample :bd_haus, cutoff: 80, amp: 4
    sample :bd_haus, cutoff: 90, amp: 4
    sleep 2 # 1 2 4
  end
  
end

Hydra visuals code

1 Like