Hm that's not straightforward but also not so impossible. You'd have to write a wrapper that uses the Mac audio API and eventually ends up calling setup()/render()
. To do this, it'd have to fill the BelaContext
that is passed to setup()/render()
with appropriate values coming from your audio API and whatever dummy values you want in there for digital / analog I/Os.
The simplest way to do these things - especially if they are audio-only - is to concentrate all your DSP code in a class method or function that is entirely Bela-independent, so that it becomes straightforward to integrate it in any system-specific audio callback. For instance, among the libraries EnvelopeDetector
, Oscillator
, Biquad
, ADSR
, among the Bela libraries, don't have any Bela API dependent code in there (if anything some have some ARM-specific code in the implementation, but that's beyond the point here).