# 220907 0156 late night coding sketch YT

**URL:** <https://in-thread.sonic-pi.net/t/220907-0156-late-night-coding-sketch-yt/7083>\
**Category:** Performances, Streams & Live Coding\
**Created:** [September 6, 2022, 11:58pm UTC](https://in-thread.sonic-pi.net/t/220907-0156-late-night-coding-sketch-yt/7083 "2022-09-06T23:58:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Relaxnow](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/relaxnow/32/2172_2.png) [@Relaxnow](https://in-thread.sonic-pi.net/u/Relaxnow)\
**Post date:** [September 6, 2022, 11:58pm UTC](https://in-thread.sonic-pi.net/t/220907-0156-late-night-coding-sketch-yt/7083/1 "2022-09-06T23:58:14Z")

</div>

220907 0156 late night coding sketch YT

[![](https://img.youtube.com/vi/E_hrTn9FLaY/maxresdefault.jpg "Sonic Pi late night sketch with visuals from youtube") ](https://www.youtube.com/watch?v=E_hrTn9FLaY)

```ruby
# 220907 0156 late night coding sketch YT
/ Just a sketch, didnt clean up code. Was exploring live_audio and this developed /

# My perfomance https://youtu.be/E_hrTn9FLaY

# Inspiration
# "Angel" by Massive attack https://www.youtube.com/watch?v=HLrqNhgdiC0
# "Portishead - Over (Stereo)" https://youtu.be/ZNWm1sN-Tms

# Visuals from
# "Derby Motoreta’s Burrito Kachimba - Gitana" outro part at https://youtu.be/gxBQGWEBXCA?t=297

use_bpm 80

live_loop :time, delay: 0.01 do
  sleep 1
end

with_fx :level, amp: 4 do
  
  
  # using voise for generating noise
  #with_fx :distortion, distort: 0.5 do
  with_fx :distortion, distort: 0.4 do
    # # 0.8 for noise on voice air sounds
    # # blowing into mic
    
    # # 0.5 for singing bass
    
    
    with_fx :reverb, room: 0.6 do
      
      #with_fx :octaver, super_amp: 2 do
      # live_audio :foo, input: 2
      
      live_loop :samplesa, sync: :time do # needs work on end pause
        #stop
        32.times do
          use_synth :piano
          a=12
          b= 8
          c= 4
          notes = knit(:gs5,a, :as5,c ,:fs5,b ,:ds5,b, nil, a+c).tick(:n)
          #play notes, release: 0.125, amp: ring(1,0.4).choose #if spread(7,16).tick(:sam)
          play notes, release: rrand(0.025, 0.15), amp: ring(1,0.4).choose #if spread(7,16).tick(:sam)
          sleep 0.25
        end
        sleep 0.25*32
      end
      
      
      live_loop :samplesb, sync: :time do
        # stop
        
        use_synth :pluck #:piano
        
        puts a=rrand_i(1,8)
        16.times do
          use_random_seed 1+a
          play scale(:gs4, :minor_pentatonic).shuffle.take(3).tick, release: 0.25 #if spread(7,16).tick(:sam)
          sleep 0.25
        end
        sleep 0.25*16
        16.times do
          use_random_seed 10+a
          play scale(:gs3, :minor_pentatonic).shuffle.take(3).tick, release: 0.125 #if spread(7,16).tick(:sam)
          sleep 0.25
        end
        sleep 0.25*16
      end
      
      
      
      #end
    end
    
  end
  #end
  
  with_fx :distortion, distort: 0.5 do
    with_fx :reverb, room: 0.7 do
      #with_fx :bitcrusher, bits: 0.8 do
      with_fx :echo do
        
        #with_fx :octaver, super_amp: 2 do
        #live_audio :foo, input: 2
        #end
        
        live_loop :synth1, sync: :time do
          #stop
          3.times do
            use_synth :piano
            play :a1, sustain: 3
            sleep 6
            play :gs1, sustain: 3
            sleep 6
          end
          sleep 6*2
        end
        
      end # echo end
      
      
    end #reverb end
    
    
    
    #with_fx :distortion, distort: 0.4 do
    live_loop :drum1, sync: :time do
      # stop
      sample :bd_klub if bools(1,0,1,0,1,1).tick#, cutoff: 130, amp: 2 #if spread(7,16).tick
      sleep 0.5
    end
    live_loop :drum2, sync: :time do
      stop
      sample :bd_haus, amp: 2, cutoff: 85
      sleep 0.5
    end
    live_loop :drum3, sync: :time do
      # stop
      a = 32
      b= 16
      c = knit(100,a, 120,b).tick(:k)
      sample :bd_haus, amp: 2, cutoff: c if spread(3,5).tick
      sleep 0.25
    end
    live_loop :hihat, sync: :time do # used with drum3
      #stop
      sample :drum_cymbal_closed, cutoff: 115, rate: rrand_i(2,4), amp: 2 if bools(1,0,1,0,1,1).tick #and one_in(2)
      sleep 0.25
    end
    
    
  end #distortion end
  
  
  
  
  
  
  
  #not used right now
  with_fx :octaver do
    with_fx :distortion, distort: 0.6 do
      live_loop :synth2, sync: :time do
        stop
        
        p = 24
        
        use_synth :piano
        play :fs2, sustain: 2, pitch: p
        sleep 2
        play :as2, sustain: 1, pitch: p
        sleep 1
        play :ds3, sustain: 3, pitch: p
        sleep 3
        
        play :ds3, sustain: 2, pitch: p
        sleep 2
        play :fs3, sustain: 1, pitch: p
        sleep 1
        play :b2, sustain: 3, pitch: p
        sleep 3
      end
    end
  end
  
end

```
