SonicPiで曲作り 2

use_bpm 45

in_thread do
  cue :start
  with_fx :reverb, room: 0.99, mix: 0.7 do
    synth :saw , note: scale(:G3, :minor_pentatonic).shuffle.take(3), attack: 1.5, release: 16, amp: 0.1
    sleep 2;
    synth :saw , note: scale(:G4, :minor_pentatonic).shuffle.take(3), attack: 1.0, release: 12, amp: 0.1
    sleep 2;
    synth :saw , note: scale(:G5, :minor_pentatonic).shuffle.take(3), attack: 0.5, release: 8, amp: 0.1
    sleep 4;
  end
end

with_fx :reverb, room: 0.99, mix: 0.7 do
  4.times do
    synth :sine , note: scale(:G3, :minor_pentatonic).shuffle.take(2), attack: 0, release: 0.1, amp: 0.2
    sleep 1;
    synth :sine , note: scale(:G4, :minor_pentatonic).shuffle.take(2), attack: 0, release: 0.1, amp: 0.2
    sleep 1
  end
end

cue :bd

live_loop :bd1 do
  sync "/cue/bd"
  sample :bd_ada, amp: 0.8
  sleep 0.5
  sleep 0.25
  sample :bd_ada, amp: 0.4
  sleep 0.25
end

live_loop :bd2 do
  sync "/cue/bd"
  sleep 3
  sample :bd_ada, amp: 0.4
  sleep 0.5
  sleep 0.25
  sample :bd_ada, amp: 0.2
end


with_fx :reverb, room: 0.99, mix: 0.7 do
  live_loop :loop2 do
    cue :bd
    synth :piano ,
      note: scale(:G, :minor_pentatonic, num_octaves: 2).shuffle.take(3),
      attack: 0, release: 0.15, amp: [1, 0.5, 0.25].choose
    sleep 4;
  end
end

with_fx :reverb, room: 0.99, mix: 0.7 do
  live_loop :melo do
    synth :piano ,
      note: scale(:G, :minor_pentatonic, num_octaves: 2).shuffle.take(3),
      attack: 0, release: 2, amp: 0.5
    sleep 1
    
    use_synth :piano;
    32.times do
      play choose(scale(:G, :minor_pentatonic, num_octaves: 2)), attack: 0, release: 0.5, amp: [0.2, 0.1, 0.05].choose
      sleep 0.125
    end
  end
end