Skip to content

Instantly share code, notes, and snippets.

@srdjan-m
Last active December 29, 2016 02:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srdjan-m/a97f60886dc40a541d5f8ba5887e0633 to your computer and use it in GitHub Desktop.
Save srdjan-m/a97f60886dc40a541d5f8ba5887e0633 to your computer and use it in GitHub Desktop.
sonic_pi: optimized badass
# "The Optimized Badass"
# Sonic Pi v2.11
# ----------------------------------------
# Samples used in this song can be downloaded from:
# https://dl.dropboxusercontent.com/u/657073/sonicpi/badass-samples.zip
# Unpack and put them into your samples folder.
# ----------------------------------------
# This file is too long to be played from the Sonic Pi IDE
# Instead of pasting this code, just enter the following into the Sonic Pi editor:
# run_file "/path/to/this_file.rb"
# Enjoy!
# ----------------------------------------
use_debug false
use_bpm 120
@samples_dir = "/Users/srdjan/Dropbox/Projects/Sonic_Pi/badass/samples/" # Change this path to your samples folder path!
@circle = 0
def claps(a = 1)
diff = a/10
sample @samples_dir, "GDYN_Punching_Perc_PRO_SGC - 8", amp: rrand(0.2, 0.4)
with_fx :band_eq, freq: 100, res: 0.9, db: -10 do
with_fx :compressor, treshold: 0.1, slope_below: 1, slope_above: 0.001 do
with_fx :reverb, room: 0.8, damp: 0.1 do
sample @samples_dir, "clap", amp: rrand(a - diff, a + diff), lfp: 90
end
end
end
end
in_thread do #!!! CONTROL !!!
145.times {cue :beat; sleep 4; @circle += 1; puts "Circle: #{@circle}"}
stop
end
in_thread(name: :claps) do ### CLAPS ###
claps_pattern = [[0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 0, 1]]
claps = [1, #start
0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, # normal
1, 2, 1, 2, 1, 2, 1, 1, # faster
2, 2, 2, 0, # bridge
0, 0, 0, 1, # chorus
0, 0, 0, 1,
1, 1, 1, 2,
5, 5, 5, 5,
5, 5, 5, 5, # the fastest
4, 4, 0, 2,
1, 2, 1, 2, 1, 2, 1, 2, 0, 1, 0, 2, 0, 1, 0, 1, # normal
1, 2, 1, 2, 1, 2, 1, 1, # faster
2, 2, 2, 0, # bridge
0, 0, 0, 1, # chorus
0, 0, 0, 1,
1, 1, 1, 2,
5, 5, 5, 5,
5, 5, 5, 5, # the fastest
4, 4, 0, 2,
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, # solo
0, 0, 0, 1, # chorus
0, 0, 0, 1,
1, 1, 1, 2,
5, 5, 5, 5,
4, 4, 4, 4, # the fastest
4, 4, 0, 2
]
triggers = [28, 29, 30, 31, 80, 81, 82, 83, 121, 122, 138, 139] # no bass drum at
loop do
sync :beat
4.times do |t|
with_fx :reverb, room: 0.3, damp: 0.9, mix: 0.275 do
sample @samples_dir, "Tribal-Kick-09", amp: 0.5, pan: 0 unless triggers.include?(@circle)
end
if claps_pattern[claps[@circle]][t] == 1
c = 0.67
if claps[@circle] == 4
c = 0.5
end
claps(c)
end
sleep 1
end
end
end
in_thread(name: :drums) do ### DRUMS ###
drums = [0, #start
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # part1
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, # bridge
1, 1, 1, 1, # chorus
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # part 2
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, # bridge
1, 1, 1, 1, # chorus
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # solo
0, 0, 0, 0, # chorus
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 0, 0 # the end
]
loop do
sync :beat
if drums[@circle] == 1
4.times do |x|
use_synth :zawa
play :d1, attack:0, sustain: 0.005, release: 0.03, cutoff: 57, amp: 0.75, pan: 0.25
use_synth :fm
play :d1, attack:0, sustain: 0.03, release: 0.2, cutoff: 120, amp: 1, pan: -0.25
sample :bd_sone, lpf: 75, amp: 0.35
sleep 0.5
val = [0.02, 0.03, 0.02, 0.2][x] # sustain and release values
unless [25, 26, 27, 28, 29, 30, 31, 77, 78, 79, 80, 81, 82, 83, 121].include?(@circle)
with_fx :echo, decay: 2 do
use_synth :cnoise
with_fx :compressor, treshold: 0.2, slope_above: 1, slope_below: 0.75 do
play :c10, decay: 0.02, sustain: val, release: val, amp: 0.00333, pan: -0.3,
cutoff: 121 , res: 0.9, env_curve: 7
end
end
end
# Strange "beep" sound
use_synth :mod_tri
a = 0
a = 0.018 if @circle > 60 && @circle < 69
play :e6, attack:0, sustain: val * 2, release: val * 2, amp: a, pan: 0.5, cutoff: 90
sleep 0.5
end
end
end
end
### BASS ###
bass_a = [[:c2, :ds2, :f2, :c2, :c2, :ds2, :f2, :c2],
[:c2, :ds2, :f2, :c2, :c2, :ds2, :f2, :ds2],
[:fs2, :fs2, :f2, :ds2, nil, nil, nil, nil],
[:bb1, :bb1, :bb1, :bb1, nil, nil, nil, nil], # bridge
[:c2, :c2, :c2, :c2, nil, nil, nil, nil],
[:g1, :g1, :g1, :g1, nil, nil, nil, nil],
[:g1, :g1, :g1, :g1, nil, nil, nil, nil],
[:f2, :f2, :f2, :f2, :f2, :f2, :f2, :f2,], # chorus 1
[:g2, :g2, :g2, :g2, :gs2, :gs2, :gs2, :gs2],
[:ds2, :ds2, :ds2, :ds2, :ds2, :ds2, :ds2, :ds2],
[:g2, :g2, :g2, :g2, :as2, :as2, :as2, :as2],
[:f2, :f2, :f2, :f2, :c2, :ds2, :f2, :ds2], # chorus 2
[:f2, :f2, :f2, :c2, :ds2, :f2, :as2, :as1],# :ds2, :ds2],
[:ds2, :ds2, :ds2, :ds2, :ds2, :as2, :as1, :ds2],
[:g2, :g2, :gs2, :a2, :as2, :as2, :as1, :d2]
]
bass_s = [[0.4, 0.4, 0.5, 0.5, 0.4, 0.4, 0.5, 0.5],
[0.4, 0.4, 0.5, 0.5, 0.4, 0.4, 0.5, 0.5],
[0.4, 0.4, 0.5, 0.3, 0, 0, 0, 0],
[0.5, 0.5, 0.6, 0.5, 0, 0, 0, 0], # bridge
[0.5, 0.5, 0.6, 0.5, 0, 0, 0, 0],
[0.5, 0.5, 0.6, 0.5, 0, 0, 0, 0],
[0.6, 0.6, 0.6, 0.4, 0, 0, 0, 0],
[0.6, 0.6, 0.4, 0.4, 0.6, 0.6, 0.4, 0.4], # chorus
[0.6, 0.6, 0.4, 0.4, 0.6, 0.6, 0.4, 0.4],
[0.6, 0.6, 0.4, 0.4, 0.6, 0.6, 0.4, 0.4],
[0.6, 0.6, 0.4, 0.4, 0.6, 0.6, 0.4, 0.4]
]
bass_play = [0,
1, 1, 1, 1, 1, 1,
2, # bridge
6, 3, 3, 4, 4, 5, # chorus
1, 1, 1, 1, 1, 1,
2,
6, 3, 3, 4, 4, 5, # chorus
1, 1, 1, 1, # solo
6, 3, 3, 4, 4, 5 # the end chorus
]
bass = [[nil],
bass_a[0] + bass_a[0] + bass_a[1] + bass_a[2],
bass_a[3] + bass_a[4] + bass_a[5] + bass_a[6], # bridge 1
bass_a[7] + bass_a[8] + bass_a[9] + bass_a[14], # chorus 1
bass_a[11] + bass_a[12] + bass_a[13] + bass_a[14], # chorus 2
bass_a[7] + bass_a[8] + [nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil], # chorus end
[nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil] # chorus end
]
bass_circle = 0
in_thread(name: :bass1) do ### USED FOR BRIDGE ONLY ###
bass1_play = [0,
0, 0, 0, 0, 0, 0,
2, # bridge
0, 0, 0, 0, 0, 0, # chorus
0, 0, 0, 0, 0, 0,
2,
0, 0, 0, 0, 0, 0, # chorus
0, 0, 0, 0, # solo
0, 0, 0, 0, 0, 0 # the end chorus
]
bass1 = [[nil],
bass_a[0] + bass_a[0] + bass_a[1] + bass_a[2],
bass_a[3] + bass_a[4] + bass_a[5] + [nil], # bridge 1
bass_a[7] + bass_a[7] + bass_a[8] + bass_a[8], # chorus
bass_a[7] + bass_a[7] + [nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil], # chorus end
[nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil] + [nil, nil, nil, nil, nil, nil, nil, nil] # chorus end
]
use_synth :dsaw
loop do
sync :beat
play_pattern_timed bass1[bass1_play[bass_circle]], 0.5, env_curve: 4, release: 1, cutoff: 97, res: 0.1, amp: 0.1, detune: 0.1
end
end
in_thread(name: :bass) do
use_synth :fm
with_fx :band_eq, freq: 120, db: 10 do
with_fx :reverb, room: 0.1 do
loop do
sync :beat
play_pattern_timed bass[bass_play[bass_circle]], 0.5, env_curve: 7, attack: 0, attack_level: 1.5,
sustain: 0.4, release: 0.5, cutoff: 85, amp: 0.225, divisor: 1.01, depth: 2.5
bass_circle += 1
end
end
end
# end
end
in_thread(name: :growl) do ### GROWL ###
growl_trigger = [9, 13, 21, 69, 73]
ch = [chord(:c5, :minor7), chord(:f5, :add9), false].ring
ch_i = 0
with_fx :level, amp: 0.565 do
with_fx :reverb, room: 0.9, damp: 0.1 do
loop do
sync :beat
if growl_trigger.include?(@circle)
s = synth :prophet, note: :c2, note_slide: 0.25, attack: 0.3, sustain: 5, release: 5, cutoff: 70, cutoff_slide: 2.5,
amp: 0.7, amp_slide: 0.3, pan: 0, pan_slide: 0.1, res: 0.6, res_slide: 1
sleep 1.80
# atmosphere ----------
use_synth :dark_ambience
play_chord ch[ch_i], amp: 2, sustain: 2.5, attack: 2, release: 10 if ch[ch_i]
ch_i += 1
# ---------------------
with_fx :compressor, treshold: 0.7, slope_above: 1, slope_below: 0.5 do
control s, note: :c5, pan: -0.9, cutoff: 125, res: 0.9, amp: 0.7
sleep 0.53
control s, note: :c2, pan: -0.9, cutoff: 130, res: 0.9, amp: 1
sleep 0.52
control s, note: :ds5, pan: 0.9, cutoff: 100, res: 0.6, amp: 0.7
sleep 0.56
control s, note: :fs3, pan: 0.9, cutoff: 130, res: 0.8, amp: 1
sleep 0.25
control s, note: :c3, pan: -0.3, cutoff: 115, res: 0.7, amp: 0.8
sleep 1
control s, note: :c3, pan: 0, cutoff: 60, res: 0.3
end
end
end
end
end
end
in_thread(name: :woop) do ### WOOP ###
loop do
sync :beat
if [5, 15, 74].include?(@circle)
with_fx :compressor, slope_below: 1.2 do
with_fx :slicer do
with_fx :band_eq, freq: 100, db: -7, db_slide: 5 do |e|
control e, db: 10
with_fx :reverb, room:0, room_slide: 5, mix: 0.2, mix_slide: 5 do |r|
control r, room: 1, mix: 0.9
u = synth :tb303, note: :g2, note_slide: 9, sustain: 6, release: 8, cutoff: 33, cutoff_slide: 7,
amp: 0.15, amp_slide: 7, pan: 1, pan_slide: 10, res: 0.1, wave: 1, pulse_width: 0.125
control u, note: :f1, cutoff: 110, amp: 0.2, pan: -1
end
end
end
end
elsif [2, 10, 70,].include?(@circle)
with_fx :compressor, slope_below: 1.4 do
with_fx :slicer do
with_fx :level, amp: 0, amp_slide: 2 do |a|
control a, amp: 1
with_fx :reverb, room:0, room_slide: 2, mix: 0.1, mix_slide: 5 do |r|
control r, room: 1, mix: 0.9
w = synth :dsaw, note: :c1, note_slide: 2, amp: 0, amp_slide: 7, attack: 0, decay: 0, env_curve: 3,
detune: 12, sustain: 4, release: 7, cutoff: 0, cutoff_slide: 7, cutoff_slide_shape: 4, res: 0.99,
pan: 1, pan_slide: 9
control w, note: :c2, cutoff: 130, amp: 0.4, pan: -1
u = synth :tb303, note: :c2, release: 10, cutoff: 33, cutoff_slide: 5, cutoff_attack: 12, amp: 0,
amp_slide: 10, pan: 1, pan_slide: 9
control u, cutoff: 130, amp: 0.4, pan: -1
end
end
end
end
end
end
end
in_thread(name: :woopAddon) do ### WOOP ADDON ###
use_random_seed 1
p = [(chord :c2, :minor7, num_octaves: 3), (chord :c3, :minor7, num_octaves: 3)].ring
pi = 0
s = [9, 9, 9, 3].ring
v = [0.3, 0.3, 0.3, 0.3].ring
with_fx :echo, max_phase: 2, phase: 1, decay: 4, mix: 0.3 do
with_fx :reverb, room: 0.7, damp: 0.1 do
use_synth :dsaw
loop do
sync :beat
if [2, 5, 10, 15, 70, 74].include?(@circle) # the same as above
sleep s[pi]
with_fx :reverb, room: 0.7 do
with_fx :level, amp: 0, amp_slide: 3 do |a|
control a, amp: 0.6
with_fx :pan, pan: -1, pan_slide: 3 do |pn|
control pn, pan: 1
play_pattern_timed p[pi], [0.25], amp: v[pi], release: 0.3, res: 0.7, cutoff: 110
pi += 1
end
end
end
end
end
end
end
end
in_thread(name: :chorusAddon) do ### CHORUS ADDON ###
use_random_seed 1
p = [(chord :g2, 'm7+5', num_octaves: 3)].ring
pi = 0
v = [0.3, 0.3, 0.3, 0.3].ring
with_fx :echo, max_phase: 2, phase: 1, decay: 4, mix: 0.3 do
with_fx :reverb, room: 0.7, damp: 0.1 do
use_synth :dsaw
loop do
sync :beat
if [44, 48, 96, 100, 136, 140].include?(@circle) # the same as above
with_fx :reverb, room: 0.7 do
with_fx :level, amp: 0, amp_slide: 3 do |a|
control a, amp: 0.6
with_fx :pan, pan: -1, pan_slide: 3 do |pn|
control pn, pan: 1
play_pattern_timed p[pi], [0.25], amp: v[pi], release: 0.3, res: 0.7, cutoff: 110
pi += 1
end
end
end
end
end
end
end
end
in_thread(name: :beat1) do ### BEAT1 ###
s = [0, #start
0, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, # part 2
0, 0, 0, 2, 0, 0, 1, 2,
0, 0, 0, 0, # bridge
0, 0, 0, 0, # chorus
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 2, 1, 2, 1, 2, # part 2
1, 2, 1, 2, 1, 1, 2, 2,
0, 0, 0, 0, # bridge
0, 0, 0, 0, # chorus
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, # solo
0, 0, 0, 0, # chorus
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0, # the end
]
with_fx :rhpf, mix: 0.5, cutoff: 66 do
with_fx :echo, decay: 0.5, mix: 0.5 do
i = 1
loop do
# sync :beat1
if @circle < 145
tick
sample @samples_dir, "Tonic_BD_A_T1A_V2", amp: 0.8, rate: 0.75, hpf: 50, pan: -0.5 if (spread 4, 11).look and s[@circle] == 1
sample @samples_dir, "Tonic_BD_A_T1A_V2", amp: 0.25, rate: 2.75, lpf: 120 if (spread 7, 16).look and s[@circle] == 2
sample @samples_dir, "2_D#1_Hat_SP", amp: Math.sin((i += 4) * (Math::PI / 180)) * 0.08, rate: 2, pan: 0.5 if (spread 11, 24).look and s[@circle] != 0
sleep 0.25
end
end
end
end
end
in_thread(name: :beatSamples) do
with_fx :reverb, room: 0.3 do
with_fx :echo, phase: 0.5, mix: 0.2 do
with_fx :band_eq, freq: 140, db: -10 do
loop do
sync :beat
sample @samples_dir, "120_Breaking_the_Beat_SP", amp: 0.73, lpf: 90 if [64].include?(@circle)
sample @samples_dir, "120_Breaking_the_Beat_SP", amp: 0.73, lpf: 90, release: 0.5 if [66].include?(@circle) # fade
end
end
end
end
end
in_thread(name: :xxx) do ### XXX ###
xc = {f3a9: [(chord :f3, :add9), 6, 0.14, :f3], d3a9: [(chord :d3, :add9), 4, 0.15, :d3],
c3min: [(chord :c3, :minor), 6, 0.125, :d3], a3maj: [(chord :a3, :major), 7, 0.125, :a3]}
x_circle = [0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #16
xc[:f3a9], xc[:d3a9], xc[:c3min], xc[:a3maj], xc[:f3a9], xc[:d3a9], xc[:c3min], xc[:a3maj], #8
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, #0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #16
xc[:f3a9], xc[:d3a9], xc[:c3min], xc[:a3maj], xc[:f3a9], xc[:d3a9], xc[:c3min], xc[:a3maj], #8
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
with_fx :reverb, room: 0.8, damp: 0.2 do
loop do
sync :beat
if x_circle[@circle] != 0
ppn = -0.25
ppn = 0.25 if @circle % 2 == 0
use_synth :prophet
with_fx :echo, decay: 3 do
play_chord x_circle[@circle][0], cutoff: 80, amp: 0.05, release: 5, res: 0.5
end
use_synth :tb303
with_fx :echo, decay: 5, phase: 0.25 do
x_circle[@circle][1].times do
with_fx :pan, pan: ppn do
play_chord x_circle[@circle][0], cutoff: 99, amp: x_circle[@circle][2] + 0.01, release: 0.3
end
end
end
end
end
end
# end
end
in_thread(name: :chorus) do ### CHORUS ###
rf = [[:f5, 0.25], [:e5, 0.5], [:ds5, 0.5], [:c5, 0.75], [:gs4, 1], [:f4, 1],
[:f5, 0.25], [:e5, 0.5], [:ds5, 0.5], [:c5, 0.75], [:gs4, 1], [:f4, 1],
[:g4, 0.25], [:as4, 0.5], [:ds5, 0.5], [:d5, 0.25], [:as4, 0.5], [:f4, 0.5], [:ds5, 0.5], [:f5, 1],
[:g4, 0.25], [:as4, 0.5], [:ds5, 0.5], [:d5, 0.25], [:as4, 0.5], [:f4, 0.5], [:ds5, 0.5], [:f5, 1]].ring
trigger = [29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141]
with_fx :reverb, room: 1 do
with_fx :echo, mix: 0.4 do
with_fx :band_eq, freq: 110, db: 7 do
loop do
sync :beat
if trigger.include?(@circle)
# puts ">>>>>>>> CHORUS <<<<<<<<<<<"
28.times do
tick
use_synth :fm
play rf[look][0], release: 0.3, amp: 0.2
sleep rf[look][1]
end
end
end
end
end
end
end
in_thread(name: :chorus_lead1) do
x1 = [[:r, 192], [:c4, 6, -1], [:ds4, 6, -0.7], [:c4, 6, -0.3], [:as4, 6, 0.3], [:g4, 4, 0.7], [:ds4, 36, 1],
[:c4, 6, -1], [:ds4, 6, -0.7], [:c4, 6, -0.3], [:as4, 6, 0.3], [:g4, 4, 0.7], [:ds4, 36, 1],
[:c4, 6, -1], [:ds4, 6, -0.7], [:c4, 6, -0.3], [:as4, 6, 0.3], [:g4, 4, 0.7], [:ds4, 36, 1]]
loop do
sync :beat
with_fx :flanger, depth: 10, phase: 8 do
with_fx :reverb, room: 0.9, damp: 0.1 do
if [29, 81, 121].include?(@circle)
19.times do |i|
use_synth :dpulse
ppp = (i.to_f - 10) / 10
play x1[i][0], attack: 0.01, amp: 0.11, release: 4, cutoff: 90, detune: 0.1, pan: x1[i][2]
sleep x1[i][1] * 0.25
end
end
end
end
end
end
in_thread(name: :chorus_lead2) do
myPan = -1
x2 = [[:r, 160], [:f4, 6], [:d4, 6], [:as3, 6], [:r, 6], [:r, 4], [:r, 36],
[:f4, 6], [:d4, 6], [:as3, 6], [:r, 6], [:r, 4], [:r, 36],
[:f4, 6], [:d4, 6], [:as3, 6], [:r, 6], [:r, 4], [:r, 36],
[:f4, 6], [:d4, 6], [:as3, 6]]
loop do
sync :beat
if [29, 81, 121].include?(@circle)
with_fx :reverb, room: 0.9, damp: 0.1 do
with_fx :hpf, cutoff: 85 do
22.times do |i|
myPan *= -1
use_synth :dtri
play x2[i][0], attack: 0.2, amp: 0.37, release: 3, cutoff: 120, detune: 12, pan: myPan
sleep x2[i][1] * 0.25
end
end
end
end
end
end
in_thread(name: :chorusbg) do
ch = [0, #start
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # normal
0, 0, 0, 0, 0, 0, 0, 0, # faster
0, 0, 0, 0, # bridge
0, 0, 0, 0, # chorus
0, 0, 0, 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0, # the fastest
(chord :f3, :major), 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # normal
0, 0, 0, 0, 0, 0, 0, 0, # faster
0, 0, 0, 0, # bridge
0, 0, 0, 0, # chorus
0, 0, 0, 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0, # the fastest
(chord :f3, :major), 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # solo
0, 0, 0, 0, # chorus
0, 0, 0, 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0,
(chord :f3, :major), 0, (chord :g3, 'm7+5'), 0, # the fastest
(chord :f3, :major), 0, 0, 0
]
use_synth :dsaw
loop do
sync :beat
play ch[@circle], attack: 1, sustain: 4, release: 7, amp: 0.170, cutoff: 92 unless ch[@circle] == 0
end
end
# GUITAR ----------------------------------------
in_thread do
a = [
(chord :f4, :add9), (chord :g4, :major), (chord :f4, :add9), (chord :f5, :add9),
(chord :c5, :minor),
(chord :gs5, :major), (chord :ds5, :major), (chord :c5, :major), (chord :cs5, :major), (chord :f5, :add9),
(chord :bb4, :add9), (chord :c5, :major),
(chord :f4, :add9), (chord :f4, :add9), (chord :g4, :major), (chord :f4, :add9), (chord :f5, :add9),
(chord :c5, :minor),
(chord :gs5, :major), (chord :ds5, :major), (chord :c5, :major), (chord :f5, :add9),
(chord :c5, :major), (chord :c5, :major), (chord :c6, :major)
]
s = [
1.5, 0.5, 5.5, 0.5,
8,
0.75, 0.75, 0.5, 5.5, 0.5,
4, 4,
0.75, 0.75, 0.5, 5.5, 0.5, # part 2
8,
0.75, 0.75, 0.5, 6,
2, 2, 4
]
r = [
2, 1, 8, 3,
8,
4, 2, 1, 6, 1,
8, 4,
0.5, 1, 1, 8, 1, # part 2
8,
4, 2, 1, 6,
2, 4, 2
]
loop do
sync :beat
with_fx :hpf, cutoff: 85 do
with_fx :echo, phase: 2, max_phase: 4, decay: 4, mix: 0.4 do
with_fx :lpf, pre_amp: 0.55 do
with_fx :tanh, krunch: 1 do
with_fx :reverb, room: 0.85 do
with_fx :flanger do
with_fx :compressor, slope_above: 1, slope_below: 2 do
use_synth :beep
if @circle == 105
a.length.times do |x|
play a[x], release: r[x], amp: 0.95
sleep s[x]
end
end
end
end
end
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment