@@ -21,51 +21,46 @@
engine.name = 'TestSine'

-- init function
init = function()
function init()
-- print to command line
print("template!")
-- add log message
norns.log.post("hello!")
-- show engine commands available
engine.list_commands()
engine.list_commands()
-- set engine params
engine.hz(100)
engine.amp(0.125)
-- start timer
c:start()
-- clear grid, if it exists
if g then
g:all(0)
g:refresh()
end
-- screen: turn on anti-alias
screen.aa(1)
screen.line_width(1.0)
end

-- make a variable
t = 0
local t = 0
-- make an array for storing
numbers = {0, 0, 0, 0, 0, 0, 0}
local numbers = {0, 0, 0, 0, 0, 0, 0}
-- make a var, led brightness for grid
level = 5
local level = 5

-- encoder function
enc = function(n, delta)
function enc(n, delta)
numbers[n] = numbers[n] + delta
-- redraw screen
redraw()
end

-- key function
key = function(n, z)
function key(n, z)
numbers[n+3] = z
-- redraw screen
redraw()
end

-- screen redraw function
redraw = function()
function redraw()
-- screen: turn on anti-alias
screen.aa(1)
screen.line_width(1.0)
-- clear screen
screen.clear()
-- set pixel brightness (0-15)
@@ -89,7 +84,7 @@ end


-- set up a metro
c = metro[1]
local c = metro[1]
-- count forever
c.count = -1
-- count interval to 1 second
@@ -102,19 +97,19 @@ c.callback = function(stage)
end

-- grid key function
gridkey = function(x, y, state)
if state > 0 then
function gridkey(x, y, state)
if state > 0 then
-- turn on led
g:led(x, y, level)
else
else
-- turn off led
g:led(x, y, 0)
end
-- refresh grid leds
g:refresh()
end
-- refresh grid leds
g:refresh()
end

-- called on script quit, release memory
cleanup = function()
function cleanup ()
numbers = nil
end

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.