Faust .cpp files how do I then use them in maxmsp

foge1's icon

Hi
I would like to use faust to develop my own externals for maxmsp.
The documentation with FAUST seems to be quite good and has lots of examples and I like the online compiler.

However once I have written something in Faust I choose my destination format to be MAXMSP and it creates a folder with 3 files in it.

externalname.cpp
externalname.dsp
Makefile

I can't find any documentation to explain what I do now to use those files in maxmsp

So my question is how do I take the files generated by the Faust compiler and then use them in MAXMSP?

Any guidance appreciated
Geoff

Owen Green's icon

Before you can use the object in max, you need to compile it, and then place it in your search path.

  • The .cpp file should be the C++ code of your faust algorithm, nicely wrapped up in the plumbing needed to make a max external.

  • The .dsp file is probably a Visual C++ project file, for compiling on Windows.

  • The Makefile is probably a unix type make file for compiling on OS X by running 'make'.

foge1's icon

did as you instructed and some progress has been made.
typing make gives me a bandfilter~.mxo file and a Info.plist.template file however moving them into max directory and then loading max there is a problem.

The external shows up in max no problems, however when calling it up it appears with no inlets or outlets??
so no joy yet.

has anyone used faust succesfully to compile maxmsp externals?

geoff

lewis lepton's icon

know this is an old post, but just started to look into faust, and cant really find much in terms of documentation.
dont know of anyone else has used this with max. so any info on this would be cool. will keep searching though.

rama's icon

hi all -

Just in case anyone is looking for this, I'm working on getting faust up and running here as well - make sure you have the c74support folder copied into your /usr/local/include folder, and you need to move (or copy) the .framework packages into your /Library/Frameworks folder... (or at least this seems to be where faust wants it to be, there might be a move clever way of setting faust's search path as well).

so far I have been able to compile .mxo's using the command: faust2msp foobar.dsp -- which will create an foobar~.mxo >> throw that in your max search path and it should load successfully.

*However*, I'm not there quite yet - any UI elements referred to in a .dsp file show up in the .mxo as supposedly valid messages (clicking on the object's inlet in max) but sending messages (e.g. shift $1 in the case of the example pitch_shift.dsp file) causes an error message. It's not clear to me yet whether the object is supposed to be a GUI, or is supposed to use the UI elements in the .dsp code as recognized messages (this seems more useful to me). If anyone knows how this is supposed to work please let me know! thanks.

- rama

Strophlex's icon

Hi

I just got this code working in max4live:

declare name "Constant-Peak-Gain Resonator";
declare author "Julius Smith";
declare version "1.0";
declare license "GPL";

/* Controls */
fr = nentry("frequency", 1000, 10, 20000, 1);
bw = nentry("bandwidth", 100, 10, 20000, 10);
g = hslider("peakgain", 1, 0, 10, 0.01);

/* Constants (Faust provides these in math.lib) */
SR = fconstant(int fSamplingFreq, );
PI = 3.1415926535897932385;

/* The resonator */
process = firpart : + ~ feedback
with {
R = exp(0-PI*bw/SR); // pole radius
A = 2*PI*fr/SR; // pole angle (radians)
RR = R*R;
firpart(x) = (x - x'') * g * ((1-RR)/2);
// time-domain coefficients ASSUMING ONE-SAMPLE FEEDBACK DELAY:
feedback(x) = 0 + 2*R*cos(A)*x - RR*x';
};

It was taken from Julius Smith's Faust tutorial. I copied the max api and frameworks like you sugested and used the faust2msp command to build it. I can set the filter frequency by sending a number prepended by "frequency" to the only inlet.

Johan