How to use Gen Exported code alongside other C++ code on Daisy (or other ) audio board

dan snazelle's icon

A long time ago before OOPSY someone made this tutorial for using Gen~ code within a C++ program alongside other code.

https://gist.github.com/tomoyanonymous/5954632487aa0853c203a5cc313cc8bd

I would like to be able to do this with the Daisy as I want to use the power of gen alongside other things Gen is not really designed for (non audio stuff, as well as audio things like FFT)--menus, housekeeping, etc.

Unless I am wrong Oopsy is meant more for using the code without too many additions or changes.

So the problem I am having is that this tutorial is very old. The AudioCallback on Daisy no longer takes **in and **out. when i exported code from gen using the message box-i get all the proper files. I got the code compiling without errors etc. But I am not getting any working audio. (just a loud constant pitch which the pod often does when things are not setup properly. none of the pots do anything.






I am stumped as to 1.

how to get my parameters from daisy connecting to the parameters in the gen exported file

(right now i have a paramter in my gen patch called freq and one called mod

So on the daisy I set it up like this


p_freq.Init(hw.knob1, 0, 2500, Parameter::LINEAR);

p_mod.Init(hw.knob2, 0, 127, Parameter::LINEAR);

freq = p_freq.Process();

mod = p_mod.Process();

simpleFM::setparameter(fm_instance,0,freq*200,nullptr);

simpleFM::setparameter(fm_instance,1,mod*100,nullptr);



and then 2. How to get audio in and out WHILE making it work with the t_sample ** type
normally everything is a float on the daisy for audio


for audio(since this is just an FM oscillator and i do not need any audio INPUT

i tried to do this within the callback


// Audio Loop

t_sample** out0 = (t_sample**)out[0];

simpleFM::perform(fm_instance,0,1,(t_sample **)out0,1,size);

for(size_t i = 0; i < size; i ++)

{

// out[0][i] = (float &&)out0;

}

}

thanks for any help getting the gen files to connect to the daisy audio callback and the parameters to connect to the daisy knobs..