Is it possible to use the compiled c++ ugens in a c progam?
Right now try to link SC_PlugIn.h in a c program but it fails when it tries to read SC_BoundsMacros.h which is C++.
Did anyone ever tried this?
The scsynth plugin API looks like a C API, but it has been “polluted” with C++isms for a long time (or since the beginning?). If the API gets refactored, this is something to consider. A pure C API would allow people to write plugins in different languages (C, Rust, or even Fortran )
But your case seems to be the other way round. What are you trying to do? You cannot really use UGens plugins outside of scsynth (or a compatible program, such as Supernova).
I am thinking if it makes sense to use ugens outside of scsynth/supernova. But that would need a c interface for language interoperability.
I am thinking if it makes sense to use ugens outside of scsynth/supernova.
It doesn’t. UGen plugins are deeply tied to the scsynth architecture.
What you can do is extract the actual DSP code of plugins you are interested in and modify it according to your own program. (Of course, you need to honor the license of the plugin!)
i looked again into this idea and it seems that one basically needs to reimplement supernova/sc/sc_plugin_interface.cpp
Not only that. You would also need to reimplement the whole World
struct and also make sure to properly initialize the Unit
struct with all its members. I’d say, forget about it.