README.md
1
2## The libfaustremote library
3
4The `libfaustremote` library allows to compile and process a Faust DSP program on a remote machine.
5
6### Remote server
7
8The server launches a compilation service, waiting for DSPs to compile. Dependencies are:
9* `LLVM` using macport
10* `faust` make + sudo make install at the root of Faust project
11* `HTTPDFaust` make httpd + sudo make install at the root of Faust project
12* `libmicrohttpd` using macport
13* `libjacknet` download JackOSX package at: https://jackaudio.org
14
15Here is the API:
16
17* `remote_dsp_server* createRemoteDSPServer()`
18* `void deleteRemoteDSPServer(remote_dsp_server* server)`
19
20Use the server class to start/stop the compilation service:
21
22```
23class remote_dsp_server {
24 public:
25
26 bool start(int port = 7777); /* Start the DSP compilation service on a given port */
27 void stop(); /* Stop the DSP compilation */
28
29 void setCreateDSPFactoryCallback(createFactoryDSPCallback callback, void* callback_arg);
30 void setDeleteDSPFactoryCallback(deleteFactoryDSPCallback callback, void* callback_arg);
31
32 void setCreateDSPInstanceCallback(createInstanceDSPCallback callback, void* callback_arg);
33 void setDeleteDSPInstanceCallback(deleteInstanceDSPCallback callback, void* callback_arg);
34};
35```
36
37### Remote client
38
39Here is the API:
40
41To easily include remote processing in your projects, this API has been created. It has the similar prototype as `llvm-dsp` dynamic dsp:
42
43* `createRemoteDSPFactoryFromFile(const std::string& filename, int argc, const char* argv[], const string& ipServer, int portServer, string& error, int opt_level)`
44* `createRemoteDSPFactoryFromString(const string& name_app, const string& dsp_content, int argc, const char* argv[], const string& ipServer, int portServer, string& error, int opt_level)`
45* `createRemoteDSPInstance(remote_dsp_factory* factory, int argc, const char* argv[], int samplingRate, int bufferSize, string& error)`
46
47Use instance as any static DSP:
48
49* `virtual int getNumInputs()`
50* `virtual int getNumOutputs()`
51* `virtual void init(int samplingFreq)`
52* `virtual void buildUserInterface(UI* ui)`
53* `virtual void compute(int count, FAUSTFLOAT** input, FAUSTFLOAT** output)`
54
55* `void deleteRemoteDSPInstance(remote_dsp* dsp)`
56* `void deleteRemoteDSPFactory(remote_dsp_factory* factory)`
57
58This example shows how to use the API. In this example you can pass in command line:
59
60* the IP of remote Server you want to use
61* NetJack parameters of slave to be open on remote machine (localIP/Port/Latency/Compression)
62* the dsp files you want to run in JACK/QT environment and the number of instances for each
63* syntax is given with `./RemoteClient --help`
64
65The following has to be added at link time: `-lfaustremote -lcurl -ljacknet`.
66