The outline of the process, to add resources to C++ patches, is:
- Declare a Resource pointer in your Patch class:
class MyPatch : public Patch {
Resource* myresource;
- In your constructor, call
Patch::getResource()
and get the data from it that you need
MyPatch() {
myresource = getResource("909kick");
FloatArray samples = myresource->asFloatArray();
- In your destructor, call
Resource::destroy()
to clean up memory allocations
~MyPatch(){
Resource::destroy(myresource);
Of course this needs the latest develop
firmware and OwlProgram to actually work, and you need to first store the resource on the device as well (roughly same method as storing patches, but with slot numbers starting at 43). We’ll be publishing more info on all of this shortly as we catch up with docs and releases.
Great work on this @antisvin, thank you again for your amazing PRs!