Skip to content

Instantly share code, notes, and snippets.

@jlmitch5

jlmitch5/tonight.lua

Last active Apr 25, 2020
Embed
What would you like to do?
tonight for monome crow: a wandering and loose(/lost?) arpeggiator for mangrove
--- tonight is a wandering and loose(/lost?) arpeggiator for mangrove
-- output 1 goes to mangrove's formant attenuated to taste (constant wave mode)
-- output 2 goes to mangrove' pitch
-- mangrove's out to delay and reverb for maximum vibes
seq = { 0, 4, 5, 7, 9 }
step = 1
switch = 1
a = math.random(1,10)
b = math.random(1,10)
c = math.random(1,10)
level = 5
time = 1.3
function init()
output[1]( loop { foo
, to(function() return level/a end, function() return time/b end)
, foo
, to(function() return -level/c end, function() return time/a end)
, foo
, to(function() return level/b end, function() return time/c end)
, foo
, to(function() return -level/a end, function() return time/b end)
} )
end
function foo()
output[2].volts = seq[step]/12
output[2].slew = math.random(0,2)/100
step = ((step + math.random(0, 1)) % #seq) + 1
if step == 1 then
switch = (switch + 1) % 2
if switch == 1 then
a = math.random(1,10)
b = math.random(1,10)
c = math.random(1,10)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment