-- An example script for norns-etc -- Load this file in emacs and M-x compile to upload. local MusicUtil = require "musicutil" engine.name = "PolyPerc" function redraw() screen.clear() screen.move(64, 32) screen.text_center("norns example #" .. math.floor(math.random() * 1000)) screen.update() end function init() redraw() -- random note output, just to emphasize the point local note = math.random(60, 90) engine.hz(MusicUtil.note_num_to_freq(note)) local m = midi.connect(2) local c = metro.init() c.time = 0.5 c.event = function () c:stop() metro.free(c.id) m:note_off(note, 10) end m:note_on(note, 20) c:start() end -- This needs to be at the end so that it doesn't conflict with the -- norns convention of having a script description in comments on the -- first couple of lines. -- Local Variables: -- compile-command: "make upload" -- End: