Skip to content

Instantly share code, notes, and snippets.

@lkishfy
Created November 1, 2018 17:00
Show Gist options
  • Select an option

  • Save lkishfy/e078c4d38eb24fb36dbddafb9649382e to your computer and use it in GitHub Desktop.

Select an option

Save lkishfy/e078c4d38eb24fb36dbddafb9649382e to your computer and use it in GitHub Desktop.
Node-UDP Example Max Patch
{
"boxes" : [ {
"box" : {
"maxclass" : "message",
"text" : "1",
"id" : "obj-22",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 394.0, 335.0, 29.5, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "0",
"id" : "obj-19",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 446.0, 236.0, 29.5, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sel start",
"id" : "obj-11",
"numinlets" : 2,
"numoutlets" : 2,
"patching_rect" : [ 417.0, 183.0, 51.0, 22.0 ],
"outlettype" : [ "bang", "" ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "start",
"id" : "obj-6",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 517.0, 84.0, 32.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "reset",
"id" : "obj-44",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 545.0, 243.0, 37.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "sendData",
"id" : "obj-41",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 342.0, 249.0, 62.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "delay 250",
"id" : "obj-37",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 202.0, 343.0, 63.0, 22.0 ],
"outlettype" : [ "bang" ]
}
}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-33",
"parameter_enable" : 0,
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 39.0, 517.0, 24.0, 24.0 ],
"outlettype" : [ "bang" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "delay 1000",
"id" : "obj-31",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 39.0, 474.0, 69.0, 22.0 ],
"outlettype" : [ "bang" ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "\"0\"",
"id" : "obj-30",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 66.0, 417.0, 50.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sel reset",
"id" : "obj-26",
"numinlets" : 2,
"numoutlets" : 2,
"patching_rect" : [ 434.0, 284.0, 56.0, 22.0 ],
"outlettype" : [ "bang", "" ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "0",
"id" : "obj-25",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 532.0, 364.0, 29.5, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"id" : "obj-23",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 304.5, 364.0, 29.5, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "gate",
"id" : "obj-21",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 202.0, 443.0, 34.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sprintf \\\"%d\\\"",
"id" : "obj-18",
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 136.0, 400.0, 79.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "counter",
"id" : "obj-17",
"numinlets" : 5,
"numoutlets" : 4,
"patching_rect" : [ 96.0, 351.0, 61.0, 22.0 ],
"outlettype" : [ "int", "", "", "int" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sel sendData",
"id" : "obj-16",
"numinlets" : 2,
"numoutlets" : 2,
"patching_rect" : [ 253.0, 300.0, 81.0, 22.0 ],
"outlettype" : [ "bang", "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "udpsend 127.0.0.1 3335",
"id" : "obj-15",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 124.0, 505.0, 140.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "udpreceive 2020",
"id" : "obj-14",
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 345.0, 57.0, 99.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "print raw",
"id" : "obj-12",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 12.0, 300.0, 57.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "print",
"id" : "obj-9",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 226.0, 188.0, 34.0, 22.0 ],
"outlettype" : [ "" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 33",
"id" : "obj-7",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 84.0, 197.0, 58.0, 22.0 ],
"outlettype" : [ "bang" ]
}
}
, {
"box" : {
"maxclass" : "toggle",
"id" : "obj-4",
"parameter_enable" : 0,
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 84.0, 152.0, 24.0, 24.0 ],
"outlettype" : [ "int" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "serial b 9600",
"id" : "obj-1",
"numinlets" : 1,
"numoutlets" : 2,
"patching_rect" : [ 84.0, 254.0, 77.0, 22.0 ],
"outlettype" : [ "int", "" ]
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-9", 0 ],
"destination" : [ "obj-1", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-1", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-6", 0 ],
"destination" : [ "obj-11", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-44", 0 ],
"destination" : [ "obj-26", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-41", 0 ],
"destination" : [ "obj-16", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-7", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-37", 0 ],
"destination" : [ "obj-30", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-33", 0 ],
"destination" : [ "obj-17", 3 ]
}
}
, {
"patchline" : {
"source" : [ "obj-31", 0 ],
"destination" : [ "obj-33", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-30", 0 ],
"destination" : [ "obj-21", 1 ]
}
}
, {
"patchline" : {
"source" : [ "obj-26", 0 ],
"destination" : [ "obj-25", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-26", 0 ],
"destination" : [ "obj-17", 3 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-25", 0 ],
"destination" : [ "obj-21", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-25", 0 ],
"destination" : [ "obj-18", 0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-21", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-22", 0 ],
"destination" : [ "obj-21", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-21", 0 ],
"destination" : [ "obj-31", 0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-21", 0 ],
"destination" : [ "obj-15", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-19", 0 ],
"destination" : [ "obj-18", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-18", 0 ],
"destination" : [ "obj-30", 1 ]
}
}
, {
"patchline" : {
"source" : [ "obj-17", 0 ],
"destination" : [ "obj-18", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-16", 0 ],
"destination" : [ "obj-37", 0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-16", 0 ],
"destination" : [ "obj-23", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-14", 0 ],
"destination" : [ "obj-26", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-14", 0 ],
"destination" : [ "obj-16", 0 ],
"order" : 2
}
}
, {
"patchline" : {
"source" : [ "obj-14", 0 ],
"destination" : [ "obj-11", 0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-22", 0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-19", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-17", 3 ],
"order" : 2
}
}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-17", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-12", 0 ],
"order" : 1
}
}
],
"appversion" : {
"major" : 8,
"minor" : 0,
"revision" : 1,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment