Show your buffers in Sonic Pi part 2

240828 2155 Buffer 0 - Density density on noise (nice layering)

# 240828 2155 Buffer 0 - Density density on noise (nice layering)
# Saved 240828 2155
# https://youtu.be/jZRzOXO2vN8
# https://in-thread.sonic-pi.net/t/show-your-buffers-in-sonic-pi-part-2-buffer-1-to-5-sonicpi/9154


set_volume! 1

with_fx :reverb, room: 0.6 do
  
  define :s do |a,b|
    spread(a,b)
  end
  
  live_loop :a1 do
    tick
    sample :bd_haus, cutoff: 70, amp: 3 if  (bools(1,0,1,0,0)*2+s(1,14)+bools(1,1)).look
    sample :bd_fat, amp: 2 if s(3,7).look# and (s(5,7)*3).look
    sample :bd_fat, rpitch: 24, amp: 4 if s(3,7).rotate(2).look
    sleep 0.25
  end
  
  live_loop :a2 do
    tick
    use_synth :noise
    use_synth_defaults release: [0.01,0.03,0.02].choose
    n = :c2
    density [1,2,1,1,2].look do
      density [1,1,1,2].look do
        #sample :elec_tick, rpitch: [0,0,0,0,12].look, amp: [0,1,2].choose if (s(0,16)+s(16,16)).look
        density [1,1,2].look do
          sample :elec_tick, rpitch: [0,0,0,0,12].look+12, amp: 2 if (s(0,32)+s(16,16)).look
          play n, amp: [1,0,1,1,3].look*1, cutoff: [80,90,110,100].choose, pan: rdist(0.5) #if s(3,5).look
          sleep 0.25
        end
      end
    end
  end
  
end

with_fx :reverb, room: 0.98 do
  live_loop :a3 do
    tick
    use_synth :beep
    p = 32
    
    /bass/
    play :c2+knit(0,p, -2,p, -4,p, 0,p).look, amp: 2 if s(1,32).look
    play :c3+knit(0,p, -2,p, -4,p, 0,p).look, amp: 2 if s(1,32).look
    
    / top low mel/
    play :c4+knit(0,7,-2,7,-5,5,-12,2).look, pan: rdist(0.5) if s(5,14).look
    / top high mel /
    play :c5+knit(0,p/3, -7,p/3, -5,p/3, -2,p/3).rotate(0).look, amp: 0.25, pan: rdist(0.25) if s(3,7).look
    
    / 2.voice  /
    use_synth :prophet
    use_synth_defaults cutoff: 80
    play :c6+knit(0,7,-2,7,-5,5,-12,2).rotate(6).look, amp: 0.5 if s(5,14).look and (s(0,64)+s(32,32)).look
    
    sleep 0.25
  end
end

240828 2155 Buffer 1 - bass and clicks with long notes

# 240828 2155 Buffer 1 - bass and clicks with long notes
# Saved 240828 2155
# https://youtu.be/jZRzOXO2vN8
# https://in-thread.sonic-pi.net/t/show-your-buffers-in-sonic-pi-part-2-buffer-1-to-5-sonicpi/9154


set_volume! 1

define :s do |a,b|
  spread(a,b)
end


with_fx :reverb, room: 0.7 do
  live_loop :a1 do
    tick
    
    sample :elec_beep, rpitch: 24, finish: 0.06 if s(6,7).look
    sample :elec_beep, rpitch: 24, finish: 0.04 if s(3,5).look
    sample :elec_beep, rpitch: 0, finish: 0.03 if s(3,7).look
    sample :bd_ada, amp: 4 if (s(1,14)*3+bools(1,1,1,0,0,0,1)*2).look
    sample :bd_ada, rpitch: 12+12+12, amp: 2 if s(1,14).rotate(2).look
    
    n = :c2
    
    use_synth :saw
    use_synth_defaults cutoff: [70,80,90,110].choose
    
    r = [0.1,0.2,0.3,0.4].choose
    play n+[0,0,1,3].look, release: r, amp: 2 if (bools(1,0,1,0,1,0,1)*2).look
    play n+12+12+[0,0,1,3].look, release: r, amp: 0.75, pan: rdist(0.5) if (bools(1,0,1,[0,1].choose,1,0,0)*2).look
    sleep 0.25
  end
end

with_fx :reverb, room: 0.99 do
  
  live_loop :a2 do
    tick
    
    n = :c2
    use_synth :prophet
    use_synth_defaults cutoff: [55].look
    play n+12+0, amp: 4 if (bools(1,0,0)+s(1,28-3)).look
    
    use_synth :sine
    play :c6+knit(0,28*2, -2,28, -5,28).look if s(1,28).look and (s(1,28)+s(0,28)+s(1,28)*2).look
    play :c5+[3,7].choose+knit(0,28*2, -2,28, -5,28).look, amp: 0.5 if s(3,28).look
    
    sleep 0.25
  end
  
end

240828 2155 Buffer 2 - bpm110 spread a 7 b 16

# 240828 2155 Buffer 2 - bpm110  spread a 7 b 16
# Saved 240828 2155
# https://youtu.be/jZRzOXO2vN8
# https://in-thread.sonic-pi.net/t/show-your-buffers-in-sonic-pi-part-2-buffer-1-to-5-sonicpi/9154


use_bpm 110

set_volume! 1

define :s do |a,b|
  spread(a,b)
end

a = 7 #7
b = 16 #16

with_fx :reverb, room: 0.4 do
  live_loop :a1 do
    tick
    sample :bd_fat, amp: 4 if s(1,b).look
    sample :bd_fat, amp: 2, rpitch: 12 if s(a,b).look
    sample :elec_beep, amp: 1.5+rdist(0.25), finish: 0.05+rdist(0.03) if s(a+2,b).look
    sleep 0.25
  end
  
  with_fx :reverb, room: 0.99 do
    with_fx :krush, mix: [0,0.2,0.4,0.6,0.8].choose do
      live_loop :a2 do
        tick
        
        n1 = :c2+knit(0,64*3,-2,64).look
        n2 = :c4
        use_synth :saw
        use_synth_defaults cutoff: [70,90,110].choose, release: [0.1,0.2,0.3].choose+0.2
        
        play n1+[0,0,0,0,12].look, amp: 1.5, pan: -0.5 if s(a,b+1).look
        play n1+[0,0,0,0,12].look+0.02, amp: 1.5, pan: 0.5 if s(a,b-2).look
        
        use_synth_defaults release: [0.1,0.2,0.3].choose
        play n2 +12 if s(1,32).rotate(-3).look
        play n2 +12-2 if s(1,32).rotate(-11).look
        
        sleep 0.25
      end
    end
  end
  
end

240828 2155 Buffer 3 - ixi call respond (nice)

# 240828 2155 Buffer 3 - ixi call respond (nice)
# Saved 240828 2155
# https://youtu.be/jZRzOXO2vN8
# https://in-thread.sonic-pi.net/t/show-your-buffers-in-sonic-pi-part-2-buffer-1-to-5-sonicpi/9154


set_volume! 1.5

with_fx :reverb, room: 0.4 do
  with_fx :ixi_techno, phase: 2, res: 0.5 do
    
    
    live_loop :a1 do
      tick
      
      / bass /
      use_synth :fm
      use_synth_defaults cutoff: [60,80,110].choose, release: [0.1,0.2,0.5].choose
      n = :f2+knit(0,28,1,4).look
      play n+[0,0,0,0,12].look
      
      
      / call respond /
      use_synth :beep
      use_synth_defaults release: 0.7
      #                        how to play rythme                   when to play
      play n+12+7, amp: 0.5 if (spread(1,8)*3+spread(4,8)).look and (spread(8,8)*4+spread(0,8)*4).look
      use_synth_defaults release: 0.15
      #                           how to play rythme                   when to play
      play n+12+7+12, amp: 0.5 if (spread(5,7)*3+spread(6,8)).look and (spread(0,8)*4+spread(8,8)*4).look # 7 as base so it moves
      
      /kick/
      sample :bd_fat, amp: 4 if (spread(1,7)*3+spread(5,7)).look
      sample :elec_tick, rpitch: 12, amp: 0.7 if spread(3,5).look and one_in(2)
      
      sleep 0.25
    end
    
  end
  
  
  live_loop :a2 do
    tick
    / top melody /
    use_synth :prophet
    use_synth_defaults cutoff: rrand_i(70,130), release: [0.1,0.2,0.5].choose
    play scale(:f5, :minor_pentatonic).choose, amp: 0.5 if spread(5,7).rotate(1).look
    / short cowbell like /
    sample :sn_dolf, rpitch: 12+12, finish: 0.1, amp: 3 if spread(1,8).rotate([4].choose).look and (spread(1,16)+spread(7,16)).look
    sleep 0.25
  end
  
end

/ background percussion /
with_fx :gverb, mix: 0.8 do |gverb|
  live_loop :a3 do
    tick
    
    control gverb, mix: [0,0.2,0.4,0.6,0.8].choose, room: [1,10,100,300].choose
    
    finish = [1,1,1,1,2,3].choose # Choosing which CASE preset with multiple parameters to play play from
    
    density [1,1,1,1,2,2,4].look do
      
      lvl= 0.2 # needs restart of code to take effect inside gverb if manually changed
      case finish
      when 1
        f = 0.01; amp = 0.6
      when 2
        f = 0.03; amp = 0.4
      when 3
        f = 0.25; amp = 0.2
      end
      
      s = knit(1,12, 3,4).look
      sample :sn_generic, finish: f, amp: amp+lvl, pan: rdist(0.7) if spread(s,8).rotate(2).look
      
      sleep 0.25
    end
    
  end
end

240828 2155 Buffer 4 - Inspiration from - up a notch by a773

# 240828 2155 Buffer 4 - Inspiration from - up a notch by a773
# Saved 240828 2155
# https://youtu.be/jZRzOXO2vN8
# https://in-thread.sonic-pi.net/t/show-your-buffers-in-sonic-pi-part-2-buffer-1-to-5-sonicpi/9154


# Inspiration
# a773 - up a notch https://www.youtube.com/watch?v=i2DR767OQNI
# bass part https://youtu.be/i2DR767OQNI?feature=shared&t=485

set_volume! 1.5


define :s do |a,b|
  spread(a,b)
end

use_bpm 105

with_fx :reverb, room: 0.4 do
  
  live_loop :a1 do
    tick
    use_synth :saw
    use_synth_defaults release: [0.1,0.2,0.3].choose+0.1, cutoff: 80
    
    n = :a2+knit(0,7*4, 3,7*2, -2,7*2, -5,7).look
    #n = :a2
    
    #   sample :sn_dolf, rpitch: 12, finish: 0.03, amp: 2 if (s(3,5)+s(1,2).rotate(1)).look
    sample :bd_fat, amp: 4 if s(1,4).look
    play n + knit(0,7, 2,7, 3,7, 0,7).look if bools(1,0,1,0,1,0,0).look
    play n+12 + knit(0,7, 2,7, 3,7, 0,7).look if (s(3,5)+s(1,2).rotate(1)).look
    sleep 0.25
  end
  
  
  with_fx :flanger, mix: 0.4, phase: 64 do
    
    live_loop :a2 do
      tick
      spil = [1,2,3,4,5,6].choose
      #spil = [1,5,6].choose
      spil = [1,1,1,1,2,2,2,2,3,3,3,4,5,6,].choose
      
      density [1,1,1,1,1,1,2,3].choose do
        
        sample :sn_dolf, rpitch: 0, finish: [0.01,0.02,0.03,0.04].choose, amp: 2 if (s(3,5)+s(1,2).rotate(1)).look and spil == 1
        sample :sn_dolf, rpitch: 12, finish: [0.01,0.02,0.03,0.04].choose, amp: 2 if (s(3,5)+s(1,2).rotate(1)).look and spil == 2
        sample :sn_dolf, rpitch: 12+12, finish: [0.01,0.02,0.03,0.04].choose, amp: 2 if (s(3,5)+s(1,2).rotate(1)).look and spil == 3
        
        sample :sn_generic, rpitch: 0, finish: [0.01,0.02,0.03,0.04].choose, amp: 2 if (s(3,5)+s(1,2).rotate(1)).look and spil == 4
        sample :sn_generic, rpitch: 12, finish: [0.01,0.02,0.03,0.04].choose, amp: 2 if (s(3,5)+s(1,2).rotate(1)).look and spil == 5
        sample :sn_generic, rpitch: 12+12, finish: [0.01,0.02,0.03,0.04].choose, amp: 2 if (s(3,5)+s(1,2).rotate(1)).look and spil == 6
        sleep 0.25
      end
    end
    
  end
  #end
  
end

/
with_fx :reverb, room: 0.99 do

  live_loop :a1 do
    tick
    n = scale(:c4, :mixolydian).choose
    play :c2, amp: 2 if s(2,5).look
    play n, amp: 0.3 if s(4,5).look

    sleep 0.25
  end

end
/

240828 2155 Buffer 5 - scale and elec_ping

# 240828 2155 Buffer 5 - scale and elec_ping
# Saved 240828 2155
# https://youtu.be/jZRzOXO2vN8
# https://in-thread.sonic-pi.net/t/show-your-buffers-in-sonic-pi-part-2-buffer-1-to-5-sonicpi/9154


set_volume! 1

define :s do |a,b|
  spread(a,b)
end

with_fx :reverb, room: 0.75 do# |reverb|
  
  live_loop :a1 do
    tick
    
    #control reverb, mix: [0,0.2,0.4,0.6].look, room: [0,0,0.6].look
    
    use_synth :sine
    use_synth_defaults release: [0.2,0.3].choose
    play scale(:c2, :melodic_minor).take(1).look, amp: 3 if s(1,7).rotate(1).look
    play scale(:c2, :melodic_minor).take(1).look, amp: 3 if s(1,7).rotate(2).look
    play scale(:c4, :melodic_minor).take(1).look, amp: 1 if s(1,7).rotate(3).look
    
    sample :bd_fat, amp: 4 if s(2,7).look
    sample :elec_bong, amp: 1.25, rpitch: [0,0,0,0,0,12].look if s(3,7).look
    
    density [1,2,1,1,2].look do
      density [1,1,2].look do
        sample :elec_ping, amp: line(0.25,0.75, steps: 16).look, pan: rdist(0.5) if s(6,7).look and (s(0,16)+s(16,16)).look
        use_synth_defaults release: [0.1,0.2,0.3].choose
        play scale(:c4, :melodic_minor).choose, amp: 1.4 if s(6,7).look and (s(0,32)+s(32,32)+s(0,32)).look
        sleep 0.25
      end
    end
    
  end
  
  with_fx :ping_pong do /not done/
    live_loop :a2 do
      tick
      use_synth :pluck
      #play :c7, amp: 4 if s(3,12).rotate(3).look
      sleep 0.25
    end
  end
end
1 Like

Love these different textures - how do you keep track of all those spread variations?? :exploding_head: Or do you just let them evolve generatively?

PD-Pi

1 Like

I really like to explore spread. “Evolve” I guess.

Yeh, I just went and watched a few more of your live coding videos, and I have a much clearer picture. Another trick for me to assimilate :wink:

1 Like