I see that FXCHAINs tend to start with BYPASS then end with WAKE.
Plus optional project specific COMMENT section before the last WAK line.
So that got me thinking.
Since add by FXName is faster than chunk calls (as I understand), then in lua I suppose once can extract the relevant FX part, and write to tmp file, then just use the tmp file to use add fx by name.
So you could get rid of the COMMENT part, and then get everything later in one string.match anchoring to '$'
Code:
tmplt_fx = tmplt_fx:gsub('[ ]-<CO.->%s-$', ' >')
Now we have straight forward situation where everything is between a BYPASS and final WAK line.
Code:
extractedFX = tmplt_fx:match('%s?BY.-\n[ ]*(.+)\n.-WA.*$')
Then I wonder if I could just do
Code:
fileptr = io.open(sometempfilepath,'w')
fileptr:write(tmplt_fx)
fileptr:close()
at which point I can use the add fx by name calls, then
Code:
os.remove(sometempfilepath)
when I no longer need the file.
Will try it out, but curious what others have found to be efficient way to do this when dealing with massive FXCHAIN chunks...