Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexandreRangel/b34cc9b5ef93464352a1ebffd44a47cd to your computer and use it in GitHub Desktop.
Save AlexandreRangel/b34cc9b5ef93464352a1ebffd44a47cd to your computer and use it in GitHub Desktop.
Sonic Pi 2.10 music code
use_bpm 12
use_synth :mod_saw
128.times do
play scale([:F1,:Eb1,:F2,:Eb2].choose, [:minor,:major].choose).choose,
attack: ([0.5,1,2,4].choose) /[2.0,4.0].choose,
release: ([1,2,4,8,16,32].choose) /[2.0,4.0].choose,
mod_range: [0,1,2,4,6,8].choose,
mod_phase: [0.5,1,2,4,8].choose,
mod_phase_slide: [1,2,4,8].choose + rrand(-0.1,0.1),
mod_phase_offset: rrand(0,0.333),
mod_phase_offset_slide: [0.1,0.25,0.5,1,2,4,8].choose,
mod_pulse_width: [0.1,0.2,0.25,0.5,0.75,0.99].choose,
mod_pulse_width_slide: [0.5,1,2,4,8].choose,
mod_wave: [0,1,2,3].choose,
mod_invert_wave: [0,0,0,1].choose,
cutoff: ring(60,80,60,90,80,90,40,92).tick,
cutoff_slide: [0.25,0.5,1,2].choose,
pan: [rrand(-1,-0.7),rrand(0.7,1)].choose,
pan_slide: [0.1,0.2,0.25,0.5,1,2].choose,
amp: rrand(0.5,0.7),
amp_slide: [0.1,0.25,0.5,1,2].choose
sleep 0.25
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment