Last active
August 29, 2022 05:10
-
-
Save chrisboyle/0a2acf0984af755adafb4baf5d489a0c to your computer and use it in GitHub Desktop.
My first Sonic Pi thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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| | |
t.split('').map {|n| note(:e2) + n.to_i } | |
end | |
verse = tab( '55772233' * 4) | |
pre = tab(('75923333' * 4)[0...-1] + '2') | |
chorus = tab(('3335777766115552' * 2)[0...-1] + '5') | |
bridge = verse[0...-1] + tab('2') | |
song = (verse + pre + chorus) * 2 + bridge + chorus | |
live_loop :guitar do | |
low = song.tick | |
stop unless low | |
changed = song.look(offset: -1) != low | |
[changed || look.even? ? low : :r, :d3, low, :d3].each do |n| | |
use_bpm_mul 0.99 if song.length - look < 12 | |
play n | |
sleep 0.25 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment