Cabbage Logo
Back to Cabbage Site

Custom opcode using function table from GEN01?

I’m writing a custom opcode in C and I want it to take a function table generated using GEN01 and use it as a wavetable. The idea is to limit it to the first 2048 samples and only use mono files for now. Maybe at some point I’ll do some sort of exception handling for tables that are stereo and force them to mono somehow.

Would taking the table number of the f table as input give the opcode access to the array inside the function table or would I need to try some other workaround to put the table into a buffer to use as a wavetable for an oscillator?

Also can anyone point me to where the ftgen source is, specifically for GEN01?

Cheers,
ghost

I’m not really well up on writing opcodes in C but you’ll usually get a pointer to the first element of the array and work from there. Accessing function tables should be relatively straightforward. This paper has an example of accessing a function table that might be useful.

Thanks Rory!
I’ll read through this and see if I can figure out an implementation that works for my case.
Cheers!