Created
September 29, 2020 20:21
-
-
Save datramt/44630846112284a992da242a25ba320c to your computer and use it in GitHub Desktop.
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
#################################################################### | |
######################## CODE SECTION 1 ############################ | |
#################################################################### | |
# where we define all of our musical patterns | |
# drum patterns | |
hhpat1 = (bools 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1) | |
snpat1 = (bools 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0) | |
bdpat1 = (bools 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0) | |
hhpat2 = (bools 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1) | |
snpat2 = (bools 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0) | |
bdpat2 = (bools 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0) | |
# melodic patterns | |
use_random_seed 1234 | |
mel1 = ((scale :a5, :minor).repeat(4)+(knit :r, 32)).shuffle.take(32) | |
use_random_seed 551516 | |
mel2 = ((scale :a5, :minor).repeat(4)+(knit :r, 32)).shuffle.take(16) | |
# chord patterns | |
cpat1 = (ring 1, 1, 2, 5) | |
cpat2 = (ring 1, 6, 3, 2) | |
# bass patterns | |
use_random_seed 5665 | |
bas1 = ((chord :a2, :m9).repeat(2)+(knit :r, 6)).shuffle.take(16) | |
use_random_seed 111110 | |
bas2 = ((chord :a2, :m7).repeat(2)+(knit :r, 6)).shuffle.take(8) | |
#################################################################### | |
######################## CODE SECTION 2 ############################ | |
#################################################################### | |
# where we define our instrument players | |
# drum players | |
define :drmA do | |
in_thread do | |
64.times do | |
sample :drum_cymbal_closed, sustain: 0, release: 0.01 if hhpat1.tick | |
sample :elec_blip2 if snpat1.look | |
sample :bd_808, rate: 2 if bdpat1.look | |
sleep 0.125 | |
end | |
end | |
end | |
define :drmB do | |
in_thread do | |
64.times do | |
sample :drum_cowbell, sustain: 0, release: 0.01 if hhpat2.tick | |
sample :elec_blip2, rate: 2 if snpat2.look | |
sample :bd_808 if bdpat2.look | |
sleep 0.125 | |
end | |
end | |
end | |
# melody players | |
define :melA do | |
in_thread do | |
use_synth :fm | |
64.times do | |
play mel1.tick, amp: 0.5 | |
sleep 0.125 | |
end | |
end | |
end | |
define :melB do | |
in_thread do | |
use_synth :dtri | |
64.times do | |
play mel2.tick, release: 0.2, amp: 0.2 | |
sleep 0.125 | |
end | |
end | |
end | |
# chord players | |
define :crdA do | |
in_thread do | |
use_synth :dtri | |
8.times do | |
play_chord (chord_degree cpat2.tick, :a, :minor, 4, invert: 1), amp: 0.4, release: 0.6 | |
sleep 1 | |
end | |
end | |
end | |
define :crdB do | |
in_thread do | |
use_synth :fm | |
8.times do | |
play_chord (chord_degree cpat1.tick, :a, :minor, 4, invert: 1), amp: 0.6, release: 0.5 | |
sleep 1 | |
end | |
end | |
end | |
# bass players | |
define :basA do | |
in_thread do | |
use_synth :fm | |
16.times do | |
play bas1.tick, amp: 0.6 | |
sleep 0.5 | |
end | |
end | |
end | |
define :basB do | |
in_thread do | |
use_synth :fm | |
16.times do | |
play bas2.tick, amp: 0.3 | |
sleep 0.5 | |
end | |
end | |
end | |
#################################################################### | |
######################## CODE SECTION 3 ############################ | |
#################################################################### | |
# where we define our track's form | |
live_loop :drum_structure do | |
tick | |
drmA if (bools 1, 0, 1, 0, 1, 0, 1, 0).look | |
drmB if (bools 0, 1, 0, 1, 0, 1, 0, 1).look | |
melA if (bools 0, 0, 1, 0, 0, 0, 1, 0).look | |
melB if (bools 0, 0, 0, 1, 0, 0, 0, 1).look | |
crdA if (bools 1, 0, 1, 0, 1, 0, 1, 0).look | |
crdB if (bools 0, 1, 0, 1, 0, 1, 0, 1).look | |
basA if (bools 0, 0, 0, 0, 1, 0, 1, 0).look | |
basB if (bools 0, 0, 0, 0, 0, 1, 0, 1).look | |
sleep 8 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment