Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. @chrisboyle chrisboyle created this gist Nov 26, 2018.
    29 changes: 29 additions & 0 deletions sick_of_losing_soulmates.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # Run this in Sonic Pi: https://sonic-pi.net/
    # Sick of Losing Soulmates by Dodie: https://youtu.be/mHUIoikgKT0
    # Inspired by Deerful's cover: https://youtu.be/sfaEBsloiQk

    use_synth :pluck
    use_bpm 75

    define :tab do |t|
    last = nil
    t.split('').map.with_index do |n, i|
    changed = (n != last)
    last = n
    low = note(:e2) + n.to_i
    [changed || i.even? ? low : :r, :d3, low, :d3]
    end.flatten
    end

    verse = tab( '55772233' * 4)
    pre = tab(('75923333' * 4)[0...-1] + '2')
    chorus = tab(('3335777766115552' * 2)[0...-1] + '5')
    bridge = verse[0...-4] + tab('2')

    live_loop :guitar do
    n = ((verse + pre + chorus) * 2 + bridge + chorus).tick
    stop unless n
    use_bpm_mul 0.99 if look > 976
    play n
    sleep 0.25
    end