"CODE-SWITCH" recorded song release [Soundcloud Link]

Hey! This is my first post :')

I’m quite new to Sonic Pi but have been learning over the last year! I made this piece for an artist commission program for young people, and I thought I’d share!

I recorded my vocals and made the chord loop in Ableton first but mostly all the other effects and samples are in-built and arranged in Sonic Pi. I recorded the piece and did a simple master in Ableton to finish off.

In retrospect, my code is a bit clunky, but it was a really great learning experience! I hope you enjoy :slight_smile:

SOUNDCLOUD LINK HERE

8 Likes

This is really beautiful work. Thank-you so much for sharing it here. I look forward to seeing what you do next on your Sonic Pi adventure!

1 Like

Wow thank you so much Sam! This really means a lot to me.

Thank you for making something so accessible and fun to use! I cant wait to keep learning.

1 Like

This has a very nice atmosphere to it and I like the slow percussion. I’d be interested in your next composition :+1:

Would you consider sharing your code?

@binarysweets sorry for the delay on this reply! I’m back to Sonic Pi world.

The code is clunky but it did the job, if anyone has tips to make it more concise - i am very open and would love to hear them!

I probably could have done this with live_loops and recorded but at the time, I didn’t know about the stop command existing LOL so I made heaps of functions, added some long sleeps and then arranged the song at the end.



#Loading in vocal samples edited in Ableton
s1 = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/gran_chord_1.wav"
vpent = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vpent_1.wav"
vclimactic = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vclimatic_1.wav"
vlow_run = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vlow_run_1.wav"
vohoh = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vohoh_1.wav"
vlow2high = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vlow2high_1.wav"
vtri_ah ="/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vtri_ah_1.wav"
vhigh_low = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vhigh_low(airy)_2.wav"
vlongnote = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vlongnote1.wav"
vlongnote_reverb ="/Users/fetlenega/Music/Ableton/Live Recordings/Temp-1 Project/Samples/Processed/Freeze/vlongnotereverb.wav"
vlow_highrun = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vlow_highrun_1.wav"
vfastrun = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vfastrun_1.wav"
vmidstaccato = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vmidstaccato_1.wav"
vhighstaccato = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vhighstaccato_1.wav"
vmmm = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vmmm_1.wav"
vlowfullrun ="/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vlowfullrun_1.wav"
vwrong_note = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vwrongnote_1.wav"
vhigh_airy ="/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/vhigh_airy_1.wav"
varabic = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/varabic_1.wav"
snare = "/Users/fetlenega/Desktop/Music/signal screen and sound/Sonic Pi Edited FINAL Samples/SC_SADL_snare_closed_beefy_dryer.wav"

a = (ring :E5, :F5, :A5, :B5, :C5, :E4, :F4, :A4, :B4, :C4)
b = (ring :E3, :F3, :A3, :B3, :C3, :E4, :F4, :A4, :B4, :C4)


define :chords do
  live_loop :granulator_chords do
    sample s1, beatstretch: 16, amp: 0.6
    sleep 16
  end
end

define :vocal_harmony do |v1, v2|
  live_loop :harmony do
    sync :granulator_chords
    with_fx :reverb, room: 0 do
      sample v1, amp: 0.3
      sample v1, amp: 0.3, pitch: 3, pan: 0.8
      sample v1, amp: 0.3, pitch: -4, pan: -0.8
      sleep 4
      sample v2, amp: 0.3
      sample v2, amp: 0.3, pitch: -4, pan: 0.8
      sample v2, amp: 0.3, pitch: 5, pan: -0.8
      sleep 4
    end
  end
end

define :vocal_disharmony do |v1, v2|
  2.times do
    sync :granulator_chords
    with_fx :reverb, room: 0.99 do
      sample v1, amp: 0.3
      sample v1, amp: 0.3, pitch: 2, pan: rrand(0.7, 0.99)
      sample v1, amp: 0.3, pitch: -2, pan: rrand(-0.99, -0.5)
      sleep 4
      sample v2, amp: 0.3
      sample v2, amp: 0.3, pitch: -4, pan: rrand(0.7, 0.99)
      sample v2, amp: 0.3, pitch: 4, pan: rrand(-0.99, -0.5)
      sleep 2
    end
  end
end

define :vocal_warp_1 do |v1, v2, v3, v4|
  sync :granulator_chords
  with_fx :reverb, pre_amp: 0.8, room: 0.8 do
    with_fx :compressor do
      sample v1, amp: 1, rate: 1, pan: 0.7
      sleep 4
      sample v2, amp: 1, rate: 1, pan: 0.4
      sleep 4
      sample v3, amp: 1, rate: 1, pan: -0.7
      sleep 4
      sample v4, amp: 1, rate: 1, pan: -0.4
      sleep 4
    end
  end
end

define :vocal_warp_outro do |v1, v2, v3, v4|
  sync :granulator_chords
  with_fx :reverb, room: 0.99 do
    with_fx :compressor do
      sample v1, amp: 1, rate: 1, pan: 0.7
      sleep 4
      sample v2, amp: 1, rate: 1, pan: 0.4
      sleep 4
      sample v3, amp: 1, rate: 1, pan: -0.7
      sleep 4
      with_fx :reverb, mix: 0.8, room: 0.99 do
        sample v4, amp: 1, rate: 1, pan: -0.4
        sleep 4
      end
    end
  end
end

##| define :vocal_warp_3 do |v1, v2, v3, v4|
##|   with_fx :reverb, room: 0.99 do
##|     with_fx :compressor do
##|       sample v1, amp: 1.2, rate: 1, pan: 0.7
##|       sleep 4
##|       sample v2, amp: 1.2, rate: 1, pan: 0.4
##|       sleep 4
##|       sample v3, amp: 1, rate: 1, pan: -0.7
##|       sleep 4
##|       sample v4, amp: 1, rate: 1, pan: -0.4
##|       sleep 4
##|     end
##|   end
##| end
#middle - english encroaching, 4/4 beat, chords reversed in sonic pi then same chords played with a synthesiser instead, vocal samples played back with randomised effects e.g. rate/pitch effected, reversed/distored

define :vocal_warp_2 do |v1, v2, v3, v4|
  with_fx :reverb, pre_amp: 0.7, room: 0.8 do
    with_fx :compressor do
      sample v1, amp: 1, rate: -0.5, pan: 0.8
      sleep 4
      sample v2, amp: 1, rate: 2, pan: 0.3
      sleep 4
      sample v3, amp: 1, rate: -1, pan: -0.3
      sleep 4
      sample v4, amp: 1, rate: 1, pan: -0.8
      sleep 4
    end
  end
end

define :riser do
  with_fx :reverb, room: 0.8 do
    sleep 3
    sample :ambi_dark_woosh, rate: -0.5, attack: 1, amp: 0.7, pan: -0.3
    sleep 0.1
  end
end


define :western_drums do
  sync :granulator_chords
  with_fx :gverb, mix: 0.2 do
    4.times do
      1.times do
        sample :drum_bass_hard, amp: 0.3
        sleep 2
      end
      1.times do
        sample snare, amp: 0.26
        sleep 2
      end
    end
  end
  with_fx :reverb, room: 0.4 do
    with_fx :eq, low_shelf: -0.5, low_shelf_note: 36, low_shelf_slope: 0.8 do
      live_loop :drums do
        6.times do
          1.times do
            sample :bd_pure , amp: 1
            sleep 4
          end
          1.times do
            sample :bd_pure, amp: 1
            sleep 3.5
            sample :bd_pure, amp: 0.8
            sleep 0.5
          end
          1.times do
            sample :bd_pure, amp: 1
            sleep 3
            sample :bd_pure, amp: 0.8
            sleep 1
          end
          1.times do
            sample :bd_pure, amp: 1
            sleep 2.5
            sample :bd_pure, amp: 0.8
            sleep 1
            sample :bd_pure, amp: 0.8
            sleep 0.5
          end
        end
        sleep 300
      end
    end
  end
end


define :african_drums_2 do
  with_fx :reverb, mix: 0.3, room: 0.7 do
    live_loop :african do
      (2.5).times do
        sample :loop_safari, beat_stretch: 16, amp: 0.6
        sleep 16
      end
      sleep 160
    end
  end
end


#ARRANGEMENT:

2.times do
  sample :vinyl_hiss, amp: 0.4, beat_stretch: 16
end

vocal_warp_2 vclimactic, vhigh_airy, vhigh_low, vfastrun

chords

vocal_harmony vlongnote, vhighstaccato

vocal_warp_1 vhigh_low, varabic, vohoh, vhigh_airy

sleep 2

with_fx :tremolo, mix: 0.8 do
  vocal_disharmony vmidstaccato, vlongnote
end

riser

with_fx :echo, mix: 0.3 do
  western_drums
end

with_fx :gverb, mix: 0.8 do
  with_fx :panslicer, mix: 0.8, amp: 0.6 do
    vocal_warp_2 vhigh_airy, vlow_highrun, vpent, vfastrun
  end
end

##| with_fx :ping_pong, mix: 0.4 do
##|   with_fx :gverb, mix: 0.5 do
##|     with_fx :autotuner do
##|       with_fx :panslicer, mix: 0.8, amp: 0.5 do
##|         vocal_warp_2 vhigh_airy, vohoh, vlow_highrun, vfastrun
##|         vocal_warp_2 vfastrun, varabic, vhigh_low, vlow2high
##|       end
##|     end
##|   end
##| end

with_fx :band_eq, freq: 88, res: 0.9, db: -1 do
  with_fx :ping_pong, mix: 0.4 do
    with_fx :gverb, mix: 0.5 do
      with_fx :flanger, mix: 0.5 do
        with_fx :autotuner, pre_amp: 0.8, pre_mix: 0.8, formant_ratio: 2, mix: 0.3 do
          with_fx :panslicer, pre_amp: 0.7, mix: 0.8, amp: 0.5 do
            vocal_warp_2 vhigh_airy, vohoh, vlow_highrun, vfastrun
            vocal_warp_2 vfastrun, varabic, vhigh_low, vlow2high
          end
        end
      end
    end
  end
end

vocal_harmony vmidstaccato, vlongnote

with_fx :ping_pong do
  16.times do
    use_synth :dark_ambience
    play (ring :E3, :F3, :A3, :B3, :C3).tick, amp: rrand(0.95, 1.4), release: choose([1, 1.5, 2])
    sleep 1
  end
end

african_drums_2
vocal_warp_2 vclimactic, vhigh_airy, vhigh_low, vfastrun
vocal_warp_outro vhigh_low, varabic, vohoh, vhigh_airy


1 Like