From: equilet <2237372+equilet@users.noreply.github.com> Date: Mon, 28 Apr 2025 18:24:01 +0000 (-0700) Subject: adding round robin poly allocator to handle voicing from outside of poly~ X-Git-Tag: v0.1~221 X-Git-Url: https://git.dabkitsch.com/?a=commitdiff_plain;h=ecee7c97d053f491a32b5897dab40ef9afa1e558;p=sonogarden_maxproj.git adding round robin poly allocator to handle voicing from outside of poly~ --- diff --git a/engine_voice.roundrobin.maxpat b/engine_voice.roundrobin.maxpat new file mode 100644 index 0000000..9be232e --- /dev/null +++ b/engine_voice.roundrobin.maxpat @@ -0,0 +1,281 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 9, + "minor" : 0, + "revision" : 6, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 74.0, 122.0, 527.0, 575.0 ], + "gridsize" : [ 15.0, 15.0 ], + "boxes" : [ { + "box" : { + "fontface" : 0, + "id" : "obj-6", + "maxclass" : "o.expr.codebox", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "FullPacket", "FullPacket" ], + "patching_rect" : [ 246.5, 454.0, 203.0, 31.0 ], + "text" : "delete(\"/voices/\" + /counter)" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "FullPacket" ], + "patching_rect" : [ 213.0, 403.0, 87.0, 22.0 ], + "text" : "o.route /voices" + } + + } +, { + "box" : { + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "FullPacket" ], + "patching_rect" : [ 282.0, 141.0, 111.0, 22.0 ], + "text" : "o.pack /num/voices" + } + + } +, { + "box" : { + "id" : "obj-7", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 273.0, 78.0, 150.0, 20.0 ], + "text" : "arg1: number of voices" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 282.0, 105.0, 111.0, 22.0 ], + "text" : "loadmess #1" + } + + } +, { + "box" : { + "id" : "obj-17", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "", "", "", "FullPacket" ], + "patching_rect" : [ 37.0, 105.0, 166.0, 22.0 ], + "text" : "o.route /numfiles /last /clear" + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 135.0, 141.0, 35.0, 22.0 ], + "text" : "clear" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "FullPacket" ], + "patching_rect" : [ 184.0, 141.0, 73.0, 22.0 ], + "text" : "o.pack /bndl" + } + + } +, { + "box" : { + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "FullPacket" ], + "patching_rect" : [ 184.0, 195.0, 117.0, 22.0 ], + "text" : "o.union" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 184.0, 374.0, 48.0, 22.0 ], + "text" : "t l l" + } + + } +, { + "box" : { + "fontface" : 0, + "id" : "obj-3", + "linecount" : 9, + "maxclass" : "o.expr.codebox", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "FullPacket", "FullPacket" ], + "patching_rect" : [ 184.0, 231.0, 256.0, 134.0 ], + "text" : "/counter ??= 1, \n\nif(/counter > /num/voices - 1, \n /counter = 1, \n /counter++\n),\n\nassign(\"/voices/\" + /counter, /bndl),\ndelete(/bndl)" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-2", + "index" : 0, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 184.0, 455.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-1", + "index" : 0, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 37.0, 25.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-17", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-17", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "source" : [ "obj-17", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "source" : [ "obj-5", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 1 ], + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 1 ], + "midpoints" : [ 290.5, 432.83746337890625, 453.25970458984375, 432.83746337890625, 453.25970458984375, 176.7960205078125, 291.5, 176.7960205078125 ], + "source" : [ "obj-9", 1 ] + } + + } + ], + "dependency_cache" : [ { + "name" : "o.expr.codebox.mxo", + "type" : "iLaX" + } +, { + "name" : "o.pack.mxo", + "type" : "iLaX" + } +, { + "name" : "o.route.mxo", + "type" : "iLaX" + } +, { + "name" : "o.union.mxo", + "type" : "iLaX" + } + ], + "autosave" : 0 + } + +}