Faust2sc error

Hi there!

Maybe this is not the right place to ask for this question, and it should rather be on faust forum… but just in case someone knows or has found this error. I am trying to make my first steps with Faust, and trying to compile Ugens from Faust code. I made my first attempt with a very simple Faust code, and using the faust2sc tool that comes with the Faust standard repository. But i get this error:

santiagovilanova@MacBook-Pro-de-santiago-2 FAUST % faust2sc /Users/santiagovilanova/Desktop/FAUST/simpleSin.dsp

faust2sc[INFO] Parsing /Users/santiagovilanova/Desktop/FAUST/simpleSin.dsp …

faust2sc[ERROR] undefined method `text’ for nil:NilClass

faust2sc[ERROR] Omitting /Users/santiagovilanova/Desktop/FAUST/simpleSin.dsp

the Faust code is supersimple, like:

import("stdfaust.lib");
freq = hslider("freq", 440, 20, 2000, 1);
gain = hslider("gain", 0.5, 0, 1, 0.01);
process = os.osc(freq) * gain;

im on an M4 mac computer with Sequoia

Does anyone know what could be happening?

I just managed to compile the faust dsp file by using the faust2sc.py tool, and adding this flag to use C++14:

CXXFLAGS=“-std=c++14” faust2sc.py /Users/santiagovilanova/Desktop/FAUST/simpleSin.dsp

Now i just need to figure out how to properly make it work in supercollider! it is ok with the simpleSin example, but more complex things (trying with the fluteStk.dsp example) dont seem to work magically and might need some attention…

Your issue probably is that faust doesn’t have control rate, so all of your args need to be at audio rate.

I do something like this in my sc files:

  *ar { | freq1, mod1, freq2, mod2, lfMult|
		if(freq1.rate!='audio'){freq1 = K2A.ar(freq1)};
		if(mod1.rate!='audio'){mod1 = K2A.ar(mod1)};
		if(freq2.rate!='audio'){freq2 = K2A.ar(freq2)};
		if(mod2.rate!='audio'){mod2 = K2A.ar(mod2)};
		if(lfMult.rate!='audio'){lfMult = K2A.ar(mod2)};
      ^this.multiNew('audio', freq1, mod1, freq2, mod2, lfMult)
  }

I’m not sure about the faust sliders, though. I don’t use them. Maybe those can be control rate?

Sam

1 Like

Thanks Sam! tried with no luck, though… i’ll keep you all posted about my findings. Basically what i want to do is port some of the physical modelling tools in faust as ugens, but still failing… but no rush, i’m patient :smiley:

me neither, I think this can be the issue unless it is the script faust2sc. On my side, I am using the script faust2supercollider.