hi there, this is more of a general question, i have not yet the urge to do this.

is it somehow possible to combine a heavy generated c code with a self written c program?
i know i can call stuff from within heavy (i.e. functions that i wrote)

what i was thinking about is more, take the audio out of heavy and process it further in some written c-code and send it either back into pd/heavy or to the DAC.

    lokki i know i can call stuff from within heavy (i.e. functions that i wrote)

    Really? How do you do that?

    lokki what i was thinking about is more, take the audio out of heavy and process it further in some written c-code and send it either back into pd/heavy or to the DAC.

    You sure can. You can also have several heavy contexts and pass data between them. Heavy knows nothing about physical inputs and outputs, or even about Bela. All it knows is how many input/output channels there are in the Pd patch. It then allocates a corresponding amount of memory and it expects the C++ wrapper to fill in the inputs with useful data (e.g.: the audio/analog/digital input data) and make good use of the generated outputs (e.g.: copy them to audio/analog/digital outputs). The Bela C++ wrapper does just that, on each side of

    hv_processInline(gHeavyContext, gHvInputBuffers, gHvOutputBuffers, context->audioFrames);

    If you want to do some pre/post processing in C++, you can simply change what data goes into thee heavy channels, or what you do with the data from the heavy channels before you send it to the physical outputs. If you want to loopback signals into heavy, e.g.: process a given block of audio as input->heavy->C++->heavy->output , then you would need to pull out the signals from one channel of heavy outputs after the first heavy, process it in C++, store it somewhere, and in the next call to render() put those data back into one of the heavy inputs for further processing. Note that this adds one block of latency to this particular signal path. Alternatively, you could have two heavy objects and do something like

    input->heavy1->C++->heavy2->output

    within the same callback. This has lower latency but you need heavier modifications to the program and build scripts to allow for two distinct heavy classes.

      giuliomoro Really? How do you do that?

      with the things you showed me 🙂

      creating a custom hash, that i can then interpret in the render.cpp... write samples for example.

      giuliomoro You sure can. You can also have several heavy contexts and pass data between them

      great, thanks!