Skip to content

Instantly share code, notes, and snippets.

@Freemoth
Created January 13, 2017 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Freemoth/ae49d64d47c76d50c94b7898e990d6dd to your computer and use it in GitHub Desktop.
Save Freemoth/ae49d64d47c76d50c94b7898e990d6dd to your computer and use it in GitHub Desktop.
Boom Boom Boom
# boomBoomBoom.txt
# sonic(K) New Year's Day 2016
use_bpm 130
use_debug false
x, z = 0, 0
live_loop :melody, delay: 32 do
while z <= 16
z = z + x # fourth value of x is added to z
# puts "z: #{z}"
with_synth [:fm, :sine].choose do
syn = current_synth
# syn_d = current_synth_defaults
4.times do
x = rrand_i(1, 4)
notes = x.times.map{ rrand_i(70, 82) }
puts notes
puts "x: #{x}"
puts "z: #{z}"
# puts syn
play sample [:drum_cymbal_closed, [:drum_snare_hard, :drum_snare_soft].choose].choose \
, amp: 0.85
case syn
when syn = :fm
use_synth_defaults amp: 0.5, attack_level: 1.8, release: 0.6, \
cutoff: x*30, detune: x*0.5, divisor: 3, depth: 3
play_pattern_timed notes, [0.25], pan: rand(-0.8..-0.5)
# puts "half x: #{x*0.5}"
when syn = :sine
use_synth_defaults amp: 0.85, attack: 0.01, attack_level: 1.5, \
release: 0.5, env_curve: 1
with_fx :flanger, phase: 2, feedback: x*0.11 do
play_pattern_timed notes, [0.25], pan: rand(0.5..0.8)
end
end
end
end
end
q = z/4 + 4
puts "q: #{q}"
sleep q
z = 0
end
live_loop :beater do
3.times do
play sample :bd_fat
sleep 1
play sample :drum_tom_lo_soft
play sample :drum_snare_hard, amp: 1.5
sleep 0.5
play sample :drum_snare_soft
sleep 0.5
end
with_fx :echo do
play sample :bd_fat
sleep 1
play sample :bd_fat, amp: 1.5
sleep 0.75
play sample :drum_snare_hard, pan: 0.1
sleep 0.25
end
end
live_loop :bass do
with_fx :reverb, pre_amp: 1.75, room: 0.4, mix: 0.3 do
4.times do
3.times do
play sample :bass_dnb_f, rate: 1.34, amp: 1.5, pan: -0.6
sleep 2
end
sleep 2
end
4.times do
3.times do
play sample :bass_dnb_f, rate: 0.9, amp: 2, release: 0.5, pan: -0.3
sleep 2
end
sleep 2
end
end
end
live_loop :hat do
with_fx :reverb, room: rand(0.4..0.55), mix: 0.3 do
play sample :drum_cymbal_open, attack: 0.03, amp: 1.5, rate: rand(0.99..1.02)
sleep 0.25
end
3.times do
play sample :drum_cymbal_closed, rate: rand(0.99..1.05)
sleep 0.25
end
end
@Freemoth
Copy link
Author

Code for "Boom, Boom, Boom" by sonic(K). Audio is here https://soundcloud.com/freemoth/boom-boom-boom.

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