Created
January 13, 2017 02:37
Star
You must be signed in to star a gist
Random Piano No. 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# randPiano-no.2.txt | |
# sonic(K) December 5, 2015 | |
use_debug false | |
use_bpm 88 | |
live_loop :pianoHigh do | |
a = 24.times.map{ rand(36..100) } | |
puts "#{a}" | |
with_synth :piano do | |
play_pattern_timed a, [0.25, 0.125].choose, stereo_width: 0.5 | |
end | |
end | |
live_loop :pianoLow, delay: 4 do | |
b = 6.times.map{ rand(15..36) } | |
puts "b: #{b}" | |
with_synth :piano do | |
play_pattern_timed b, [0.5, 0.75], release: 0.1, stereo_width: 0.5 | |
end | |
end | |
live_loop :interjections, delay: 48 do | |
c = 6.times.map{ rand(65..85) } | |
puts "c: #{c}" | |
if one_in(2) | |
with_synth :mod_fm do | |
play c[2], amp: 0.5, attack: 0.4, mod_phase: rand(0.125..0.25), depth: 2, pan: [-1, 0, 1].choose | |
sample [:elec_cymbal, :drum_cymbal_soft, :drum_splash_soft ].choose, amp: 0.75, pan: [-1, 0, 1].choose | |
sleep [1, 2, 4, 8].choose | |
end | |
else | |
with_synth :dsaw do | |
play c[3, 5].choose, amp: 0.7, attack: rand(0..0.5), detune: 0.5, cutoff: rand(75..95), pan: [-1, 0, 1].choose | |
sample [:elec_cymbal, :drum_cymbal_soft, :drum_splash_soft ].choose, amp: 0.75, pan: [-1, 0, 1].choose | |
sleep [1, 2, 4, 8].choose | |
end | |
end | |
end | |
live_loop :bassDrum, delay: 24 do | |
sample :bd_ada, rate: rand(1..1.1) | |
sleep [0.5, 1, 2, 4, 8].choose | |
end | |
live_loop :snare, delay: 36 do | |
sample [:drum_snare_hard, :drum_snare_soft].choose, rate: rand(1..1.5), pan: rand(-0.1..0.1) | |
sleep [0.25, 0.5, 1, 2, 4, 8].choose | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code for "Random Piano No.2" by sonic(K). Audio is here https://soundcloud.com/freemoth/random-piano-no2.