I’m developing a plugin for Bidule using their sdk that basically is integrating an instance of Csound api, and will be able to compile any valid orc code that is entered into a text box in the gui.
What’s the standard practice to recompiling orc code using the cpp api, when an instance of Csound is already running?
I have set up the initial orc (and sco) code in the init() method in the plugin, that works fine, but when I recompile some (valid) orc code that replaces the same instr 1, I get some nasty, loud glitchy output and the whole instance basically crashes and eventually brings down Bidule.
Is there a special order to doing this within C++?
I’m not using compilestr
or any of the Csound opcodes for this - only within C++
This is the general idea:
// gets called when a button is pressed.
CsoundTest::recompileOrc() {
if (_recompileTrig == 1) {
// csound->Reset(); <- does this need to be called at all?
_csCompileResult = csound->CompileOrc(templateOrc.c_str());
if (_csCompileResult == 0) {
csound->ReadScore("i1 0 4 220"); // <- restarts a new instance of instr 1
}
_recompileTrig = 0;
}
}
thanks!