Faust2sc.py - A python rewrite of the faust to supercollider tools

Or [x.replace(" ", "\ ") for x in paths], I think escape is what commands use.

I tried both these approaches with no success. In both cases it can read the file inside the Application Support folder, but gives a different error, as it cannot write the .scx file. C’est la vie.

Mads, I have nothing to add at this point. I would say, commit the pr and if I am able to work on it in the future, I can update it then.

Sam

1 Like

The PR has been opened here https://github.com/grame-cncm/faust/pull/689

1 Like

And boom - it’s been merged into the master branch of faust.

3 Likes

Thanks Mads, very nice and useful !
I have just a problem with the flag -t that is used by faust for alarm clock, for exemple for some intensive compilation programs (-t 0 to stop the alarm). In Faust2sc.py -t is used for target so I’m not able to use the original -t flag for alarm clock. It’s possible to use another flag for target or introduce another flag for the alarm clock?

Thanks again for your work !!!

José

Sorry, I don’t understand - what alarmclock is this?

Sorry, it’s call --timeout (abort compilation after seconds (default 120)), see the help ‘faust --help’.

Best,

José

faust -t is there since a long time… :wink: I suggest adapting faust2sc.py

Let’s change it. What would be a better choice ? -o perhaps ?

That seems as good as any. -f is also free, but maybe implies too much.

It now uses -o and --outputfolder. Thanks for the feedback

Thanks Mads !!
How would it be possible then to pass the faust -t directly from Faust2sc.py?

I think you can use one of the environment variables for that. Let me have a look and get back to you…

As a general remark faust2xx tools generally have their own set of options, but allow the standard compile ones (like -vec -lv 1…) to be used also, and given to the compiler

The tool has been updated. We had missed the -DSUPERNOVA flag necessary to actually compile supernova versions. (up until now, apparantly, -s did nothing haha)… whoops

Jose if you update to the latest version you should now be able to use -t and other flags with this tool. It will simply interpret any additional flags as destined for the inner faust command.

Example

faust2sc.py compressor.dsp -s -vec -quad

Thank you very much Mads !
Excuse me, I would like to ask you if it is possible to integrate the option to compile several files at the same time with *.dsp, for example :
faust2sc.py *.dsp
Or is there any other way to do it?

Best,

José

I’m not 100% sure how to do it inside of the python script (yet), but until then you can run it inside a for-loop in bash like this:

for F in *.dsp; do faust2sc.py $F; done

Thanks! I’ll do it like this for now then!

Hi Mads et al,

Dario Sanfilippo just posted the following faust limiter:

This code trips up the faust2sc.py script. It took me a minute to figure it out. The .scx file is good, but the .sc file has the wrong number of input arguments. It has 4 instead of 9. It should give us:

*ar { | in1, in2, bypass(0.0), pre_gain(0.0), threshold(0.0), attack(0.01), hold(0.05), release(0.15), reset_peak(0.0) |
      ^this.multiNew('audio', in1, in2, bypass, pre_gain, threshold, attack, hold, release, reset_peak)
  }

but it actually gives:

    *ar{|in0, in1,control(0), display(0)|
      ^this.multiNew('audio', in0, in1,control, display)
    }

It seems that when the faust2sc file reads the json file, it reads that there are 2 inputs, when actually those are input groups that it needs to traverse and get all the elements from. So, it needs to somehow figure out when it is looking at groups, and go through the groups to get all the inputs.

I’m not able to fix this right now (it is a bit beyond my python/json skills), but I am bringing it up as a “todo”.

Sam