“Deciding” would signify enough competence on my part to possess an intention
I’ll paste the code below, though it’s experiencing a formatting hiccup.
NB, I’ve established “crow 1+2” as a param in the code, but won’t paste that here (unless it would be relevant/where things could be going wrong).
Summary
for _,n in pairs(notes) do
local f = MusicUtil.note_num_to_freq(n)
if (params:get(“output”) == 1 or params:get(“output”) == 3) then
engine.hz(f)
end
if (params:get("output") == 2 or params:get("output") == 3) then
midi_out_device:note_on(n, 96, midi_out_channel)
table.insert(active_notes, n)
end
if (params:get("output") == 4) then
crow.output[1].volts = (n - 60) / 12
crow.output[2].volts = 5
end
end
notes = {}
Which should send the voltage to output one, and open the gate on output two. But right now, the gate stays high. Here’s where I try to close the gate on midi note off.
More code
local function all_notes_off()
if (params:get("output") == 2 or params:get("output") == 3) then
for _,a in pairs(active_notes) do
midi_out_device:note_off(a, nil, midi_out_channel)
end
if (params:get("output")) == 4 then
crow.output[2].volts = 0
end
end
active_notes = {}
end
local function step()
all_notes_off()
I know I’m misunderstanding something in here, just not sure what. Also, I do have an Ansible en route, so while this is becoming less a matter of personal necessity for me, I’d love to help as much as I can so that I learn!