Personal Creation - Six Chord Song

A work in progress. It will get a better name and lyrics and all that. Thought I’d share for anyone interested. Feel free to suggest things and add your own spin on it. Also I’m not very good at coding so any improvements on making it tidier or more efficient are very welcome.

use_debug false
use_bpm 60
define :sixchords do
  use_synth :hollow
  a = 2
  in_thread do
    with_fx :level, amp: 4 do
      play chord(:C4, :minor), sustain: 2
      sleep 2
      play [58, 63, 65], sustain: 2
      sleep 2
      play chord(:Ab3, :major), sustain: 2
      sleep 2
      play chord(:Ab3, :major), sustain: 2
      sleep 2
      play chord(:G3, :minor), sustain: 2
      sleep 2
      play [53, 58, 60], sustain: 2
      sleep 2
      play chord(:Eb3, :major), sustain: 2
      sleep 2
      play chord(:Eb3, :major), sustain: 1
      sleep 2
    end
  end
  use_synth :dark_ambience
  with_fx :level, amp: 4 do
    play chord(:C4, :minor), sustain: 2
    sleep 2
    play [58, 63, 65], sustain: 2
    sleep 2
    play chord(:Ab3, :major), sustain: 2
    sleep 2
    play chord(:Ab3, :major), sustain: 2
    sleep 2
    play chord(:G3, :minor), sustain: 2
    sleep 2
    play [53, 58, 60], sustain: 2
    sleep 2
    play chord(:Eb3, :major), sustain: 2
    sleep 2
    play chord(:Eb3, :major), sustain: 0.5
    sleep 2
  end
end

define :guitlead do
  with_fx :reverb do
    16.times do
      use_synth :rodeo
      use_synth_defaults release: 3, sustain: 1       #]
      play [:Ds4, :C4, :Ds4, :Bb3, :C4, :Ab3, 0, 0, :D4, :Bb3, :C4, :Bb3, :G3, :Bb3, 0, 0].tick, amp: 0.6
      sleep 1
    end
  end
  
end
define :vioprogress do
  in_thread do
    use_synth :blade
    detune = 0.05
    use_synth_defaults sustain: 1, attack: 0.25, release: 0.75, amp: 0.375
    #Ds note
    play :Ds6, sustain: 5
    play :Ds6 + detune, sustain: 5
    #Cmin chord
    play :G6
    play :G6 + detune
    play :C6
    play :C6 + detune
    sleep 2
    #Bbmaj-sus4 chord
    play :Bb6
    play :Bb6 + detune
    play :F6
    play :F6 + detune
    sleep 2
    #Abmaj chord
    play :C6
    play :C6 + detune
    play :Ab6
    play :Ab6 + detune
    sleep 2
    sleep 2
    
    #Bb note
    play :Bb6, sustain: 5
    play :Bb6 + detune, sustain: 5
    #Gmin chord
    play :G6
    play :G6 + detune
    play :D6
    play :D6 + detune
    sleep 2
    #Fmaj-sus4 chord
    play :F6
    play :F6 + detune
    play :C6
    play :C6 + detune
    sleep 2
    #Ebmaj chord
    play :G6
    play :G6 + detune
    play :Eb6
    play :Eb6 + detune
    sleep 2
    sleep 2
  end
  in_thread do
    with_fx :level, amp: 0.6 do
      use_synth :sine
      play :C3, release: 2.5
      sleep 2
      play :Bb2, release: 2.5
      sleep 2
      play :Ab2, release: 3.5
      sleep 2
      sleep 2
      play :G2, release: 2.5
      sleep 2
      play :F2, release: 2.5
      sleep 2
      play :Eb2, release: 3.5
      sleep 2
      sleep 2
    end
  end
  
  with_fx :level, amp: 0.3 do
    use_synth :dpulse
    play :C2, release: 2.5
    sleep 2
    play :Bb1, release: 2.5
    sleep 2
    play :Ab1, release: 3.5
    sleep 2
    sleep 2
    play :G1, release: 2.5
    sleep 2
    play :F1, release: 2.5
    sleep 2
    play :Eb1, release: 3.5
    sleep 2
    sleep 2
  end
end

#########################################################

define :bridge do
  2.times do
    with_fx :level, amp: 0.15 do
      in_thread do
        use_synth_defaults sustain: 0,   attack: 0.25
        use_synth :tri
        3.times do
          play 79
          play 82
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 79
        play 82
        sleep 0.5
        play 74
        sleep 0.5
        3.times do
          play 79
          play 72
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 79
        play 72
        sleep 0.5
        play 70
        sleep 0.5
        3.times do
          play 68
          play 72
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 68
        play 72
        sleep 1
        play chord(:Bb4, :sus4), sustain: 1.5
        sleep 2
        play chord(:Bb4, :major), sustain: 1.5
        sleep 2
      end
      in_thread do
        use_synth_defaults sustain: 0
        use_synth :sine
        3.times do
          play 79
          play 82
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 79
        play 82
        sleep 0.5
        play 74
        sleep 0.5
        3.times do
          play 79
          play 72
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 79
        play 72
        sleep 0.5
        play 70
        sleep 0.5
        3.times do
          play 68
          play 72
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 68
        play 72
        sleep 1
        play chord(:Bb4, :sus4), sustain: 1.5
        sleep 2
        play chord(:Bb4, :major), sustain: 1.5
        sleep 2
      end
      in_thread do
        use_synth_defaults sustain: 0
        use_synth :piano
        3.times do
          play 79
          play 82
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 79
        play 82
        sleep 0.5
        play 74
        sleep 0.5
        3.times do
          play 79
          play 72
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 79
        play 72
        sleep 0.5
        play 70
        sleep 0.5
        3.times do
          play 68
          play 72
          sleep 0.5
          play 75
          sleep 0.5
        end
        play 68
        play 72
        sleep 1
        8.times do
          play chord(:Bb4, :sus4)
          sleep 0.25
          play chord(:Bb4, :major)
          sleep 0.25
        end
      end
      in_thread do
        with_fx :level, amp: 0.6 do
          use_synth_defaults sustain: 0
          use_synth :saw
          3.times do
            play 79
            play 82
            sleep 0.5
            play 75
            sleep 0.5
          end
          play 79
          play 82
          sleep 0.5
          play 74
          sleep 0.5
          3.times do
            play 79
            play 72
            sleep 0.5
            play 75
            sleep 0.5
          end
          play 79
          play 72
          sleep 0.5
          play 70
          sleep 0.5
          3.times do
            play 68
            play 72
            sleep 0.5
            play 75
            sleep 0.5
          end
          play 68
          play 72
          sleep 1
          play chord(:Bb4, :sus4), sustain: 1.5
          sleep 2
          play chord(:Bb4, :major), sustain: 1.5
          sleep 2
        end
      end
      in_thread do
        use_synth :sine
        play chord(:Eb4, :major), sustain: 3.5
        sleep 4
        play chord(:C4, :minor), sustain: 3.5
        sleep 4
        play chord(:Ab3, :major), sustain: 3.5
        sleep 4
        play chord(:Bb3, :sus4), sustain: 1.5
        sleep 2
        play chord(:Bb3, :major), sustain: 1.5
        sleep 2
      end
      in_thread do
        use_synth :sine
        4.times do
          play chord(:Eb3, :major), sustain: 1
          sleep 1
        end
        4.times do
          play chord(:C3, :minor), sustain: 1
          sleep 1
        end
        4.times do
          play chord(:Ab2, :major), sustain: 1
          sleep 1
        end
        2.times do
          play chord(:Bb2, :sus4), sustain: 1
          sleep 1
        end
        2.times do
          play chord(:Bb2, :major), sustain: 1
          sleep 1
        end
      end
      
      in_thread do
        with_fx :level, amp: 0.375 do
          use_synth :dpulse
          play chord(:Eb2, :major), sustain: 3.5
          sleep 4
          play chord(:C2, :minor), sustain: 3.5
          sleep 4
          play chord(:Ab1, :major), sustain: 3.5
          sleep 4
          play chord(:Bb1, :sus4), sustain: 1.5
          sleep 2
          play chord(:Bb1, :major), sustain: 1.5
          sleep 2
        end
      end
      use_synth :tri
      play chord(:Eb4, :major), sustain: 3.5
      sleep 4
      play chord(:C4, :minor), sustain: 3.5
      sleep 4
      play chord(:Ab3, :major), sustain: 3.5
      sleep 4
      play chord(:Bb3, :sus4), sustain: 1.5
      sleep 2
      play chord(:Bb3, :major), sustain: 1.5
      sleep 2
    end
  end
end

in_thread do
  15.times do
    puts tick
    puts "progressions"
    sleep 16
  end
end




#####################################################################

in_thread do
  guitlead
  
  sleep 16
  sleep 16
  
  vioprogress
  vioprogress
  
  
  sleep 16
  sleep 16
  
  vioprogress
  vioprogress
  
  #sleep 16
  #sleep 16
  bridge
  
  sleep 1
  
  guitlead
  
  vioprogress
  vioprogress
  
  sleep 16
  #4:00
end

sixchords#g

sixchords#s
sixchords

sixchords#v
sixchords

sixchords#s
sixchords

sixchords#v
sixchords

#sixchords#s
#sixchords
sleep 16
sleep 16

sleep 1

sixchords#g

sixchords#v
sixchords#v

sixchords
4 Likes

This is really nice! I think it sounds great, and the progression itself is lovely. Thanks for sharing.

1 Like

Hello, I’m a newbie at Sonic Pi, but as a developper I can give some code hints …
if as I think there are some repetitions in the bridge, you may create a function for each of theses blocs something like bridge_var1 etc… Hope it can help to simplify the file

1 Like

sounds useful, I’ll explore this, thanks!

Thanks for the feedback!

If I can find the time, I will have a look at your code and give you an example
Apart from this I love this sound !

1 Like

Not ideal, but a quick-and-dirty technique is to store data in arrays, e.g

q = 1.0; e = q/2; s = e/2
h = q*2; w = h*2

bridgeplay = Proc.new { |p,q,*r|
  use_synth q
  use_synth_defaults sustain: [p[1]-0.5,0].max
  play p[0], *r
}
define :launch_part do |notes, instrument, *opts|
  in_thread do
    notes.each_slice(2) { |p| bridgeplay[p,instrument,*opts]; sleep p[1] }
  end
end


TRI_NOTES = [[79,82],e,75,e]*3+[[79,82],e,74,e]+[[79,72],e,75,e]*3+
  [[79,72],e,70,e]+[[68,72],e,75,e]*3+[[68,72],e,:r,e,chord(:bb4,:sus4),h]+
  [chord(:bb4,:major),h]
SINE_NOTES = [[79,82],e,75,e]*3+[[79,82],e,74,e]+[[79,72],e,75,e]*3+
  [[79,72],e,70,e]+[[68,72],e,75,e]*3+[[68,72],e,:r,e]+
  [chord(:bb4,:sus4),h,chord(:bb4,:major),h]
PIANO_NOTES = [[79,82],e,75,e]*3+[[79,82],e,74,e]+[[79,72],e,75,e]*3+
  [[79,72],e,70,e]+[[68,72],e,75,e]*3+[[68,72],e,:r,e]+
  [chord(:bb4,:sus4),s,chord(:bb4,:major),s]*8
SAW_NOTES = [[79,82],e,75,e]*3+[[79,82],e,74,e]+
  [[79,72],e,75,e]*3+[[79,72],e,70,e]+[[68,72],e,75,e]*3+
  [[68,72],e,:r,e,chord(:bb4,:sus4),h,chord(:bb4,:major),h]
MORE_SINE_NOTES = [chord(:eb4, :major),w,chord(:c4,:minor),w,chord(:ab3,:major),w,chord(:bb3,:sus4),h,chord(:bb3,:major),h]
MORE_MORE_SINE = [chord(:eb3,:major),q]*4+[chord(:c3,:minor),q]*4+
  [chord(:ab2,:major),q]*4+[chord(:bb2,:sus4),q]*2+[chord(:bb2,:major),q]*2
DPULSE_NOTES = [chord(:eb2,:major),w,chord(:c2,:minor),w,chord(:ab1,:major),w,chord(:bb1,:sus4),h,chord(:bb1,:major),h]
MORE_TRI = [chord(:eb4,:major),w,chord(:c4,:minor),w,chord(:ab3,:major),w,chord(:bb3,:sus4),h,chord(:bb3,:major),h]


launch_part TRI_NOTES, :tri, attack: 0.25, amp: 0.15
launch_part SINE_NOTES, :sine, amp: 0.15
launch_part PIANO_NOTES, :piano,amp: 0.15
launch_part SAW_NOTES, :saw, amp: 0.6
launch_part MORE_SINE_NOTES, :sine, amp: 0.15
launch_part MORE_MORE_SINE, :sine, sustain: 1, amp: 0.15
launch_part DPULSE_NOTES, :dpulse, amp: 0.375
launch_part MORE_TRI, :tri, amp: 0.15
1 Like

Wow! Thank you! I will definitely incorporate this, and use it in other projects. Very useful Thanks