<<Back/Retour

Malfunction LiveCoding

Le 6 décembre 2021
623 visiteurs

W.I.P. n°1 - Malfunction

LiveCoding (SonicPi) autour du Glitch, en association avec des projections vidéos.

Malfunction
Jean Cartier/W.I.P. (2018)
glitch = "/Users/ucb15113/Desktop/glitch/"


live_loop :beat do
  sleep 2
end

live_loop :intro do
  #stop
  with_fx :distortion, distort: 0.9 do
    sample :ambi_dark_woosh, rate: 0.1, amp: 5
  end
  sleep 16
end

live_loop :bazar, sync: :beat do
  stop
  sample glitch, rrand_i(0,999), amp: 2
  sleep 0.125
end

live_loop :rythme, sync: :beat do
  #stop
  whichsample = 1
  whichsample = rrand_i(0,99)
  sample glitch, "tone", whichsample, amp: 1.5 if (spread 3, 8).tick
  sample glitch, "click", whichsample, amp: 0.8 if (spread 7, 11).look
  sample glitch, "low", whichsample, amp: 2 if (spread 1, 4).look
  sleep 0.125
end

live_loop :glitch1, sync: :beat do
  stop
  whichsample = rrand_i(0,99)
  with_fx :distortion do
    32.times do
      sample glitch, "voice", whichsample, pan: rrand(-1,1), amp: 1 if (spread 3, 8).tick
      sleep 0.02
    end
  end
  sleep 4
end

W.I.P. n:2 - Spheres with Norman

LiveCoding (SonicPi) sur la video Sphères de Norman MacLaren, en collaboration avec AurélienR

#AURELIEN

live_loop :b do
  sleep 2
end

live_loop :wtf, sync: :b do
  stop
  print "A"
  with_fx :slicer do
    
    with_fx :ring_mod do
      with_fx :flanger, phase: 4 do
        use_synth :dsaw
        sa = play 50, amp: 0.1, attack: 16, note_slide: 16, pan: rrand(-1,0)
        use_synth :dtri
        si = play 50, amp: 0.1, attack: 16, note_slide: 16, pan: rrand(0,1)
        control sa, note: 30
        control si, note: 30
      end
      sleep 16
    end
  end
end

live_loop :beat, sync: :b do
  stop
  play 30, amp: 2
  sleep 4
end

live_loop :nappe, sync: :b do
  #stop
  with_synth :sine do
    play_pattern_timed [chord(:e3, :minor),
                        chord(:d3, :minor),
                        chord(:e3, :minor),
    chord(:a3, :minor)],
      [4,4,4,4] , attack: 0.25, release: 5
    
  end
end

live_loop :sample, sync: :b do
  stop
  mysample = sample :ambi_lunar_land, rate: 0.1, amp: 0.1, amp_slide: 4
  control mysample, amp: 1
  sleep 32
end

live_loop :glitch, sync: :b do
  #stop
  with_fx :gverb, room: 25, mix: 0.6 do
    with_fx :bpf,centre: rrand(60,150) do
      debut = rrand(0,0.9)
      fin = debut + 0.05
      sample :drum_heavy_kick, start: debut, stop: fin, rate: rrand(-1,2),pan: [-1,0,1].choose if spread(5,8).tick
      sample :drum_cymbal_pedal, start: debut, stop: fin, rate: rrand(-2,2), pan: [-1,0,1].choose if spread(5,8).tick
    end
  end
  sleep 0.5
end
Spheres with Norman

Beats, beats, beats

Collaboration avec Tyfaine

#TIFAINE

use_bpm 90


live_loop :basebeat do
  sleep 2
end

set :kill1,false
set :kill2,false
set :kill2, true
with_fx :level,amp: 0 do |v|
  at 0 do
    control v,amp: 2,amp_slide: 5
  end
  at 90 do
    control v,amp: 0,amp_slide: 10
    sleep 10
    set :kill1,true
  end
  with_fx :gverb,room: 25, mix: 0.6 do
    live_loop :glitch, sync: :basebeat do
      use_random_seed rrand(-555555,555555)
      stop if get(:kill1)
      with_fx :bpf,centre: rrand(60,150) do
        sample [:drum_heavy_kick].choose,onset: rrand_i(0,9),rate: rrand(-2,2),pan: [-1,0,1].choose if spread(5,8).tick
        sample :drum_cymbal_pedal,onset: rrand_i(0,13),rate: rrand(-2,2),pan: [-1,0,1].choose if !spread(5,8).look
        sleep [0.25,0.5,1,2,4].choose
      end
    end
  end
end

# Environ 16 temps------------------------------------------------------
stop


with_fx :reverb do
  
  live_loop :beat1, sync: :basebeat do
    stop if get(:kill2)
    sample [:bd_haus, :bass_hit_c].choose, rate: rrand(0.88,0.98), cutoff: rrand(90, 120), amp: rrand(0.5,2.1)
    sleep [0.25,0.5,0.5,1,2].choose
    
  end
  
  sleep 8
  
  live_loop :beat2, sync: :basebeat do
    stop if get(:kill2)
    sample [:bd_gas, :bd_haus, :bd_tek, :bass_hit_c].choose, rate: rrand(0.58,0.68), cutoff: rrand(90, 120), amp: rrand(0.5,1.1)
    sleep [0.25,0.5,1,2].choose
    
  end
  
  sleep 8
  
  
  
  live_loop :beat3, sync: :basebeat do
    stop if get(:kill2)
    16.times do
      with_fx :bitcrusher do
        sample [:bd_haus, :bass_hit_c].choose, rate: rrand(0.68,0.98), cutoff: rrand(90, 120), amp: rrand(0.5,2.1)
        sleep [0.5,0.5,0.25, 0.75, 1].choose
      end
    end
    sleep 16
  end
  
end

# Environ 16 temps------------------------------------------------------
#stop

with_fx :gverb do
  live_loop :compus, sync: :basebeat do
    stop if get(:kill2)
    use_random_seed rrand(-5555,5555)
    
    s = 8
    sample :loop_compus, beat_stretch: s, amp: rrand(0.3,0.8)
    sleep s+s
  end
end


# ATTENTION ------------------------------------------------------
sleep 4
#stop


with_fx :flanger do
  live_loop :compus2, sync: :basebeat do
    use_random_seed rrand(-555555,555555)
    
    s = 8
    sample :loop_compus, beat_stretch: s, amp: rrand(0.6,2.8)
    sleep s+s+s
  end
end

# ATTENTION------------------------------------------------------
sleep 8
stop


live_loop :drums, sync: :basebeat do
  stop if get(:kill2)
  
  sample [:bd_haus, :sn_dolf, :drum_tom_hi_soft].ring.tick
  a = 8
  a.times do
    sample :drum_tom_hi_soft, release: rrand(-0.5,0.5)
    sample :drum_bass_soft, release: rrand(-0.3,0.9)
    sleep [0.25,0.5,0.25,1,2].choose
  end
  sleep 4
end

# Environ 16 temps------------------------------------------------------
stop

in_thread do
  use_synth :pnoise
  sleep [0.25,1,0.5,2,4].choose
  live_loop :loop1, sync: :basebeat do
    stop if get(:kill2)
    8.times do
      sample [:bd_haus, :bass_hit_c].choose, amp: rrand(1.5,3)
      
      sample [:bd_haus, :bass_hit_c].choose, rate: rrand(0.88,0.98), cutoff: rrand(90, 120), amp: rrand(0.5,2.1)
      sample :drum_tom_hi_hard, release: rrand(-0.5,0.5), amp: rrand(0.5,1.5)
      sleep [0.25,1,0.5].choose
      play :e2, release: rrand(0.001,0.5), rate: rrand(-0.5,0.5)
      sample :perc_snap2, rate: 1.5, amp: rrand(0.5,3)
      sample [:bd_gas, :bd_haus, :bd_tek, :bass_hit_c].choose, release: rrand(-0.5, 0.5)
      sleep [0.25,1,0.5].choose
    end
    sleep [0.25,1,0.5,2,4].choose
  end
end

sleep 4


live_loop :hihat1, sync: :basebeat do
  stop if get(:kill2)
  sample :drum_cymbal_pedal, amp: rrand(0.2,2.6), release: rrand(0.25,1.8)
  sleep [0.25,1,0.5,2,4].choose
end

sleep 8

live_loop :hihat2, sync: :basebeat do
  stop if get(:kill2)
  sample :drum_cymbal_soft, amp: rrand(0.2,2.6), release: rrand(0.25,1.8)
  sleep [0.25,1,0.5,2,4].choose
end

sleep 4

live_loop :hihat3, sync: :basebeat do
  stop if get(:kill2)
  sample :drum_tom_hi_soft, amp: rrand(0.2,2.6), release: rrand(0.25,1.8)
  sleep [1,0.5,2,4].choose
end

sleep 4


with_fx :distortion do
  
  live_loop :monte, sync: :basebeat do
    stop if get(:kill2)
    sleep 13
    with_synth [:prophet,:tech_saws, :dark_ambience, :blade].choose do
      with_fx :ixi_techno, phase_offset: 0.5, phase: 50 do
        play :b3, amp: rrand(0.2,1.2), attack: 21, release: 13, pan: -0.89
        play :fs4, amp: rrand(0.4,1.4), attack: 21, release: 13, pan: 0.89
      end
      sleep 16
    end
  end
  
  
  
  # Environ 32 temps------------------------------------------------------
  #stop
  
  
  set :kill2,false
  with_fx :level,amp: 0 do |v|
    at 0 do #fade in volume
      control v,amp: 2,amp_slide: 5
      print "STOP"
      print "STOP"
      print "STOP"
      print "STOP"
      print "STOP"
      print "STOP"
    end
    at 60 do #initiate closedown
      control v,amp: 0,amp_slide: 10
      sleep 10
      set :kill2,true
    end
    with_fx :reverb,room: 0.25, mix: 0.6 do
      live_loop :glitch2 , sync: :basebeat do
        stop if get(:kill2)
        use_random_seed rrand(-555,555)
        with_fx :bpf,centre: rrand(60,150) do
          sample :drum_heavy_kick,onset: rrand_i(0,9),rate: rrand(-2,2),pan: [-1,0,1].choose if spread(5,8).tick
          sample :drum_cymbal_pedal,onset: rrand_i(0,13),rate: rrand(-2,2),pan: [-1,0,1].choose if !spread(5,8).look
          sleep [0.25,1,0.5,2,4].choose
        end
      end
    end
  end
  
end

Quelques fonctions

#TIFAINE

use_bpm 90


live_loop :basebeat do
  sleep 2
end

set :kill1,false
set :kill2,false
set :kill2, true
with_fx :level,amp: 0 do |v|
  at 0 do
    control v,amp: 2,amp_slide: 5
  end
  at 90 do
    control v,amp: 0,amp_slide: 10
    sleep 10
    set :kill1,true
  end
  with_fx :gverb,room: 25, mix: 0.6 do
    live_loop :glitch, sync: :basebeat do
      use_random_seed rrand(-555555,555555)
      stop if get(:kill1)
      with_fx :bpf,centre: rrand(60,150) do
        sample [:drum_heavy_kick].choose,onset: rrand_i(0,9),rate: rrand(-2,2),pan: [-1,0,1].choose if spread(5,8).tick
        sample :drum_cymbal_pedal,onset: rrand_i(0,13),rate: rrand(-2,2),pan: [-1,0,1].choose if !spread(5,8).look
        sleep [0.25,0.5,1,2,4].choose
      end
    end
  end
end

# Environ 16 temps------------------------------------------------------
stop


with_fx :reverb do
  
  live_loop :beat1, sync: :basebeat do
    stop if get(:kill2)
    sample [:bd_haus, :bass_hit_c].choose, rate: rrand(0.88,0.98), cutoff: rrand(90, 120), amp: rrand(0.5,2.1)
    sleep [0.25,0.5,0.5,1,2].choose
    
  end
  
  sleep 8
  
  live_loop :beat2, sync: :basebeat do
    stop if get(:kill2)
    sample [:bd_gas, :bd_haus, :bd_tek, :bass_hit_c].choose, rate: rrand(0.58,0.68), cutoff: rrand(90, 120), amp: rrand(0.5,1.1)
    sleep [0.25,0.5,1,2].choose
    
  end
  
  sleep 8
  
  
  
  live_loop :beat3, sync: :basebeat do
    stop if get(:kill2)
    16.times do
      with_fx :bitcrusher do
        sample [:bd_haus, :bass_hit_c].choose, rate: rrand(0.68,0.98), cutoff: rrand(90, 120), amp: rrand(0.5,2.1)
        sleep [0.5,0.5,0.25, 0.75, 1].choose
      end
    end
    sleep 16
  end
  
end

# Environ 16 temps------------------------------------------------------
#stop

with_fx :gverb do
  live_loop :compus, sync: :basebeat do
    stop if get(:kill2)
    use_random_seed rrand(-5555,5555)
    
    s = 8
    sample :loop_compus, beat_stretch: s, amp: rrand(0.3,0.8)
    sleep s+s
  end
end


# ATTENTION ------------------------------------------------------
sleep 4
#stop


with_fx :flanger do
  live_loop :compus2, sync: :basebeat do
    use_random_seed rrand(-555555,555555)
    
    s = 8
    sample :loop_compus, beat_stretch: s, amp: rrand(0.6,2.8)
    sleep s+s+s
  end
end

# ATTENTION------------------------------------------------------
sleep 8
stop


live_loop :drums, sync: :basebeat do
  stop if get(:kill2)
  
  sample [:bd_haus, :sn_dolf, :drum_tom_hi_soft].ring.tick
  a = 8
  a.times do
    sample :drum_tom_hi_soft, release: rrand(-0.5,0.5)
    sample :drum_bass_soft, release: rrand(-0.3,0.9)
    sleep [0.25,0.5,0.25,1,2].choose
  end
  sleep 4
end

# Environ 16 temps------------------------------------------------------
stop

in_thread do
  use_synth :pnoise
  sleep [0.25,1,0.5,2,4].choose
  live_loop :loop1, sync: :basebeat do
    stop if get(:kill2)
    8.times do
      sample [:bd_haus, :bass_hit_c].choose, amp: rrand(1.5,3)
      
      sample [:bd_haus, :bass_hit_c].choose, rate: rrand(0.88,0.98), cutoff: rrand(90, 120), amp: rrand(0.5,2.1)
      sample :drum_tom_hi_hard, release: rrand(-0.5,0.5), amp: rrand(0.5,1.5)
      sleep [0.25,1,0.5].choose
      play :e2, release: rrand(0.001,0.5), rate: rrand(-0.5,0.5)
      sample :perc_snap2, rate: 1.5, amp: rrand(0.5,3)
      sample [:bd_gas, :bd_haus, :bd_tek, :bass_hit_c].choose, release: rrand(-0.5, 0.5)
      sleep [0.25,1,0.5].choose
    end
    sleep [0.25,1,0.5,2,4].choose
  end
end

sleep 4


live_loop :hihat1, sync: :basebeat do
  stop if get(:kill2)
  sample :drum_cymbal_pedal, amp: rrand(0.2,2.6), release: rrand(0.25,1.8)
  sleep [0.25,1,0.5,2,4].choose
end

sleep 8

live_loop :hihat2, sync: :basebeat do
  stop if get(:kill2)
  sample :drum_cymbal_soft, amp: rrand(0.2,2.6), release: rrand(0.25,1.8)
  sleep [0.25,1,0.5,2,4].choose
end

sleep 4

live_loop :hihat3, sync: :basebeat do
  stop if get(:kill2)
  sample :drum_tom_hi_soft, amp: rrand(0.2,2.6), release: rrand(0.25,1.8)
  sleep [1,0.5,2,4].choose
end

sleep 4


with_fx :distortion do
  
  live_loop :monte, sync: :basebeat do
    stop if get(:kill2)
    sleep 13
    with_synth [:prophet,:tech_saws, :dark_ambience, :blade].choose do
      with_fx :ixi_techno, phase_offset: 0.5, phase: 50 do
        play :b3, amp: rrand(0.2,1.2), attack: 21, release: 13, pan: -0.89
        play :fs4, amp: rrand(0.4,1.4), attack: 21, release: 13, pan: 0.89
      end
      sleep 16
    end
  end
  
  
  
  # Environ 32 temps------------------------------------------------------
  #stop
  
  
  set :kill2,false
  with_fx :level,amp: 0 do |v|
    at 0 do #fade in volume
      control v,amp: 2,amp_slide: 5
      print "STOP"
      print "STOP"
      print "STOP"
      print "STOP"
      print "STOP"
      print "STOP"
    end
    at 60 do #initiate closedown
      control v,amp: 0,amp_slide: 10
      sleep 10
      set :kill2,true
    end
    with_fx :reverb,room: 0.25, mix: 0.6 do
      live_loop :glitch2 , sync: :basebeat do
        stop if get(:kill2)
        use_random_seed rrand(-555,555)
        with_fx :bpf,centre: rrand(60,150) do
          sample :drum_heavy_kick,onset: rrand_i(0,9),rate: rrand(-2,2),pan: [-1,0,1].choose if spread(5,8).tick
          sample :drum_cymbal_pedal,onset: rrand_i(0,13),rate: rrand(-2,2),pan: [-1,0,1].choose if !spread(5,8).look
          sleep [0.25,1,0.5,2,4].choose
        end
      end
    end
  end
  
end
<<Back/Retour