Skip to content

Instantly share code, notes, and snippets.

@emlyn
Created July 30, 2020 16:05
Show Gist options
  • Save emlyn/8cbb8bb3afc70a32d2eb71380df3987c to your computer and use it in GitHub Desktop.
Save emlyn/8cbb8bb3afc70a32d2eb71380df3987c to your computer and use it in GitHub Desktop.
# I set myself a challenge to code a piece using only white noise.
# White noise contains equal amounts of energy at every (audible) frequency.
# It sounds like this:
#synth :noise
# Not very musical.
# But... it contains every frequency, so every possible sound or piece of music
# is hidden in there somewhere... you just have to filter out the parts you don't want.
# I will use no source of sound other than "synth :noise", passing it through different
# filters and effects to try to create something that sounds a bit less like noise...
# To run this, progressively comment out the "stop"s in each live_loop, hitting run each time...
use_bpm 96
with_fx :reverb, room: 0.8 do
live_loop :waves do
stop
s = synth :noise, cutoff: rrand(50, 110), amp: rrand(0.03, 0.1), attack: rrand(1, 4), sustain: rrand(0, 2), release: rrand(1, 5), slide: rrand(1, 5)
control s, cutoff: rrand(50, 110)
sleep rrand(2,4)
end
end
live_loop :tick, delay: 0.01 do
sleep 4
end
live_loop :bd, sync: :tick do
stop
with_fx :reverb, room: 0.4, amp: 0.3 do
with_fx :rlpf, cutoff: 35 do
2.times do
synth :noise, release: 0.1, amp: 0.5, amp: 150
sleep 1
synth :noise, release: 0.1, amp: 0.5, amp: 50
sleep 1
synth :noise, release: 0.1, amp: 0.5, amp: 100
sleep 1.5
synth :noise, release: 0.1, amp: 0.5, amp: 100
sleep 0.5
end
end
end
end
live_loop :hats, sync: :tick do
stop
with_fx :reverb, room: 0.3, amp: 0.3 do
with_fx :hpf, cutoff: 90 do
16.times do
synth :noise, release: 0.05, amp: 0.5, on: spread(9, 16).tick
sleep 0.25
end
end
end
end
live_loop :hi, sync: :tick do
stop
with_fx :reverb, room: 0.6, amp: 0.3 do
with_fx :hpf, cutoff: 110 do
16.times do
synth :noise, release: 0.02, amp: 0.5, on: spread(11, 16).tick
sleep 0.25
end
end
end
end
live_loop :mid, sync: :tick do
stop
with_fx :reverb, room: 0.3, amp: 0.3 do
with_fx :bpf, centre: 60, res: 0.9 do
8.times do
synth :noise, release: 0.1, amp: 30, on: spread(3, 8).tick
sleep 0.5
end
end
end
end
live_loop :rhythm, sync: :tick do
stop
c = [(chord :c3, :maj),
(chord :a3, :min),
(chord :f3, :maj),
(chord :g3, :maj)].tick
p = (ring 1, 0.5, 0.25).stretch(4).look
with_fx :reverb, room: 0.8, amp: 0.5 do
with_fx :slicer, phase: p, smooth: 0.01 do
with_fx :octaver, mix: 0.2 do
c.each do |n|
with_fx :rbpf, centre: n, res: 0.992 do
synth :noise, sustain: 2, release: 2, amp: 25
end
end
end
end
end
sleep 4
end
live_loop :melody, sync: :tick do
stop
use_random_seed [2000, 88000, 7000, 9000].tick(:x)
16.times do
n = scale(:c, :major_pentatonic).choose
with_fx :octaver, mix: 0.2 do
with_fx :rbpf, centre: n, res: 0.995 do
synth :noise, release: 0.5, amp: 12, on: bools(1,1,1,0).choose
sleep 0.5
end
end
end
end
live_loop :melody2, sync: :tick do
stop
use_random_seed [260000, 810000, 920000, 47000].tick(:x)
16.times do
n = scale(:c6, :major_pentatonic).choose
with_fx :octaver, mix: 0.2 do
with_fx :rbpf, centre: n, res: 0.995 do
synth :noise, release: 0.25, amp: 3 if one_in(2)
sleep 0.25
end
end
end
end
@ruan1998
Copy link

Hi dude, It's really a pleasure for me to hear this sound! May I know how you learn sonic pi?

@emlyn
Copy link
Author

emlyn commented Jun 7, 2021

@ruan1998 there's a tutorial built into Sonic Pi that's really good, I'd recommend starting with that. And then you could use the forum for any more specific queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment