• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

README.mdH A D29-Oct-20215 KiB7051

faustgen-wrapper-poly.maxpatH A D29-Oct-20213.7 KiB185173

faustgen-wrapper.maxpatH A D29-Oct-20213.3 KiB164154

max-msp.cppH A D29-Oct-202123.5 KiB728527

max-msp64.cppH A D29-Oct-202125.2 KiB787566

wrapper-poly.maxpatH A D29-Oct-20213 KiB154144

wrapper.maxpatH A D29-Oct-20212.6 KiB132124

README.md

1# faust2max6/faust2msp
2
3The **faust2max6/faust2msp** tools transform a Faust DSP program into a compiled Max/MSP external, and a ready-to-use patch to load and use it. Polyphonic and MIDI controllable instruments can be created. Note that **faust2msp** is the old version compiling 32 bits external for Max5, and **faust2max6** compiles 64 bits or 64/32 bits externals for Max6 and later versions, and should be preferably used.
4
5## How to use
6
7**faust2max6** is used with the following options:
8
9`faust2max6 [-opt native|generic] [-native] [-nvoices <num>] [-effect <effect.dsp>] [-midi] [-osc] [-us <factor>] [-ds <factor>] [-filter <filter>] [-universal] [-nopatch] [-nopost] [-soundfile/-soundfile-static] [additional Faust options (-vec -vs 8...)] <file.dsp>`
10
11By default it will create *file~.mxo* external along with a *file.maxpat* patch file and a *ui.js* helper file, that will load the external and automatically create a User Interface (with sliders, buttons...) ready to control it. To be fully functional, the object still has to be connected to audio inputs/outputs or other elements in the patch. **Double-click** on the object allow to display its controls with their **label**, **range** and **complete path**. Note that  *-double* compilation mode is used by default in **faust2max6**.
12
13Attributes can be used at object creation time, for instance the following DSP code:
14
15```
16import("stdfaust.lib");
17freq = hslider("freq", 200, 50, 1000, 0.01);
18gain = hslider("gain", 0.5, 0, 1, 0.01);
19process = os.sawtooth(freq) * gain;
20```
21can be started with the following `@freq 700` and `@gain 0.6` attributes to configure parameters at creation time. Note that labels containing whitespace (like "freq Hz") cannot be used as attributes, they will have to be renamed.
22
23Depending of the number of audio inputs and outputs described in the DSP source code, the compiled .xmo/.xme object has:
24- N inlets, the first one being the message control one and a regular audio inlet, an all other audio inlets
25- M outlets, audio outs from 1 to M-1 (or 2 if MIDI outlet is created)
26- an output messages outlet
27- the right most outlet is used to send MIDI messages if MIDI metadata are used in the DSP UI items, and is only created when the `-midi` option is used
28
29The compiled .xmo/.xme object can be controlled with the following messages, which can be used depending of the parameters used at compilation time:
30
31- `polyphony <nvoices>` : to set the DSP in polyphonic mode with *nvoices* (note that the DSP code has to follow the [polyphonic convention](https://faustdoc.grame.fr/manual/midi/))
32- `osc <IP inport outport xmit[0|1] bundle[0|1]>`: to activate OSC control in input and output mode, possibly generating messages when *xmit = 1*, and in bundle mode when *bundle = 1*
33- `midievent <midi message>`: to receive and decode MIDI messages
34- `init`: to generate all inputs and outputs control messages as a message list *[path, init, min, max]* that will be sent on the output messages outlet
35- `dump`: to generate all inputs and outputs control messages as a message list *[path, cur, min, max]* that will be sent on the output messages outlet
36- `mute`: to mute audio rendering
37
38When the object has bargraphs, their values are sent in the right most outlet as a message list *[path, cur, min, max]*.
39
40## Options:
41
42Here are the available options:
43
44  - `-opt native` : to activate the best compilation options for the native CPU
45  - `-opt generic` : to activate the best compilation options for a generic CPU
46  - `-native` to compile for the native CPU (otherwise the 'generic' mode is used by default)
47  - `-nvoices <num>` : to produce a polyphonic self-contained DSP with <num> voices, ready to be used with MIDI
48  - `-effect <effect.dsp>` : to produce a polyphonic DSP connected to a global output effect, ready to be used with MIDI
49  - `-midi` : to activate MIDI control
50  - `-osc` : to activate OSC control
51  - `-us <factor>` : upsample the DSP by a factor
52  - `-ds <factor>` : downsample the DSP by a factor
53  - `-filter <filter>` : use a filter for upsampling or downsampling [0..4]
54  - `-universal` : to generate a 64/32 bits external
55  - `-nopatch` : to deactivate patch generation
56  - `-nopost` : to disable Faust messages to Max console
57  - `-soundfile` : when compiling DSP using 'soundfile' primitive, to add needed resources
58  - `-soundfile-static`: when compiling DSP using 'soundfile' primitive, to add needed resources in static mode
59  - `-help or -h` : shows the different options
60
61The *faust2msp* tools has to be used to create old Max5 compatible externals, the **faust2max6** tools has to be used starting with Max6.
62
63## Configuration:
64
65If you plan to use **faust2max6/faust2msp** on your own machine, you will have to:
66
67- install [Max/MSP SDK](https://cycling74.com/downloads/sdk)
68- edit the `faust/tools/faust2appls/faustpath` script to properly setup the $MAXSDK variable, then re-install the scripts again using `sudo make install`
69- alternatively you can locally change the $MAXSDK variable in a terminal using `export MAXSDK=/your/alternate/path`, then use **faust2msp/faust2max6** in this terminal.
70