Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Minimal implementation of Passersby synth engine on norns.
-- Hello Passersby
-- 1.1.1 @markeats
--
-- Passersby demo script.
--
local Passersby = require "passersby/lib/passersby_engine"
local MusicUtil = require "musicutil"
engine.name = "Passersby"
local note_num
local count = 1
function init()
Passersby.add_params()
local note_metro = metro.init()
note_metro.event = function()
if count % 2 == 0 then
-- Note off
engine.noteOff(note_num)
else
-- Note on
note_num = math.random(45, 69)
engine.noteOn(note_num, MusicUtil.note_num_to_freq(note_num), 1) -- noteOn requires: id, frequency (hz), velocity (0-1)
end
count = (count + 1 - 1) % 2 + 1
end
note_metro:start(0.25)
redraw()
end
function redraw()
screen.clear()
screen.aa(1)
screen.level(15)
screen.move(5, 10)
screen.text("Hello Passersby")
screen.update()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.