-
-
Save dndrks/55837d6e714caad289853b1c26bce547 to your computer and use it in GitHub Desktop.
fc210904
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
s = require 'sequins' | |
-- _live.mode = enabled -- this line is for cheat codes yellow only | |
_pads = { s{1,3,5,7,s{9,11,13,15}}, s{1,3,5,7,s{9,11,13,15}}, s{1,3,5,7,s{9,11,13,15}} } | |
_reps = { s{3,6,8,s{3,1,9,7}}, s{3,6,8,s{3,1,9,7}}, s{3,6,8,s{3,1,9,7}} } | |
_syncs = { s{1/3,1/4,1/6,1/8,1/2}, s{1/3,1/4,1/6,1/8,1/2}, s{1/3,1/4,1/6,1/8,1/2} } | |
_md = midi.connect(2) -- replace '2' with whatever midi port your device is on | |
_md_notes = { s{41,43,47}, s{41,43,47}, s{41,43,45} } | |
_md_probs = { s{30,100,54}, s{30,100,54}, s{30,100,54} } | |
clocks = {} | |
function _play(target,sync_val) | |
for i = 1, _reps[target]() do | |
local _p = _pads[target]() | |
clock.sync(sync_val) | |
grid_actions.pad_down(target,_p) | |
if math.random(100) < _md_probs[target]() then | |
_md:note_on(_md_notes[target]()) | |
end | |
clock.sleep(0.05) | |
grid_actions.pad_up(target,_p) | |
end | |
end | |
function _start(target) | |
clocks[target] = clock.run(_play,target,_syncs[target]()) | |
end | |
_start(1) | |
_start(2) | |
_start(3) |
Author
dndrks
commented
Sep 7, 2021
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment