Error message with FAUST in HISE
-
-
Can you compile the same code as a separated file in a terminal?
-
@sletz you mean in Faust? I already compiled it in Faust works, no problem there...
-
@toxonic Not in Faust Web IDE, but in a terminal on your machine:
- you create a foo.dsp file with the code
- then "faust foo.dsp" in a terminal, does this works?
-
@sletz i'll try, when i'm back home. But i'm pretty sure it works, since i didnt't mean the Faust online compiler, but the Faust works IDE on my machine, which compiles via the local Faust compiler.
-
@toxonic The web Faust IDE embed its own webassembly version of the compiler and all DSP libraries. So running in a terminal is a different story.
-
The example works on my Macbook too so I'm pretty sure it's something with your faust installation.
What happens if you install faust to a completely different location and then set the FaustPath to this directory?
-
@sletz I usually use the Faust Works IDE, so I have no experience in using Faust via terminal.
I tried to compile the code to alsa-gtk app, and there is no problem:
If i should use the terminal, could you please tell me, what to type in?
@Christoph-Hart I am not firm in installing software to other locations but the default ones. What have i got to do? "sudo make install /home/XYZ/faust"? -
@toxonic You create a foo.dsp text file, you paste the DSP code. Then type "faust foo.dsp" in a terminal.
-
@sletz It seems to compile properly to cpp code. This is the output:
toxonic@toxonic-studio:~/Schreibtisch$ faust gain.dsp /* ------------------------------------------------------------ name: "gain" Code generated with Faust 2.50.6 (https://faust.grame.fr) Compilation options: -lang cpp -es 1 -mcd 16 -single -ftz 0 ------------------------------------------------------------ */ #ifndef __mydsp_H__ #define __mydsp_H__ #ifndef FAUSTFLOAT #define FAUSTFLOAT float #endif #include <algorithm> #include <cmath> #include <cstdint> #include <math.h> #ifndef FAUSTCLASS #define FAUSTCLASS mydsp #endif #ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif #if defined(_WIN32) #define RESTRICT __restrict #else #define RESTRICT __restrict__ #endif class mydsp : public dsp { private: int fSampleRate; float fConst0; float fConst1; FAUSTFLOAT fVslider0; float fRec0[2]; public: void metadata(Meta* m) { m->declare("compile_options", "-lang cpp -es 1 -mcd 16 -single -ftz 0"); m->declare("filename", "gain.dsp"); m->declare("maths.lib/author", "GRAME"); m->declare("maths.lib/copyright", "GRAME"); m->declare("maths.lib/license", "LGPL with exception"); m->declare("maths.lib/name", "Faust Math Library"); m->declare("maths.lib/version", "2.5"); m->declare("name", "gain"); m->declare("platform.lib/name", "Generic Platform Library"); m->declare("platform.lib/version", "0.2"); m->declare("signals.lib/name", "Faust Signal Routing Library"); m->declare("signals.lib/version", "0.3"); } virtual int getNumInputs() { return 2; } virtual int getNumOutputs() { return 2; } static void classInit(int sample_rate) { } virtual void instanceConstants(int sample_rate) { fSampleRate = sample_rate; fConst0 = 44.1f / std::min<float>(1.92e+05f, std::max<float>(1.0f, float(fSampleRate))); fConst1 = 1.0f - fConst0; } virtual void instanceResetUserInterface() { fVslider0 = FAUSTFLOAT(0.0f); } virtual void instanceClear() { for (int l0 = 0; l0 < 2; l0 = l0 + 1) { fRec0[l0] = 0.0f; } } virtual void init(int sample_rate) { classInit(sample_rate); instanceInit(sample_rate); } virtual void instanceInit(int sample_rate) { instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } virtual mydsp* clone() { return new mydsp(); } virtual int getSampleRate() { return fSampleRate; } virtual void buildUserInterface(UI* ui_interface) { ui_interface->openVerticalBox("gain"); ui_interface->addVerticalSlider("gain", &fVslider0, FAUSTFLOAT(0.0f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.01f)); ui_interface->closeBox(); } virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; float fSlow0 = fConst0 * float(fVslider0); for (int i0 = 0; i0 < count; i0 = i0 + 1) { fRec0[0] = fSlow0 + fConst1 * fRec0[1]; output0[i0] = FAUSTFLOAT(float(input0[i0]) * fRec0[0]); output1[i0] = FAUSTFLOAT(float(input1[i0]) * fRec0[0]); fRec0[1] = fRec0[0]; } } }; #endif
-
@Christoph-Hart Okay, i managed it to install Faust to a folder in my home directory and indeed: After pointing Hise to this directory the code works fine! :-)
On one hand that's good news and i'm lucky, that it's running. On the other hand, it is a bit annoying, that i can't install to the default directory and i don't know why.