Skip to content

Instantly share code, notes, and snippets.

@tehn
Created September 4, 2021 18:36
Show Gist options
  • Save tehn/bae0fa35b902f63386383f0bd5320e37 to your computer and use it in GitHub Desktop.
Save tehn/bae0fa35b902f63386383f0bd5320e37 to your computer and use it in GitHub Desktop.
manyportals-236pm
s = require 'sequins'
m = midi.connect(1)
function init()
params:add_number("filter","filter",0,127,64)
params:set_action("filter", function(x) jp("vcf_f",x) end)
end
jmap = {
lfo_rate = 0,
lfo_delay = 1,
dco_lfo = 2,
dco_pwn = 3,
dco_noise = 4,
vcf_f = 5,
vcf_r = 6,
vcf_env = 7,
vcf_lfo = 8,
vcf_kbd = 9,
vca = 0xA,
a = 0xB,
d = 0xC,
s = 0xD,
r = 0xD,
sub = 0xF
}
function no(n,t)
m:note_on(n,127)
clock.run(noff,n,t)
end
function noff(n,t)
clock.sleep(t)
m:note_off(n)
end
--m.event = function(data) tab.print(data) end
function jp(p,x)
m:send{0xf0}
m:send{0x41}
m:send{0x32}
m:send{0x0}
m:send{jmap[p]}
m:send{x}
m:send{0xf7}
end
function panic() for i=0,127 do m:note_off(i) end end
a = s{0,5,3,8,s{15,19},12,s{24,29,8}}
a = s{0,3,8,5,12,15,s{19,24,31}}
a = s{0,3,8,5,12,24,s{19,24,31}:every(2)}
b = s{0,0,0,12,0,7,0,0,s{7,12,24}}
e = s{45,50,55,60,65,70}
c = s{false,false,false, true, false, s{false,true}, true, s{false}:every(2)}
tra = 60
tra2 = 48
ti = 0.1
n = function()
while true do
jp("s",5)
jp("vcf_f",e())
no(tra+a()+b(),ti)
if c() then
no(tra2+a()+b(),ti)
jp("s",50)
jp("vcf_f",60)
clock.sync(2)
else
clock.sync(1/8)
end
end
end
ca = clock.run(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment