Doing Microtonal polyphony in M4L efficiently

Arnau Brichs's icon

Hello,

I've been meaning to create a Frequency to MIDI polyphonic converter inside M4L (for doing custom additive synthesis), but for some reason it crushes very easily every time I run it.

Is there an efficient way of going about doing microtonal polyphony in Live? Maybe with some MC tricks?

{
    "boxes" : [         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "p format",
                "patching_rect" : [ 142.795998959935332, 146.063519122139155, 98.0, 22.0 ],
                "numinlets" : 2,
                "numoutlets" : 2,
                "id" : "obj-38",
                "outlettype" : [ "", "" ],
                "patcher" :                 {
                    "fileversion" : 1,
                    "appversion" :                     {
                        "major" : 8,
                        "minor" : 3,
                        "revision" : 1,
                        "architecture" : "x64",
                        "modernui" : 1
                    }
,
                    "classnamespace" : "box",
                    "rect" : [ 59.0, 106.0, 640.0, 480.0 ],
                    "bglocked" : 0,
                    "openinpresentation" : 0,
                    "default_fontsize" : 12.0,
                    "default_fontface" : 0,
                    "default_fontname" : "Arial",
                    "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,
                    "boxes" : [                         {
                            "box" :                             {
                                "maxclass" : "newobj",
                                "text" : "speedlim 250",
                                "patching_rect" : [ 269.961568623780977, 100.0, 80.0, 22.0 ],
                                "numinlets" : 2,
                                "numoutlets" : 1,
                                "id" : "obj-30",
                                "outlettype" : [ "" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "newobj",
                                "text" : "speedlim 250",
                                "patching_rect" : [ 140.0, 100.0, 80.0, 22.0 ],
                                "numinlets" : 2,
                                "numoutlets" : 1,
                                "id" : "obj-24",
                                "outlettype" : [ "" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "newobj",
                                "text" : "zl.slice 16",
                                "patching_rect" : [ 269.955098042885766, 137.0, 61.0, 22.0 ],
                                "numinlets" : 2,
                                "numoutlets" : 2,
                                "id" : "obj-28",
                                "outlettype" : [ "", "" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "newobj",
                                "text" : "zl.slice 16",
                                "patching_rect" : [ 140.0, 137.0, 61.0, 22.0 ],
                                "numinlets" : 2,
                                "numoutlets" : 2,
                                "id" : "obj-27",
                                "outlettype" : [ "", "" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "message",
                                "text" : "target $1, $2",
                                "fontsize" : 10.846682397001928,
                                "fontname" : "Arial",
                                "patching_rect" : [ 269.955098042885766, 224.509921005794013, 75.0, 21.0 ],
                                "numinlets" : 2,
                                "numoutlets" : 1,
                                "id" : "obj-128",
                                "outlettype" : [ "" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "newobj",
                                "text" : "listfunnel 1",
                                "fontsize" : 10.65324804991365,
                                "fontname" : "Arial",
                                "patching_rect" : [ 269.955098042885766, 186.369615077972412, 59.0, 20.0 ],
                                "numinlets" : 1,
                                "numoutlets" : 1,
                                "id" : "obj-131",
                                "outlettype" : [ "list" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "message",
                                "text" : "target $1, $2",
                                "fontsize" : 10.846682397001928,
                                "fontname" : "Arial",
                                "patching_rect" : [ 139.993529419104789, 224.509921005794013, 75.0, 21.0 ],
                                "numinlets" : 2,
                                "numoutlets" : 1,
                                "id" : "obj-121",
                                "outlettype" : [ "" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "newobj",
                                "text" : "listfunnel 1",
                                "fontsize" : 10.65324804991365,
                                "fontname" : "Arial",
                                "patching_rect" : [ 139.993529419104789, 186.369615077972412, 59.0, 20.0 ],
                                "numinlets" : 1,
                                "numoutlets" : 1,
                                "id" : "obj-123",
                                "outlettype" : [ "list" ]
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "inlet",
                                "patching_rect" : [ 139.999954593500206, 40.0, 30.0, 30.0 ],
                                "numinlets" : 0,
                                "numoutlets" : 1,
                                "id" : "obj-21",
                                "outlettype" : [ "" ],
                                "comment" : "",
                                "index" : 1
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "inlet",
                                "patching_rect" : [ 269.961624593500119, 40.0, 30.0, 30.0 ],
                                "numinlets" : 0,
                                "numoutlets" : 1,
                                "id" : "obj-32",
                                "outlettype" : [ "" ],
                                "comment" : "",
                                "index" : 2
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "outlet",
                                "patching_rect" : [ 88.996780593500262, 312.051574999999957, 30.0, 30.0 ],
                                "numinlets" : 1,
                                "numoutlets" : 0,
                                "id" : "obj-33",
                                "comment" : "",
                                "index" : 1
                            }

                        }
,                         {
                            "box" :                             {
                                "maxclass" : "outlet",
                                "patching_rect" : [ 269.955154593500311, 312.051574999999957, 30.0, 30.0 ],
                                "numinlets" : 1,
                                "numoutlets" : 0,
                                "id" : "obj-37",
                                "comment" : "",
                                "index" : 2
                            }

                        }
 ],
                    "lines" : [                         {
                            "patchline" :                             {
                                "source" : [ "obj-121", 0 ],
                                "destination" : [ "obj-33", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-123", 0 ],
                                "destination" : [ "obj-121", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-128", 0 ],
                                "destination" : [ "obj-37", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-131", 0 ],
                                "destination" : [ "obj-128", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-21", 0 ],
                                "destination" : [ "obj-24", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-24", 0 ],
                                "destination" : [ "obj-27", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-27", 0 ],
                                "destination" : [ "obj-123", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-28", 0 ],
                                "destination" : [ "obj-131", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-30", 0 ],
                                "destination" : [ "obj-28", 0 ]
                            }

                        }
,                         {
                            "patchline" :                             {
                                "source" : [ "obj-32", 0 ],
                                "destination" : [ "obj-30", 0 ]
                            }

                        }
 ],
                    "bgcolor" : [ 0.776470588235294, 0.776470588235294, 0.776470588235294, 1.0 ],
                    "editing_bgcolor" : [ 0.776470588235294, 0.776470588235294, 0.776470588235294, 1.0 ]
                }
,
                "saved_object_attributes" :                 {
                    "description" : "",
                    "digest" : "",
                    "editing_bgcolor" : [ 0.776470588235294, 0.776470588235294, 0.776470588235294, 1.0 ],
                    "globalpatchername" : "",
                    "locked_bgcolor" : [ 0.776470588235294, 0.776470588235294, 0.776470588235294, 1.0 ],
                    "tags" : ""
                }

            }

        }
,         {
            "box" :             {
                "maxclass" : "live.text",
                "varname" : "MIDI[1]",
                "presentation_rect" : [ 147.584663981434346, 133.432345747947693, 44.0, 15.0 ],
                "automationon" : "\"MIDI Out\"",
                "presentation" : 1,
                "text" : "MIDI Out",
                "texton" : "MIDI Out",
                "focusbordercolor" : [ 0.247058823529412, 0.247058823529412, 0.247058823529412, 0.0 ],
                "patching_rect" : [ 85.58195440649979, 193.615101121788143, 44.0, 15.0 ],
                "numinlets" : 1,
                "automation" : "\"MIDI Out\"",
                "numoutlets" : 2,
                "id" : "obj-47",
                "parameter_enable" : 1,
                "outlettype" : [ "", "" ],
                "saved_attribute_attributes" :                 {
                    "focusbordercolor" :                     {
                        "expression" : ""
                    }
,
                    "valueof" :                     {
                        "parameter_enum" : [ "\"MIDI Out\"", "\"MIDI Out\"" ],
                        "parameter_linknames" : 1,
                        "parameter_longname" : "MIDI[1]",
                        "parameter_mmax" : 1,
                        "parameter_shortname" : "MIDI",
                        "parameter_type" : 2
                    }

                }

            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "gate",
                "patching_rect" : [ 85.58195440649979, 229.500000000000114, 76.214044553435542, 22.0 ],
                "numinlets" : 2,
                "numoutlets" : 1,
                "id" : "obj-41",
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "r amp",
                "patching_rect" : [ 221.795998959935332, 67.0, 39.0, 22.0 ],
                "numinlets" : 0,
                "numoutlets" : 1,
                "id" : "obj-23",
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "r freq",
                "patching_rect" : [ 142.795998959935332, 67.0, 37.0, 22.0 ],
                "numinlets" : 0,
                "numoutlets" : 1,
                "id" : "obj-26",
                "outlettype" : [ "" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "midiout",
                "patching_rect" : [ 85.58195440649979, 264.867908141006524, 47.0, 22.0 ],
                "numinlets" : 1,
                "numoutlets" : 0,
                "id" : "obj-69"
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "poly~ microsynth @steal 1 @voices 16",
                "patching_rect" : [ 142.795998959935332, 193.615101121788143, 216.0, 22.0 ],
                "numinlets" : 2,
                "numoutlets" : 2,
                "id" : "obj-18",
                "outlettype" : [ "", "" ]
            }

        }
 ],
    "lines" : [         {
            "patchline" :             {
                "source" : [ "obj-23", 0 ],
                "destination" : [ "obj-38", 1 ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-26", 0 ],
                "destination" : [ "obj-38", 0 ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-38", 0 ],
                "destination" : [ "obj-18", 0 ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-38", 1 ],
                "destination" : [ "obj-18", 1 ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-18", 0 ],
                "destination" : [ "obj-41", 1 ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-41", 0 ],
                "destination" : [ "obj-69", 0 ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-47", 0 ],
                "destination" : [ "obj-41", 0 ],
                "midpoints" : [ 95.08195440649979, 225.814017654426721, 95.08195440649979, 225.814017654426721 ]
            }

        }
 ],
    "appversion" :     {
        "major" : 8,
        "minor" : 3,
        "revision" : 1,
        "architecture" : "x64",
        "modernui" : 1
    }
,
    "classnamespace" : "box"
}