Sure, happy to help! Here’s a distilled example. I’m using crow 1.0.0 but I saw similar effects prior to the update. I’m using the USB cable that came with crow in the leftmost norns USB port.
test script
-- crow: example of setting action on clock
local BeatClock = require 'beatclock'
local clk = BeatClock.new()
local function step()
local a = 4
local b = 2
local c = 5
crow.output[1].volts = a
crow.output[2].action = "pulse(0.1, 8, 0)"
crow.output[2].execute()
crow.output[3].volts = b
crow.output[4].volts = c
end
function init()
clk.on_step = step
clk.on_select_internal = function() clk:start() end
clk:add_clock_params()
params:set("bpm", 91)
params:default()
crow.reset()
clk:start()
end
function cleanup ()
clk:stop()
end
This works initially – but the pulse sounds too fast, almost double-time. And eventually, sometime between a couple triggers and a couple minutes later, it starts failing with this error:
crow receive: [string "local Asl = {}..."]:115: attempt to get length of a nil value (field 'exe')
crow receive: [string "local Asl = {}..."]:115: attempt to get length of a nil value (field 'exe')
crow receive: [string "local Asl = {}..."]:115: attempt to get length of a nil value (field 'exe')
crow receive: [string "local Asl = {}..."]:115: attempt to get length of a nil value (field 'exe')
crow receive: [string "local Asl = {}..."]:115: attempt to get length of a nil value (field 'exe')
crow receive: [string "local Asl = {}..."]:115: attempt to get length of a nil value (field 'exe')
Sometimes, if the script is able to run for a while, periodic instances of this error also appear in the console. Sometimes the error is accompanied by a single missed pulse, but not always.
crow receive: [string "eval"]:1: attempt to index a nil value (field 'vooutput')
If I move the crow.output[2].action line into init() after crow.reset(), then I never see the local Asl errors, and the timing on the pulse is correct. I do occasionally still see the attempt to index a nil value message, but more rarely, sometimes with a dropped pulse also.
(In both cases, I also have about a 10% failure rate with hitting Play in maiden and having the script work, hitting Play again usually fixes it, maybe I need a delay after calling crow.reset()?)