Skip to content

Instantly share code, notes, and snippets.

@johnty
Created March 18, 2021 08:16
Show Gist options
  • Save johnty/c75b245e7fd212073afd959db116c16c to your computer and use it in GitHub Desktop.
Save johnty/c75b245e7fd212073afd959db116c16c to your computer and use it in GitHub Desktop.
Records UDP (OSC) messages with millisecond timestamps
{
"boxes" : [ {
"box" : {
"maxclass" : "comment",
"text" : "Autosave and query of current file size",
"linecount" : 2,
"numoutlets" : 0,
"id" : "obj-38",
"patching_rect" : [ 568.0, 191.5, 150.0, 34.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "mixed endian date, seriously?",
"numoutlets" : 0,
"id" : "obj-36",
"patching_rect" : [ 33.5, 268.0, 176.0, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "UDP message recorder\n\n- Automatically timestamps filename\n- Timestamps each message in CPU time\n- Auto-saves curent filename every 2s\n\nJohnty Wang @ IDMIL, Feb 2020",
"linecount" : 7,
"numoutlets" : 0,
"id" : "obj-32",
"patching_rect" : [ 676.0, 32.0, 244.0, 103.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "UDP (OSC) Input here:",
"numoutlets" : 0,
"id" : "obj-29",
"patching_rect" : [ 359.0, 191.5, 150.0, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "loadbang",
"numoutlets" : 1,
"id" : "obj-27",
"patching_rect" : [ 33.5, 23.0, 60.0, 22.0 ],
"outlettype" : [ "bang" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "Instructions:\n\n1. Input session name (optional)\n2. Click on NEW FILE\n3. Click SAVE FILE\n\nnote: autosaved every 2s",
"linecount" : 8,
"numoutlets" : 0,
"bgcolor" : [ 0.0, 1.0, 0.0, 0.368632 ],
"id" : "obj-26",
"patching_rect" : [ 359.0, 32.0, 150.0, 117.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "join",
"numoutlets" : 1,
"id" : "obj-14",
"patching_rect" : [ 359.0, 384.0, 63.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "cpuclock",
"numoutlets" : 1,
"id" : "obj-11",
"patching_rect" : [ 359.0, 352.0, 57.0, 22.0 ],
"outlettype" : [ "float" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route text",
"numoutlets" : 2,
"id" : "obj-10",
"patching_rect" : [ 229.5, 238.0, 61.0, 22.0 ],
"outlettype" : [ "", "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "session name (optional)",
"numoutlets" : 0,
"id" : "obj-4",
"patching_rect" : [ 90.75, 93.0, 150.0, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "textedit",
"text" : "session",
"numoutlets" : 4,
"id" : "obj-2",
"patching_rect" : [ 90.75, 115.0, 137.0, 25.0 ],
"outlettype" : [ "", "int", "", "" ],
"style" : "",
"numinlets" : 1,
"textjustification" : 1,
"parameter_enable" : 0,
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "loadbang",
"numoutlets" : 1,
"id" : "obj-1",
"patching_rect" : [ 568.0, 225.0, 60.0, 22.0 ],
"outlettype" : [ "bang" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "lines in current file",
"numoutlets" : 0,
"id" : "obj-83",
"patching_rect" : [ 544.0, 537.0, 108.0, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "number",
"numoutlets" : 2,
"id" : "obj-81",
"patching_rect" : [ 544.0, 513.0, 67.0, 22.0 ],
"outlettype" : [ "", "bang" ],
"style" : "",
"numinlets" : 1,
"parameter_enable" : 0
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "query",
"numoutlets" : 1,
"id" : "obj-79",
"patching_rect" : [ 568.0, 318.0, 41.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "toggle",
"numoutlets" : 1,
"id" : "obj-77",
"patching_rect" : [ 568.0, 258.0, 24.0, 24.0 ],
"outlettype" : [ "int" ],
"style" : "",
"numinlets" : 1,
"parameter_enable" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "qmetro 2000",
"numoutlets" : 1,
"id" : "obj-75",
"patching_rect" : [ 568.0, 289.0, 78.0, 22.0 ],
"outlettype" : [ "bang" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "newline",
"numoutlets" : 0,
"id" : "obj-74",
"patching_rect" : [ 327.0, 276.0, 50.0, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "button",
"numoutlets" : 1,
"id" : "obj-72",
"patching_rect" : [ 296.5, 276.0, 24.0, 24.0 ],
"outlettype" : [ "bang" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "cr",
"numoutlets" : 1,
"id" : "obj-66",
"patching_rect" : [ 296.5, 309.0, 29.5, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "SAVE FILE",
"numoutlets" : 0,
"id" : "obj-59",
"patching_rect" : [ 267.0, 62.0, 76.5, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "button",
"numoutlets" : 1,
"id" : "obj-60",
"patching_rect" : [ 232.0, 62.0, 24.0, 24.0 ],
"outlettype" : [ "bang" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "filename to be written",
"numoutlets" : 0,
"id" : "obj-58",
"patching_rect" : [ 90.75, 416.0, 129.0, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "rec_2021-3-17_23-36-55_session.txt",
"linecount" : 2,
"numoutlets" : 1,
"id" : "obj-56",
"patching_rect" : [ 33.5, 359.0, 191.0, 36.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "prepend write",
"numoutlets" : 1,
"id" : "obj-54",
"patching_rect" : [ 33.5, 501.0, 83.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "clear",
"numoutlets" : 1,
"id" : "obj-53",
"patching_rect" : [ 286.75, 379.0, 37.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "NEW FILE",
"numoutlets" : 0,
"id" : "obj-51",
"patching_rect" : [ 63.0, 64.0, 76.5, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "button",
"numoutlets" : 1,
"id" : "obj-48",
"patching_rect" : [ 33.5, 62.0, 24.0, 24.0 ],
"outlettype" : [ "bang" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sprintf rec_%i-%i-%i_%i-%i-%i_%s.txt",
"numoutlets" : 1,
"id" : "obj-44",
"patching_rect" : [ 33.5, 297.0, 212.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 7
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "unpack i i i",
"numoutlets" : 3,
"id" : "obj-43",
"patching_rect" : [ 135.5, 238.0, 87.0, 22.0 ],
"outlettype" : [ "int", "int", "int" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "unpack i i i",
"numoutlets" : 3,
"id" : "obj-42",
"patching_rect" : [ 33.5, 238.0, 89.0, 22.0 ],
"outlettype" : [ "int", "int", "int" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "time",
"numoutlets" : 1,
"id" : "obj-41",
"patching_rect" : [ 76.5, 167.0, 33.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "date",
"numoutlets" : 1,
"id" : "obj-35",
"patching_rect" : [ 33.5, 167.0, 34.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "date",
"numoutlets" : 3,
"id" : "obj-31",
"patching_rect" : [ 33.5, 201.0, 181.0, 22.0 ],
"outlettype" : [ "list", "list", "int" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "text",
"numoutlets" : 3,
"id" : "obj-24",
"patching_rect" : [ 359.0, 478.0, 204.0, 22.0 ],
"outlettype" : [ "", "bang", "int" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "udpreceive 7000",
"numoutlets" : 1,
"id" : "obj-23",
"patching_rect" : [ 359.0, 225.0, 99.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "udpsend 127.0.0.1 7000",
"numoutlets" : 0,
"id" : "obj-22",
"patching_rect" : [ 770.0, 339.0, 140.0, 22.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "test sender",
"numoutlets" : 0,
"id" : "obj-21",
"patching_rect" : [ 770.0, 146.0, 150.0, 20.0 ],
"style" : "",
"numinlets" : 1
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "/t-stick/signal01 25",
"numoutlets" : 1,
"id" : "obj-19",
"patching_rect" : [ 784.0, 310.0, 126.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "toggle",
"numoutlets" : 1,
"id" : "obj-15",
"patching_rect" : [ 770.0, 171.0, 24.0, 24.0 ],
"outlettype" : [ "int" ],
"style" : "",
"numinlets" : 1,
"parameter_enable" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "qmetro 100",
"numoutlets" : 1,
"id" : "obj-13",
"patching_rect" : [ 770.0, 205.0, 71.0, 22.0 ],
"outlettype" : [ "bang" ],
"style" : "",
"numinlets" : 2
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "counter 0 1 100",
"numoutlets" : 4,
"id" : "obj-12",
"patching_rect" : [ 770.0, 239.0, 94.0, 22.0 ],
"outlettype" : [ "int", "", "", "int" ],
"style" : "",
"numinlets" : 5
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "prepend /t-stick/signal01",
"numoutlets" : 1,
"id" : "obj-5",
"patching_rect" : [ 770.0, 277.0, 141.0, 22.0 ],
"outlettype" : [ "" ],
"style" : "",
"numinlets" : 1
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-72", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-14", 1 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-72", 0 ],
"destination" : [ "obj-11", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-79", 0 ],
"destination" : [ "obj-24", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-77", 0 ],
"destination" : [ "obj-75", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-75", 0 ],
"destination" : [ "obj-79", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-75", 0 ],
"destination" : [ "obj-56", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-72", 0 ],
"destination" : [ "obj-66", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-66", 0 ],
"destination" : [ "obj-24", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-60", 0 ],
"destination" : [ "obj-56", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-56", 0 ],
"destination" : [ "obj-54", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-54", 0 ],
"destination" : [ "obj-24", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-53", 0 ],
"destination" : [ "obj-24", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-22", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-19", 1 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-48", 0 ],
"destination" : [ "obj-53", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-48", 0 ],
"destination" : [ "obj-41", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-48", 0 ],
"destination" : [ "obj-35", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-48", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-44", 0 ],
"destination" : [ "obj-56", 1 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-43", 0 ],
"destination" : [ "obj-44", 3 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-43", 1 ],
"destination" : [ "obj-44", 4 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-43", 2 ],
"destination" : [ "obj-44", 5 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-42", 0 ],
"destination" : [ "obj-44", 1 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-42", 1 ],
"destination" : [ "obj-44", 2 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-42", 2 ],
"destination" : [ "obj-44", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-41", 0 ],
"destination" : [ "obj-31", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-35", 0 ],
"destination" : [ "obj-31", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-31", 1 ],
"destination" : [ "obj-43", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-31", 0 ],
"destination" : [ "obj-42", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-27", 0 ],
"destination" : [ "obj-48", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-24", 2 ],
"destination" : [ "obj-81", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-10", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-15", 0 ],
"destination" : [ "obj-13", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-14", 0 ],
"destination" : [ "obj-24", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-13", 0 ],
"destination" : [ "obj-12", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-12", 0 ],
"destination" : [ "obj-5", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-14", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-44", 6 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-77", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
],
"appversion" : {
"major" : 7,
"minor" : 2,
"revision" : 3,
"architecture" : "x64",
"modernui" : 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment