Faustgen in RNBO?

Stephane Letz's icon

Faustgen is an external Max/MSP object to compile Faust code dynamically, using a LLVM based JIT compiler (https://faustdoc.grame.fr/manual/overview/). It could possibly export the DSP code in C++, so be used in a RNBO patch.

Another even more ambitious idea would be to combine several Faustgen described DSP in a unique resulting equivalent FAUST DSP, that would benefit from the Faust compiler optimisations. We have some experience in this area.

Would the Max/MSP community be interested by this possibility ?

Evan Berard's icon

This is something I 100% would love to see in RNBO and would actively use it quite a lot!

Max Bruckert's icon

Any news from Cycling if there could be an opening on that point?

Simon Hill's icon

That would definitely be an amazing feature!

Stephane Letz's icon

We need RNBO developers support to make that happen ! We need RNBO users support to convince RNBO developers !

alfonso santimone's icon

I'm totally in! I don't know how to convince people tho :-D

Stephane Letz's icon

Have other Max/MSP users ask for this feature ? BTW, I'm ready to work with Cycling people to make this happen ((-;

Shakeeb Alireza's icon

Yes, this would be a great... (-:

Stephane Letz's icon

Here is a test patch in RNBO. The equivalent manually written Faust version is almost 5 times faster:

{
    "patcher" :     {
        "fileversion" : 1,
        "appversion" :         {
            "major" : 8,
            "minor" : 5,
            "revision" : 2,
            "architecture" : "x64",
            "modernui" : 1
        }
,
        "classnamespace" : "rnbo",
        "rect" : [ 472.0, 225.0, 653.0, 651.0 ],
        "bglocked" : 0,
        "openinpresentation" : 0,
        "default_fontsize" : 12.0,
        "default_fontface" : 0,
        "default_fontname" : "Lato",
        "gridonopen" : 1,
        "gridsize" : [ 15.0, 15.0 ],
        "gridsnaponopen" : 1,
        "objectsnaponopen" : 1,
        "statusbarvisible" : 2,
        "toolbarvisible" : 1,
        "lefttoolbarpinned" : 0,
        "toptoolbarpinned" : 0,
        "righttoolbarpinned" : 0,
        "bottomtoolbarpinned" : 0,
        "toolbars_unpinned_last_save" : 0,
        "tallnewobj" : 0,
        "boxanimatetime" : 200,
        "enablehscroll" : 1,
        "enablevscroll" : 1,
        "devicewidth" : 0.0,
        "description" : "",
        "digest" : "",
        "tags" : "",
        "style" : "",
        "subpatcher_template" : "",
        "assistshowspatchername" : 0,
        "title" : "16LP",
        "boxes" : [             {
                "box" :                 {
                    "id" : "obj-10",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "signal" ],
                    "patching_rect" : [ 40.0, 526.0, 40.0, 23.0 ],
                    "rnbo_classname" : "*~",
                    "rnbo_serial" : 1,
                    "rnbo_uniqueid" : "*~_obj-10",
                    "text" : "*~ 0.5"
                }

            }
,             {
                "box" :                 {
                    "bubble" : 1,
                    "bubbleside" : 3,
                    "fontsize" : 18.0,
                    "id" : "obj-8",
                    "linecount" : 2,
                    "maxclass" : "comment",
                    "numinlets" : 1,
                    "numoutlets" : 0,
                    "patching_rect" : [ 486.0, 301.5, 166.0, 54.0 ],
                    "text" : "Open the Export Sidebar"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-26",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 1,
                    "outlettype" : [ "signal" ],
                    "patching_rect" : [ 174.0, 435.0, 73.0, 23.0 ],
                    "rnbo_classname" : "slide~",
                    "rnbo_serial" : 1,
                    "rnbo_uniqueid" : "slide~_obj-26",
                    "text" : "slide~ 20 20"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-24",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 1,
                    "outlettype" : [ "signal" ],
                    "patching_rect" : [ 69.0, 435.0, 73.0, 23.0 ],
                    "rnbo_classname" : "slide~",
                    "rnbo_serial" : 2,
                    "rnbo_uniqueid" : "slide~_obj-24",
                    "text" : "slide~ 20 20"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-22",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 1,
                    "outlettype" : [ "signal" ],
                    "patching_rect" : [ 224.5, 214.0, 73.0, 23.0 ],
                    "rnbo_classname" : "slide~",
                    "rnbo_serial" : 3,
                    "rnbo_uniqueid" : "slide~_obj-22",
                    "text" : "slide~ 20 20"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-18",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 1,
                    "outlettype" : [ "signal" ],
                    "patching_rect" : [ 99.5, 179.0, 73.0, 23.0 ],
                    "rnbo_classname" : "slide~",
                    "rnbo_serial" : 4,
                    "rnbo_uniqueid" : "slide~_obj-18",
                    "text" : "slide~ 20 20"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-17",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 2,
                    "outlettype" : [ "", "" ],
                    "patching_rect" : [ 174.0, 401.0, 216.0, 23.0 ],
                    "rnbo_classname" : "param",
                    "rnbo_extra_attributes" :                     {
                        "fromnormalized" : "",
                        "meta" : "",
                        "unit" : "",
                        "minimum" : 0.0,
                        "displayorder" : "-",
                        "preset" : 1,
                        "ctlin" : 0.0,
                        "maximum" : 1.0,
                        "order" : "0",
                        "steps" : 0.0,
                        "tonormalized" : "",
                        "enum" : "",
                        "displayname" : "",
                        "exponent" : 1.0,
                        "sendinit" : 1
                    }
,
                    "rnbo_serial" : 1,
                    "rnbo_uniqueid" : "Q",
                    "rnboinfo" :                     {
                        "needsInstanceInfo" : 1,
                        "argnames" :                         {
                            "value" :                             {
                                "attrOrProp" : 2,
                                "digest" : "Set initial value",
                                "defaultarg" : 2,
                                "isalias" : 0,
                                "aliases" : [ ],
                                "settable" : 1,
                                "attachable" : 0,
                                "isparam" : 0,
                                "deprecated" : 0,
                                "type" : "number",
                                "defaultValue" : "0",
                                "label" : "Initial Value",
                                "displayorder" : 3
                            }
,
                            "normalizedvalue" :                             {
                                "attrOrProp" : 1,
                                "digest" : "Set value normalized. ",
                                "isalias" : 0,
                                "aliases" : [ ],
                                "attachable" : 0,
                                "isparam" : 0,
                                "deprecated" : 0,
                                "inlet" : 1,
                                "type" : "number"
                            }
,
                            "reset" :                             {
                                "attrOrProp" : 1,
                                "digest" : "Reset param to initial value",
                                "isalias" : 0,
                                "aliases" : [ ],
                                "attachable" : 1,
                                "isparam" : 0,
                                "deprecated" : 0,
                                "type" : "bang"
                            }
,
                            "normalized" :                             {
                                "attrOrProp" : 1,
                                "digest" : "Normalized parameter value.",
                                "isalias" : 0,
                                "aliases" : [ ],
                                "attachable" : 0,
                                "isparam" : 0,
                                "deprecated" : 0,
                                "outlet" : 1,
                                "type" : "number"
                            }
,
                            "name" :                             {
                        

12LP.rnbopat.txt
text/plain 226.29 KB

Stephane Letz's icon

Faust to codebox backend in progress, here is a working example: https://gist.github.com/sletz/572421ca4fac39a7c16082b09a06d442

Stephane Letz's icon

WIP ! Using Faust in RNBO with codebox~ https://faustdoc.grame.fr/tutorials/rnbo/
Can be tested with latest Faust 2.61.0 on GitHub master-dev : https://github.com/grame-cncm/faust

Stephane Letz's icon

Added faust2rnbo, so working patches can be automatically generated, to be used with latest Faust GitHub master-dev 2.64.0 version.

But pending reported bugs in RNBO code generator make the tool only usable with a subset of Faust DSPs.

Stephane Letz's icon

MIDI control added in faust2rnbo, see: https://faustdoc.grame.fr/tutorials/rnbo/#midi-control and use Faust 2.65.1 on GitHub master-dev

Stephane Letz's icon

Polyphonic instruments added in faust2rnbo, see: https://faustdoc.grame.fr/tutorials/rnbo/#polyphonic-instruments and use Faust 2.66.1 on GitHub master-dev

alfonso santimone's icon

great stuff! Faust -> rnbo~ !