Skip to content

Instantly share code, notes, and snippets.

@mbutz
Created November 9, 2021 17:39
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 mbutz/3139954d69013a6669796f951f83f093 to your computer and use it in GitHub Desktop.
Save mbutz/3139954d69013a6669796f951f83f093 to your computer and use it in GitHub Desktop.
Chromero (Sonic Pi)
# Chromero
#
# filename: chromero.rb
# carla: chromero.carpx
use_bpm 60
live_loop :bar do
sleep 4
end
live_loop :kick, sync: :bar do
stop
at (ring 0, 1, 2, 3) do
with_fx :sound_out_stereo, output: 3 do
sample kick, 3, amp: 1
end
end
sleep 4
end
live_loop :glitch, sync: :bar do
#stop
with_fx :sound_out_stereo, output: 9 do
sample atmos, 1, attack: 0.025, release: 0.025, amp: (ring 0.5, 0.75, 0.5).choose, norm: 0, num_slices: 512, slice: (ring 200, 0, 5, 30).choose, rate: (ring 1, 2, 0.5).choose
sleep (ring 0.25, 0.5, 0.75, 1).choose
end
end
live_loop :hihat_base, sync: :bar do
#stop
sleep 0.25
with_fx :sound_out_stereo, output: 3 do
with_synth :cnoise do
with_synth_defaults release: 0.0375, amp: 0.75, pan: (ring 0.25, 0).tick do
with_fx :rhpf, cutoff: 115, res: 0.75 do
play :c
end
end
end
end
sleep 0.25
end
live_loop :hihat, sync: :bar do
stop
with_fx :sound_out_stereo, output: 3 do
at (ring 1, 3) do # double time
sample hihats, 2, beat_stretch: 2, amp: 0.5
end
at (ring 0, 2) do # slow, reverse
with_fx :slicer, phase: (ring 0.75, 1.25).choose, smooth: 0.5 do
with_fx :slicer, phase: 0.125 do
with_fx :rhpf, cutoff: 95, res: 0.85 do
#sample hihats, 2, attack: 1, release: 2, rate: (ring -0.25, 0.5, 0.75).choose, amp: 0.5
end
end
end
end
end
sleep 4
end
live_loop :beat, sync: :bar do
#stop
f = (line 130, 13, steps: 70).ramp
#f = (ring 13)
#tick_reset
with_fx :sound_out_stereo, output: 3 do
with_fx :hpf, cutoff: f.tick do | hpf |
control hpf, cutoff: f.tick, cutoff_slide: 4
sample beats, "chrom", beat_stretch: 4, amp: 1.25
end
end
sleep 4
end
live_loop :bass, sync: :bar do
#stop
use_synth :fm
use_synth_defaults depth: 2, divisor: 2, cutoff: 50, release: 0.125, amp: 1.75
ptn =
(ring :r, :r, :r, :r, :r, :r, :r, :r, :r, :g2, :bf2, :r, :c3, :r, :bf2, :c3) +
(ring :r, :r, :r, :r, :r, :r, :r, :r, :r, :r, :r, :r, :r, :r, :r, :r)
with_fx :sound_out_stereo, output: 3 do
play ptn.tick
end
sleep 0.125
end
live_loop :guitar, sync: :bar do
#stop
with_fx :sound_out_stereo, output: 7 do
with_fx :panslicer, phase: 0.5, pan_max: 0.25, pan_min: -0.25 do
with_fx :hpf, cutoff: 50 do
with_fx :slicer, phase: 1.25, smooth: 0.5, mix: 0.5 do
with_fx :slicer, phase: (ring 0.25, 0.75).choose, smooth: 0.25, mix: 0.5 do
with_fx :bitcrusher, mix: 0.85, bits: 8, sample_rate: 8000, amp: 0.5 do
in_thread do
#sample atmos, 2, attack: 3, release: 3, beat_stretch: 32, amp: 0.5 # middle range
sleep (ring 4, 8).choose
end
sample atmos, 2, attack: 3, release: 3, beat_stretch: 96, amp: 0.5 # bass range
end
end
end
end
end
end
sleep 8
end
live_loop :shortwave, sync: :bar do
stop
with_fx :sound_out_stereo, output: 7 do
#sample samples + "shortwave", "okno", attack: 1, release: 1, amp: 0.75, hpf: 70, rate: 1
#sleep 4
sample samples + "shortwave", "beep", attack: 1, release: 1, amp: 0.5, hpf: 70, rate: 0.75
end
sleep 8
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment