imminentgloom / form_without_matter

Drum sequencer for norns. Entropically inclusive. Crow. N.b. et al.
0 stars 0 forks source link

Crow: Crash: To high message-volume #3

Closed imminentgloom closed 3 weeks ago

imminentgloom commented 1 month ago

Send fewer messages...

Try this (postsolarpunk on crow study group): "instead of sending 4 crow.output[i]() messages each time this is called you could send one message from norns to crow, and write your own receiving function and put it on crow like

crow("function process_trigs(mytable) --iterate through table, trigger output for each element that's true ")

which will send this function to run on crow itself then on norns you could modify send_trigs()

function send_trigs()
  crow.process_trigs(trigs_to_send)
  for i = 1, 4 do 
    trigs_to_send[i] = false -- clear the table
  end
end

and now you're sending a small table to crow, but now only a single message which might net you more speed"

Solution probably connected to Issue #1, a lower max speed would help.

imminentgloom commented 3 weeks ago

Sending fewer messages manages to avoid crashing crow!

-- sends code to crow: iterate through table, trigger pulse if true
local function crow_init()
    for track = 1, 4 do crow.output[track].action = "pulse(" .. crow_trig_length .. ", 10)" end
    crow[[
        function process_trigs(mytable)
            for n = 1, 4 do
                if mytable[n] then
                    output[n]()
                end
            end
        end
        ]]
    end

    -- triggers process_trigs() on crow and empties crow_hits
    local function crow_send_trigs()
        crow.process_trigs(crow_hits)
        for i = 1, 4 do 
            crow_hits[i] = false
        end
    end