Joy Division - "Transmission" (full song)

This was fun to make. I think the code is inefficient to some degree (my PC handles it fine, but the laptop struggles with keeping it in time). Hope you enjoy it!

use_bpm 150

##| 2. Drum break

bass1 = ring(62,62,57,60,60,57)
bass2 = ring(62,62,57,60,60,64,65,64,65,67)
tb1 = [2,13,1,2,13,1]
tb2 = [2,13,1,2,6,1,1,1,1,4]
tbp1 = [2,1,1,2,1]
tbp2 = [2,1,1,2,1,1,1,1,1,4]

git1 = ring(57,59,59,59,57,59,59,59,57,59,59,59,57,59,59,59)
git1b = ring(69,71,71,71,69,71,71,71,57,59,59,59,57,59,59,59)
git2 = ring(59,60,62,64,62,64,62,64,64,62,59,60,62,64,62,64,62,64,64,62)
git3 = ring(66,64,66,64,66,64,64,62,62,59,62,59,62,64)
git4 = ring(62,59,62,59,62,59,62,62,64,64,62,59,62,59,62,59,62,59,62,62,64,64,62,59)
tg1 = [2,1,3,2,2,1,3,2,2,1,3,2,2,1,3,2]
tg2 = [1,1,2,2,1,2,1,2,2,2,1,1,2,2,1,2,1,2,2,2]
tg3 = [4,4,2,2,2,2,4,4,2,1,2,1,1,1]
tg4 = [2,1,2,1,1,1,2,1,1,2,1,1,2,1,2,1,1,1,2,1,1,2,1,1]

vox1 = ring(62,64,66,66,64,64,64,60)
vox2 = knit(nil,1,62,9,60,1,64,9,66,1)
vox3 = knit(nil,1,62,9,60,1,64,11,66,1)
vox4 = knit(nil,1,69,9,67,1,64,9,62,1,66,1)
vox5 = ring(nil,62,62,62,64)
chvox1 = ring(62,62,62,62,62,62,60,62,60,60)
chvox2 = ring(65,65,65,65,62,62,60,62,60,60)
tv1 = [1,1,10,2,2,3,1,12]
tv2 = [4,1,1,1,1,2,2,1,1,1,4,2,1,1,1,3,2,1,1,1,0]
tv3 = [4,1,1,1,1,2,2,1,1,1,4,1,1,1,1,1,2,2,1,1,1,1,0]
tv4 = [4,1,1,1,2,3,1,1,1,2,3,1,1,1,1,2,2,1,1,1,1,0]
tv5 = [13,1,1,1,16]
tchv1 = [3,3,3,3,2,1,1,1,1,14]

puts vox4.length
puts tv4.length
puts tv4.sum

live_loop :sett do
  set :ss, ring(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15).tick
  ##| set :ss, 0
  s = get[:ss]
  set :x, [1,1,1,0,1,1,0,0,1,1,0,0,0,0,0,0][s]
  set :a, [0,0,0,0,0,0,1,2,3,3,3,1,4,5,3,3][s]
  set :b, [0,4,1,0,0,4,2,2,2,3,3,3,3,3,3,3][s]
  set :c, knit(0,9,12,7)[s]
  ##| sleep knit(16,2,32,2,16,2,32,9)[s]
  sleep [16,16,32,32,16,16,16,16,32,32,32,16,16,16,32,32][s]
end

sleep 1
v = 1

live_loop :vox do
  vox = [vox1,vox2,vox3,chvox1,vox4,vox5][get[:a]]
  tv = [tv1,tv2,tv3,tchv1,tv4,tv5][get[:a]]
  tick_reset
  tv.length.times do
    with_fx :echo, phase: 0.75, decay: 6, mix: 0.8 do
      tick
      synth :dsaw, note: vox.look+get[:c], env_curve: 3, amp: 2*(1-get[:x])
      ##| synth :dsaw, note: vox.look+4, env_curve: 3, amp: 2*(1-get[:x])
      sleep tv.ring.look*0.5
    end
  end
end

live_loop :vx2 do
  vox = [vox1,vox2,vox3,chvox1,vox4,vox5][get[:a]]
  tv = [tv1,tv2,tv3,tchv1,tv4,tv5][get[:a]]
  tick_reset
  if get[:ss]>=11
    with_fx :gverb, room: 69, release: 1.5, mix: 1 do
      tick
      sleep tv.ring.look*0.5
      gg = synth :prophet, note: vox[1], note_slide: 1, sustain: (tv.sum*0.5), release: 10, amp: 0.8*(1-get[:x])
      ((tv.length)-1).times do
        tick
        control gg, note: vox.look+0
        sleep tv.ring.look*0.5
      end
    end
  else
    sleep 16
  end
end

live_loop :guitaristan do
  git = [git1,git2,git3,git4,git1b][get[:b]]
  tg = [tg1,tg2,tg3,tg4,tg1][get[:b]]
  tick_reset
  tg.length.times do
    with_fx :distortion, distort: 0.99, mix: 0.9, amp: 0.7 do
      with_fx :gverb, room: 69, release: 2, mix: 0.1 do
        tick
        synth :dsaw, note: git.look+0, env_curve: 3, amp: get[:x]
        sleep tg.ring.look*0.5
      end
    end
  end
end

live_loop :bass do
  tick(:i)
  bass = [bass1,bass1,bass1,bass2].ring.look(:i)
  tb = [tb1,tb1,tb1,tb2].ring.look(:i)
  tbp = [tbp1,tbp1,tbp1,tbp2].ring.look(:i)
  tick_reset(:ii)
  tb.length.times do
    tick(:ii)
    ss = tb.ring.look(:ii)
    with_fx :slicer, phase: tbp.ring.look(:ii)*0.5, wave: 0, mix: 1, amp: 3 do
      synth :fm, note: bass.look(:ii)-24, decay: ss*0.5, release: 0, depth: 3
      synth :dsaw, note: bass.look(:ii)-36, decay: ss*0.5, release: 0, cutoff: 65
      synth :dsaw, note: bass.look(:ii)-24, decay: ss*0.5, release: 0, cutoff: 65
      sleep ss*0.5
    end
  end
end


live_loop :riff do
  tick_reset(:ii)
  with_fx :distortion, distort: 0.8, mix: 1 do
    with_fx :gverb, room: 69, release: 4, mix: 0.3, amp: 1.2 do
      with_fx :lpf, cutoff: 80, cutoff_slide: 32, mix: 1 do |w|
        control w, cutoff: 130
        with_fx :slicer, phase: 16, wave: 0, invert_wave: 1, mix: 0.4 do
          tb1.length.times do
            tick(:ii)
            ss = tb1.ring.look(:ii)
            with_fx :slicer, phase: tbp1.ring.look(:ii)*0.5, wave: 0, mix: 1 do
              if get[:ss]>=6
                synth :dsaw, note: chord(bass1.look(:ii)-12,'5'), decay: ss*0.5, release: 0, depth: 3
              else
                sleep 0
              end
              sleep ss*0.5
            end
          end
        end
      end
    end
  end
end

live_loop :riff2 do
  tick_reset(:ii)
  with_fx :distortion, distort: 0.85, mix: 1, amp: 0.8 do
    with_fx :slicer, wave: 2, phase: 1, mix: 0.7 do
      with_fx :gverb, room: 69, release: 4, mix: 0.3, amp: 1 do
        2.times do
          tick(:ii)
          if get[:ss]>=11
            synth :dsaw, note: chord(ring(62,60).look(:ii)-12,'5'), release: 12, detune: 0.3, cutoff: 85
          else
            sleep 0
          end
          sleep 8
        end
      end
    end
  end
end

with_fx :compressor, amp: 1.4, mix: 1 do
  ##| comment do
  ##| with_fx :gverb, room: 69, release: 5, mix: 0.2, amp: v do
  ##|   sleep 28
  ##|   2.times do
  ##|     sample :drum_snare_hard, rate: 0.77
  ##|     sleep 0.5
  ##|     2.times do
  ##|       sample :drum_snare_soft
  ##|       sleep 0.5
  ##|     end
  ##|   end
  ##|   sample :drum_snare_hard, rate: 0.77
  ##|   sleep 1
  ##| end
  ##| end
  
  ##| with_fx :compressor, amp: 1.4, mix: 1 do
  live_loop :kick do
    with_fx :gverb, room: 69, release: 5, mix: 0.2, amp: v do
      tick
      sample :bd_haus, cutoff: 100, amp: 2.2
      sleep ring(2,0.5,1.5,2,1,1).look
    end
  end
  
  live_loop :snare do
    with_fx :gverb, room: 69, release: 5, mix: 0.2, amp: v do
      sleep 1
      5.times do
        tick
        sample :drum_snare_hard
        sample :drum_snare_hard, rate: 0.65
        sample :drum_snare_hard, cutoff: 100, rate: 0.8
        sleep ring(2,2,1.5,1,0.5).look
      end
    end
  end
  
  live_loop :hhats do
    with_fx :gverb, room: 69, release: 5, mix: 0.1, amp: v do
      13.times do
        sample :drum_cymbal_closed, rate: 0.7
        sleep 0.25
        sample :drum_cymbal_closed, rate: 0.8, start: 0.1
        sleep 0.25
      end
      synth :cnoise, sustain: 0.15
      2.times do
        sample :drum_cymbal_closed, rate: 0.7
        sleep 0.25
        sample :drum_cymbal_closed, rate: 0.8, start: 0.1
        sleep 0.25
      end
      synth :cnoise, sustain: 0.15
      1.times do
        sleep 0.25
        sample :drum_cymbal_closed, rate: 0.8, start: 0.1
        sleep 0.25
      end
    end
  end
  
  ##| live_loop :drumbrak do
  ##|   8.times do
  ##|     sample :drum_snare_soft, rate: 0.7
  ##|     sleep 0.25
  ##|     sample :drum_snare_soft, rate: 1
  ##|     sleep 0.25
  ##|   end
  ##|   ##| sample :drum_tom_mid_hard, rate: 0.7
  ##|   ##| sleep 0.25
  ##|   ##| 2.times do
  ##|   ##|   sample :drum_snare_soft, rate: 0.7
  ##|   ##|   sleep 0.25
  ##|   ##|   sample :drum_snare_soft, rate: 1
  ##|   ##|   sleep 0.25
  ##|   ##| end
  ##|   ##| sample :drum_tom_mid_hard, rate: 0.7
  ##|   ##| sleep 0.25
  ##|   ##| 2.times do
  ##|   ##|   sample :drum_snare_soft, rate: 0.7
  ##|   ##|   sleep 0.25
  ##|   ##|   sample :drum_snare_soft, rate: 1
  ##|   ##|   sleep 0.25
  ##|   ##| end
  ##|   ##| sample :drum_tom_mid_hard, rate: 0.7
  ##|   ##| sleep 0.25
  ##|   1.times do
  ##|     sample :drum_tom_mid_hard, rate: 0.7
  ##|     sleep 0.25
  ##|     sample :drum_tom_hi_hard, rate: 1
  ##|     sleep 0.25
  ##|   end
  ##|   2.times do
  ##|     sample :drum_snare_soft, rate: 0.7
  ##|     sleep 0.25
  ##|     sample :drum_snare_soft, rate: 1
  ##|     sleep 0.25
  ##|   end
  ##|   1.times do
  ##|     sample :drum_tom_mid_hard, rate: 0.7
  ##|     sleep 0.25
  ##|     sample :drum_tom_hi_hard, rate: 1
  ##|     sleep 0.25
  ##|   end
  ##|   2.times do
  ##|     sample :drum_snare_soft, rate: 0.7
  ##|     sleep 0.25
  ##|     sample :drum_snare_soft, rate: 1
  ##|     sleep 0.25
  ##|   end
  ##| end
end 
7 Likes

That’s brilliant!

With respect to efficiency, you have a few loops like

something.times do
  with_fx :something
    synth :something
    sleep something
  end
end

Which will recreate the fx node for every note. If you change them like this, putting the loop inside the fx, it should run more efficiently:

with_fx :something
  something.times do
    synth :something
    sleep something
  end
end
2 Likes

Sounds great. well done1

1 Like