So I’ve been messing around with using the ‘scanu’ opcode with instruments in Unity. I’ve been hitting some serious CPU walls, and am wondering the things I should be considering with optimizing Unity, as well as the Csound instrument itself.
I’ve been using a sketch written by Takahiko Tsuchiya called “Spinning Clock”. It’s likely the case that this instrument will just be too much, because it is a very dense (and beautiful) design.
But the instrument itself can run fine when untouched. The problem comes in when I try to control a ‘kRate’ input parameter of the ‘scanu’ opcode. It’s being controlled by the Csound object’s ‘position.y’. I’m using the CsoundSender component, and a CsoundTransformandPhysics sender.
Other than taking from the instrument’s quality, I’m wondering what things I can do to help Unity out? I have a screenshot of the profiler as I try to input into the kRate parameter attached, that may help. It’s interesting that ‘Physics.Processing’ spikes up, along with the "EditorLoop’.
comp_P1_01.csd (12.5 KB)
Also, I should mention that when I run the instrument in cabbage and aggressively scrub through the kRate parameter channel I have mapped it runs great.