"So the firmware is basically a bootloader for the patches, right?"
Not exactly: all the interrupts reside in the firmware, which hands over control to the dynamic patch every time a block is processed.
And yes you can avoid all that by compiling your patch into the firmware. Simply edit factory.h and factory.cpp. For debugging, I would strip it down to just the Gain patch and your patch.
On the issue of debugging I should also mention that, using dynamic patches, you can send debug messages very easily to OwlControl.
Call any of these functions from anywhere in your code:
void debugMessage(const char* msg);
void debugMessage(const char* msg, int);
void debugMessage(const char* msg, int, int);
void debugMessage(const char* msg, int, int, int);
void debugMessage(const char* msg, float);
void debugMessage(const char* msg, float, float);
void debugMessage(const char* msg, float, float, float);
There's float Patch::getElapsedBlockTime()
and int Patch::getElapsedCycles()
to help you pinpoint performance bottlenecks.
And a fairly standard ASSERT(cond, msg)
. Typical use:
ASSERT(size >= offset+length, "Array too small");
Note that only the most recent message will be picked up by OwlControl, which polls the device every few seconds.