Created
March 11, 2022 15:45
Star
You must be signed in to star a gist
Ambiant music for sonic-pi
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
use_bpm 89 | |
def tl(name) | |
in_thread(name: name) do | |
loop do | |
send(name) | |
end | |
end | |
end | |
@notes = [:e3, :fs3, :g2, :b2, :cs3].ring | |
def xselnote | |
@xnote = choose(@notes) | |
sleep 5 | |
end | |
xselnote | |
def xchords | |
t = rand(12) | |
a = t*0.2 | |
d = t - a | |
c = chord(@xnote, :minor) | |
play c, attack: a, decay: d, decay_level: 0.5 | |
play_pattern_timed c.shuffle, a if tick % 3 == 0 | |
sleep t/2 | |
end | |
def xpad | |
use_synth :dark_ambience | |
play @xnote, decay: 5, amp: 2 | |
sleep 3 | |
end | |
def xsample | |
sample :ambi_lunar_land, amp: 0.5, pan: rand(2) - 1, rate: rand(1) + 0.55 | |
sleep rand_i(100) + 10 | |
end | |
xsample | |
tl :xchords | |
tl :xselnote | |
tl :xpad | |
tl :xsample |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment