Hello all,
I’ve been attempting to bring Faust into my SC work and have looked at a number of past threads here about how to do it. Mads Kjelgaard’s post, in particular.
At the moment, running “faust2supercollider” at the command line is returning a failure to find SuperCollider headers. I’m a little bit of a loss for finding them.
I know that the source code for faust2supercollider looks in the following locations (per specs here):
SC1=“/usr/local/include/SuperCollider/include”
SC2=“/usr/local/include/supercollider”
SC3=“/usr/include/SuperCollider”
SC4=“/usr/include/supercollider”
SC5=“/usr/local/include/SuperCollider/”
But as someone who has simply installed SuperCollider from the Mac universal binary (13.0.0 on os14.6.1), I don’t seem to have these folders and I’m not sure how I would go about finding them and appending them to the faust2supercollider script.
Does anyone here have some additional instruction for someone who is pretty new to this side of things? Thanks.
and replace my_build_command with the actual configure and build command.
But you can also use the Faust online IDE to build a SC plugin for you @ https://faustide.grame.fr/ - click on Export and select osx and supercollider as Architecture. I am unsure if this will generate an universal binary though, but maybe worth a try.
The faust online compiler still only compiles to Intel, which is really annoying. It is otherwise such a great tool. It would be so great if it compiled to FAT or just to ARM.
Sorry for being a little dense here, but I’m failing to understand something about these instructions. I’ve built SC and plugins on numerous occasions, but I seem to wake up the next morning and forget how I did it - this is a little more customized, also.
So, I grabbed a copy of SC via homebrew. I have it at ~/supercollider.
I’m pretty sure I have CMake ready to go.
How do I figure out to configure and build command? I’m assuming it’s something like: SUPERCOLLIDER_HEADERS=~/supercollider cmake --build
but currently unclear…
I’m still hoping the Faust Online IDE will work for FAT or ARM eventually, but as Sam says, it’s not currently an option.
Generally I’d not advise to use SuperCollider from package managers - use the officially provided installers or source code instead of package managers, because the latter can grow stale as they are not maintained by the community.
Also, I somehow doubt that ~/supercollider is originating from brew b/c homebrew will install a SuperCollider binary file and not download any source code - see homebrew-cask/Casks/s/supercollider.rb at master · Homebrew/homebrew-cask · GitHub - please verify that it is the actual source code and if not, follow the already mentioned guide above to obtain the full source code of SuperCollider.
I never used faust2sc, but assuming that you have the SuperCollider source code located at ~/supercollider it should be as easy as
It’s definitely the source code, so maybe I cloned it awhile ago.
A few things to just clarify:
There is faust2sc, faust2sc.py and faust2supercollider - I’m not sure I entirely comprehend the differences - but I was advised to try faust2supercollider, after faust2sc.py threw several errors.
I went to change the paths in the faust2supercollider code.
I added lines for both SC1 and SC2, below:
This didn’t work, continued to not find the headers. I ran :
SUPERCOLLIDER_HEADERS=~/git/supercollider/include faust2sc myfaustpatch.dsp
and SUPERCOLLIDER_HEADERS=~/supercollider/include faust2sc myfaustpatch.dsp
myfaustpatch exported as a dsp file, rather than a faust file - which may be part of the problem - but I feel like there’s a larger confusion here that I’m still missing.
The terminal is in the directory where MoogVCF2.dsp is. Basically, I type "python " then drag the faust2sc.py file from the homebrew directory to the terminal. Then "-p " and drag the SC source code folder to the terminal then type the name of the .dsp file you want to compile.
This will build a help file and class file and all the drippings.
I’m not sure if you need to specify the architecture of the processor but if so you can add “-m arm64”
Thanks for this - I’m tinkering with your suggestions, although my Faust files weren’t homebrewed - I might try a clean install from there next.
Instead of trying to get ‘faust2supercollider’ to identify the correct path, I created a path that it was already identifying and brought the SC source code over there.
What I found was that I got the same error now, as I did with faust2sc.py - and I’m wondering if they might be related to SC’s header files specifically. My DSP file. is called “madsTest.dsp”, since it is taken directly from the link above.
Here’s the ‘faust2sc.py’ errors:
Compiling MadsTest
Found SuperCollider headers: /Users/wheeler/supercollider/include
Compiling scsynth object using command:
c++ -O3 -DNO_LIBSNDFILE -DSC_DARWIN -bundle -I/Users/wheeler/supercollider/include/plugin_interface -I/Users/wheeler/supercollider/include/server -I/Users/wheeler/supercollider/include/common -I/opt/homebrew/Cellar/faust/2.77.3/include
-I/Users/wheeler -std=c++11 -Ofast -Dmydsp="MadsTest" -o /var/folders/jy/j28xht0s7kxf_x4cy6hlkycm0000gn/T/faust.r6o7x0uv/MadsTest.scx madsTest.cpp
In file included from madsTest.cpp:53:
In file included from /Users/wheeler/supercollider/include/plugin_interface/SC_PlugIn.h:25:
/Users/wheeler/supercollider/include/plugin_interface/SC_Unit.h:96:32: error: 'auto' return without trailing return type; deduced return types are a C++14 extension
96 | [[nodiscard]] inline constexpr auto copyAndCastToTypeOfFirstArg(const ToType&, const Value& value) noexcept {
| ^
/Users/wheeler/supercollider/include/plugin_interface/SC_Unit.h:97:26: error: no template named 'remove_cv_t' in namespace 'std'
97 | using TargetT = std::remove_cv_t<std::remove_reference_t<ToType>>;
| ~~~~~^
/Users/wheeler/supercollider/include/plugin_interface/SC_Unit.h:97:43: error: no template named 'remove_reference_t' in namespace 'std'; did you mean 'remove_reference'?
97 | using TargetT = std::remove_cv_t<std::remove_reference_t<ToType>>;
| ~~~~~^~~~~~~~~~~~~~~~~~
| remove_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/remove_reference.h:23:8: note: 'remove_reference' declared here
23 | struct remove_reference {
| ^
In file included from madsTest.cpp:53:
In file included from /Users/wheeler/supercollider/include/plugin_interface/SC_PlugIn.h:25:
/Users/wheeler/supercollider/include/plugin_interface/SC_Unit.h:98:24: error: unknown type name 'TargetT'
98 | return static_cast<TargetT>(value);
| ^
4 errors generated.
Here’s the error generated from the newly-moved path with “faust2supercollider”:
In file included from /usr/local/include/SuperCollider/include/plugin_interface/SC_PlugIn.h:25:
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:96:32: error: 'auto' return without trailing return type; deduced return types are a C++14 extension
96 | [[nodiscard]] inline constexpr auto copyAndCastToTypeOfFirstArg(const ToType&, const Value& value) noexcept {
| ^
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:97:26: error: no template named 'remove_cv_t' in namespace 'std'
97 | using TargetT = std::remove_cv_t<std::remove_reference_t<ToType>>;
| ~~~~~^
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:97:43: error: no template named 'remove_reference_t' in namespace 'std'; did you mean 'remove_reference'?
97 | using TargetT = std::remove_cv_t<std::remove_reference_t<ToType>>;
| ~~~~~^~~~~~~~~~~~~~~~~~
| remove_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/remove_reference.h:23:8: note: 'remove_reference' declared here
23 | struct remove_reference {
| ^
In file included from madsTest.cpp:53:
In file included from /usr/local/include/SuperCollider/include/plugin_interface/SC_PlugIn.h:25:
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:98:24: error: unknown type name 'TargetT'
98 | return static_cast<TargetT>(value);
| ^
4 errors generated.
In file included from madsTest.cpp:53:
In file included from /usr/local/include/SuperCollider/include/plugin_interface/SC_PlugIn.h:25:
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:96:32: error: 'auto' return without trailing return type; deduced return types are a C++14 extension
96 | [[nodiscard]] inline constexpr auto copyAndCastToTypeOfFirstArg(const ToType&, const Value& value) noexcept {
| ^
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:97:26: error: no template named 'remove_cv_t' in namespace 'std'
97 | using TargetT = std::remove_cv_t<std::remove_reference_t<ToType>>;
| ~~~~~^
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:97:43: error: no template named 'remove_reference_t' in namespace 'std'; did you mean 'remove_reference'?
97 | using TargetT = std::remove_cv_t<std::remove_reference_t<ToType>>;
| ~~~~~^~~~~~~~~~~~~~~~~~
| remove_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/remove_reference.h:23:8: note: 'remove_reference' declared here
23 | struct remove_reference {
| ^
In file included from madsTest.cpp:53:
In file included from /usr/local/include/SuperCollider/include/plugin_interface/SC_PlugIn.h:25:
/usr/local/include/SuperCollider/include/plugin_interface/SC_Unit.h:98:24: error: unknown type name 'TargetT'
98 | return static_cast<TargetT>(value);
| ^
4 errors generated.
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: madsTest_x86_64.scx (No such file or directory)
the errors look like they are saying you need c++ 14 to compile your code, but the faust compiler uses c++ 11, so this might be the issue. why it needs that, i don’t know.
a longshot, but try running this line again, but using c++17:
Well, I managed to get “faust2supersollider” working, but not “faust2sc.py” - more or less with your advice.
Part of it was updating the c++ to 16, which I verified with a nightly build of Faust that had the update. The other part was that faust2supercollider seems to need the dsp file to be in the same folder as the build and needs to compile to that location also. Either I am misunderstanding the commands to use other paths or they don’t currently work with that code…