Skip to content

Instantly share code, notes, and snippets.

@kniknoo
Created January 10, 2017 03:22
Show Gist options
  • Save kniknoo/5e18275736736083cb49d1d2c753930a to your computer and use it in GitHub Desktop.
Save kniknoo/5e18275736736083cb49d1d2c753930a to your computer and use it in GitHub Desktop.
Penguin Acid for Sonic Pi
#Penguin Acid
#Coded by KniKnoo
use_bpm 75
use_debug false
rndmst = 987
define :drumroll do |div|
vol = 0.9
with_fx :echo, phase: [0.06125, 0.125, 0.25, 0.375, 0.5, 0.75, 1].choose, decay: 1.5, mix: 0.25 do
div.times do
f_div = 1.0 / div
sample :sn_dolf, sustain: 0, release: f_div / 2 , amp: vol, rate: rrand(0.9, 1.1)
vol -= 0.1 * rrand(0.7, 0.9)
sleep f_div / 8
end
end
end
with_fx :echo, phase: 0.75, mix: 0.25, amp: 0.6, decay: 4 do
live_loop :bass do
use_synth :tb303
sync :ki2 unless one_in(3)
sync :ki
rndloc = rndmst
with_fx :ixi_techno, phase: rrand(0.5, 2), cutoff_min: 80, cutoff_max: 120, res: 0.6 do
4.times do
use_random_seed rndmst
rdec = rrand(0.04, 0.08)
rcut = rrand(100, 127)
[ 3,4, 5].choose.times do
use_synth_defaults release: 0.04, decay: rdec , cutoff: rcut, cutoff_attack_level: rrand(0.5, 1),
cutoff_decay: rdec, cutoff_sustain_level: 0.3, sustain_level: 0.4,
res: rrand(0.85, 0.95), wave: 1, amp: rrand(0.8, 0.9)
mynote = (chord_degree, (ring, 2, 1, 1, 2, 4,5 , 5, 4).tick, :f0, :iwato).choose
mynote += 12 if rand > 0.7
with_fx :bitcrusher, mix: 0.4, bits: [ 4,8].choose, sample_rate: rrand_i(8000, 22000) do
play mynote
sleep 0.125
end
end
end
sleep 4
end
end
end
with_fx :flanger do
live_loop :lead do
rndmst = rrand(1, 100000)
sync :ki
4.times do
mydeg = (ring, 1, 4, 5, 2, 6, 4, 5,4).tick
nolen = [0.25, 0.5, 1].choose
synth :prophet, note: (degree mydeg, :f4, :iwato), release: 0.49, amp: 0.6
synth :blade, note: (degree mydeg, :f3, :iwato), release: nolen, amp: 0.7, cutoff: rrand(90, 120),
vibrato_depth: 0.25, vibrato_rate: 8, vibrato_delay: 0, vibrato_depth_slide: 0.5, vibrato_rate_slide: 0.5
cue :le
sleep 0.5
control vibrato_depth: 3, vibrato_rate: 2
sleep nolen -0.5
end
sleep 2
sync :ki
with_fx :echo, phase: 0.5, mix: 0.8, amp: 0.5, decay: 6 do
with_fx :bitcrusher, bits: 8, sample_rate: 5588, mix: 0.6, amp: 0.5 do
with_fx :slicer, phase: 0.06125, wave: 2 do
mydegr = (ring, 2, 4, 4, 2, 2, 4)
synth :dpulse, note: (degree mydegr.tick(:ml), [ :f3, :f4].choose, :iwato), attack: 1, release: 6, amp: 0.6,
note_slide: 1, pulse_width: 0.5, pulse_width_slide: 0.5, decay: 0.5, detune: 0.01, detune_slide: 1, amp_slide: 0.25
sleep [0.5, 1].choose
tick(:ml)
control note: (degree mydegr.look(:ml), [ :f3, :f4, :f5].choose, :iwato), amp: 0.3, pulse_width: rrand(0.1, 0.95), detune: 1 if rand > 0.1
sleep [0.5, 1].choose
tick(:ml)
control note: (degree mydegr.look(:ml), [:f2, :f3, :f4].choose, :iwato), amp: 0.2, pulse_width: rrand(0.1, 0.95), detune: 12 if rand > 0.5
sleep [0.5, 1].choose
tick(:ml)
control note: (degree mydegr.look(:ml), [ :f3, :f4, :f5].choose, :iwato), amp: 0.4, pulse_width: rrand(0.1, 0.95), detune: 0.5
sleep 2
end
end
end
sleep 2
end
end
with_fx :bitcrusher, bits: 6, sample_rate: 4000, mix: 0.6 do
live_loop :drums do
tick_reset
sample :bd_zum
cue (ring, :ki, :ki2).tick(:dl)
sleep [ 0.5, 0.75, 1].choose
sample :sn_dolf, sustain: 0.3
cue :sn
sleep [0.25, 0.25, 0.5].choose
sample :sn_dolf, sustain: 0.1, amp: 0.3 if rand > 0.6
sleep [ 0.25, 0.5, 0.75].choose
tick_reset
sample :bd_zum
sleep [ 0.5, 0.75].choose
if rand > 0.3
sample :sn_dolf, sustain: 0.4
else
drumroll(rrand_i(2, 8))
end
cue :sn
sleep [0.25, 0.25, 0.5].choose
sample :sn_dolf, sustain: 0.1, amp: 0.3 if rand > 0.6
sleep [ 0.25, 0.5].choose
end
end
live_loop :hats do
sync :sn
[2, 3, 4, 5, 6].choose.times do
synth :chipnoise, sustain_level: 0.5, sustain: 0.005, freq_band: rrand_i(8, 15),
release: 0.005, pan: rrand(-0.5, 0.5), amo: 0.8 if rand > 0.1
sleep 0.125
with_fx :echo, phase: 0.375, mix: 0.5 do
synth :chipnoise, sustain_level: 0.3, sustain: 0.04, decay: 0.03,
freq_band: rrand_i(7, 10), release: 0.03, pan: rrand(-0.5, 0.5) if rand > 0.8
synth :chipnoise, sustain_level: 0.5, sustain: 0.007, freq_band: rrand_i(12, 15),
release: 0.01, amp: 0.7, pan: rrand(-0.5, 0.5) if rand > 0.4
end
sleep 0.125
end
end
live_loop :hats2 do
sync :ki2
sync :ki
amp_ofs = 0
(range 3, 12).choose.times do
with_fx :echo, phase: rrand(0.005, 0.02), decay: 0.2, mix: 0.8, amp: 0.8 do
synth :chipnoise, sustain_level: 1, sustain: 0, freq_band: 13,
release: 0.01, amp: (ring, 0.7, 0.5).tick - amp_ofs, pan: rrand(-0.25, 0.25) if rand > 0.1
sleep 0.125
end
amp_ofs += 0.025
end
end
with_fx :distortion, distort: 0.7, amp: 0.9 do
live_loop :hats3 do
sync :ki2
4.times do
use_sample_defaults pan: rrand(-1, 1)
nlen = [0.06125, 0.125].choose
s_time = rand(0.80)
4.times do
sample :ambi_lunar_land, start: s_time, release: 0.03, sustain: 0, hpf: 70 if rand > 0.1
sleep nlen
end
end
end
end
with_fx :hpf, cutoff: 80, res: 0.4 do
with_fx :reverb, room: 0.9, mix: 0.7, amp: 0.8, damp: 0.8 do
live_loop :chords do
use_synth_defaults cutoff: 90, detune: rrand(0.05, 0.1), attack: 0.06, decay: 0.06, sustain_level: 0.4,
amp: 0.8, res: 0.4
sync :le
mydeg = (ring, 1, 4, 5, 2, 6, 4, 5,4).tick
synth :dpulse, note: (degree mydeg, :f4, :iwato) , release: 0.5, pan: -0.75
synth :dsaw, note: (degree ((mydeg+4)%7)+1 , :f4, :iwato), release: 0.5, pan: 0.75
sleep 0.001
end
end
end
with_fx :reverb, room: 0.9, mix: 0.5 do
live_loop :bell do
use_synth_defaults attack: 0.125
sync :ki2
sync :ki
sync :ki2
3.times do
nlen = [ 0.25,0.5, 1].choose
3.times do
synth :pluck, note: (scale :f4, :iwato, num_octaves: 2).choose, release: nlen + 1, pluck_decay: 80, coef: rrand(0.001, 0.4), amp: 1.2, pan: rrand(-1, 1) if rand > 0.1
sleep nlen
end
end
sleep 2
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment