In mespotine's example, actually both methods give the same results:
Code:
local _, chunk = reaper.GetTrackStateChunk( reaper.GetTrack(0,0), "", false )
-- my example track chunk has 8719 lines
-- times_to_run = 1000
function step_by_step()
-- So first: get all AUXRECV-entries(which is just a couple of lines)
local t = {}
for entry in chunk:gmatch("AUXRECV.-\n") do
-- Second: get the second parameter
-- AUXRECV 1 (0) 1 0 0 0 0 0 0 -1:U 0 -1 ''
local number = entry:match("AUXRECV %d (%d)")
if number then t[#t+1] = number end
end
return t
end
function one_go()
local t = {}
for number in chunk:gmatch("AUXRECV %d (%d)") do
t[#t+1] = number
end
return t
end
Code:
step_by_step: 4.129 sec
one_go: 4.136 sec