Hello, I have a question regarding polls.
I have the following in my function init:
local pl = poll.set(“amp_in_l”)
pl.time = 0.25
pl:start()
All good so far. Next if I try and reference the poll in the script, such as:
local ampin = pl:update()
I get the following error:
/home/we/dust/code/jiffy/untitled.lua:148: attempt to index a nil value (global ‘pl’)
stack traceback:
/home/we/norns/lua/core/norns.lua:190: in metamethod ‘__index’
/home/we/dust/code/jiffy/untitled.lua:148: in main chunk
[C]: in function ‘dofile’
/home/we/norns/lua/core/script.lua:143: in function </home/we/norns/lua/core/script.lua:143>
[C]: in function ‘xpcall’
/home/we/norns/lua/core/norns.lua:191: in field ‘try’
/home/we/norns/lua/core/script.lua:143: in function ‘core/script.load’
(…tail calls…)
script clear
Tried doing this with/without declaring as local etc, but get the same errors… Any ideas?
I basically want to perform an action when the amp_in_l reaches a certain amplitude.
Thanks!