Last active
April 21, 2020 02:36
-
-
Save xavriley/418f8283af2fbe95fc90 to your computer and use it in GitHub Desktop.
Recreating the THX sound with SonicPi
This file contains hidden or 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
# THX Deep Note | |
# Second draft | |
# see http://www.earslap.com/article/recreating-the-thx-deep-note.html | |
time = 10 | |
wait_time = (time / 3) | |
synths = [] | |
rand_note = -> { rrand(note(:A2), note(:A4)) } | |
with_fx :normaliser, amp: 0.5 do | |
use_synth :dsaw | |
30.times do | |
# collect the synths in an array for controlling later | |
synths << lambda { play(rand_note.call, detune: rrand(0,1), | |
detune_slide: time, | |
sustain: time, | |
pan: rrand(0, 1)) }.call | |
end | |
sleep wait_time | |
synths.each do |t| | |
if (rrand(0.0, 1.0) > 0.5) | |
# some go up | |
t.control note: 70, note_slide: rrand(wait_time, (time - 2)), detune: 0.1 | |
else | |
# others go down | |
t.control note: 46, note_slide: rrand(wait_time, (time - 2)), detune: 0.1 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment