Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Zazcallabah/a0c67cf5a6c4427c3e4fbca817f1525b to your computer and use it in GitHub Desktop.
Save Zazcallabah/a0c67cf5a6c4427c3e4fbca817f1525b to your computer and use it in GitHub Desktop.
sendmidi norns shield
-- SendMidi
s = require 'sequins'
m = midi.connect()
m.event = function(data)
local d = midi.to_msg(data)
print("ch:" .. d.ch .. " cc:" .. d.cc .. " val:" .. d.val)
end
function init()
mults = s{ 0, 7, 2, 7, 0, 7, 2, 7, -2, 4, 1, 4, -2, 4, 1, 4 }
lastnote = 1
sequence = clock.run(
function()
on = false
while true do
clock.sync(1/2)
if on then
print("off")
m:note_off(lastnote ,0,1)
else
print("on")
lastnote = 64 + mults()
m:note_on(lastnote,64,1)
end
on = not on
end
end
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment