Hello! I am currently working on a project using the “liveconv” opcode that will allow users to convolve with an uploaded file and edit the sample region in real-time with rslider widgets. I am having an issue with calling an instrument that records the newly selected region. In my main instrument, instrument 1, I am calling a named instrument “Record_IR” ( using “event” opcode) to rewrite the selected sample region into an f-table being used by “liveconv”.
I would like to call the “Record_IR” instrument at k-rate using the ‘changed’ opcode with the region selection rsliders. When I do this, everything works fine until I stop the instrument, and run it again. Then Cabbage crashes. After doing some digging I realized it was from calling the “Record_IR” instrument when it was still running, although it sounded fine on the first run. I tried doing the same thing but putting a condition to turnoff the instrument if it was on and re-trigger the event, which solved the crashing issue, but produced audible clicks in the processing.
Does anyone know how I can trigger the instrument at k-rate but prevent cabbage from crashing on the next run, and why cabbage might be doing this?
I’ve attached the patch below, its pretty messy but the lines of interest are 193 - 206, and the “Record_IR” instrument is at line 254.
Thanks
CAB-SpectralModifier.csd (9.5 KB)