Skip to content

Instantly share code, notes, and snippets.

@dndrks
Last active December 29, 2021 16:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dndrks/55837d6e714caad289853b1c26bce547 to your computer and use it in GitHub Desktop.
Save dndrks/55837d6e714caad289853b1c26bce547 to your computer and use it in GitHub Desktop.
fc210904
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)
@dndrks
Copy link
Author

dndrks commented Sep 7, 2021

a firefly plots her escape from night.
she's been obsessed with the sun
    since she was young
    and heard the myth of its light.

and i am not above it either
   i assure you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment