aboutsummaryrefslogtreecommitdiff
path: root/samples/JSON
diff options
context:
space:
mode:
Diffstat (limited to 'samples/JSON')
-rw-r--r--samples/JSON/Hello.maxhelp367
-rw-r--r--samples/JSON/Hello.maxpat368
-rw-r--r--samples/JSON/person.json23
-rw-r--r--samples/JSON/product.json7
-rw-r--r--samples/JSON/schema.json47
5 files changed, 812 insertions, 0 deletions
diff --git a/samples/JSON/Hello.maxhelp b/samples/JSON/Hello.maxhelp
new file mode 100644
index 0000000..537f567
--- /dev/null
+++ b/samples/JSON/Hello.maxhelp
@@ -0,0 +1,367 @@
+{
+ "patcher" : {
+ "fileversion" : 1,
+ "appversion" : {
+ "major" : 5,
+ "minor" : 1,
+ "revision" : 9
+ }
+,
+ "rect" : [ 198.0, 92.0, 365.0, 407.0 ],
+ "bglocked" : 0,
+ "defrect" : [ 198.0, 92.0, 365.0, 407.0 ],
+ "openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
+ "openinpresentation" : 0,
+ "default_fontsize" : 14.0,
+ "default_fontface" : 0,
+ "default_fontname" : "Arial",
+ "gridonopen" : 0,
+ "gridsize" : [ 20.0, 20.0 ],
+ "gridsnaponopen" : 0,
+ "toolbarvisible" : 1,
+ "boxanimatetime" : 200,
+ "imprint" : 0,
+ "enablehscroll" : 1,
+ "enablevscroll" : 1,
+ "devicewidth" : 0.0,
+ "boxes" : [ {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 260.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-22"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 240.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-20"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 220.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-18"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 200.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-16"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "route 0 1 2 3",
+ "patching_rect" : [ 200.0, 220.0, 99.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 5,
+ "outlettype" : [ "", "", "", "", "" ],
+ "fontsize" : 14.0,
+ "id" : "obj-14"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "r jojo",
+ "patching_rect" : [ 200.0, 180.0, 41.0, 23.0 ],
+ "numinlets" : 0,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ],
+ "id" : "obj-13"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "s jojo",
+ "patching_rect" : [ 20.0, 340.0, 43.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 0,
+ "fontsize" : 14.0,
+ "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ],
+ "id" : "obj-12"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "append toto",
+ "patching_rect" : [ 20.0, 300.0, 84.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "id" : "obj-11"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "% 4",
+ "patching_rect" : [ 20.0, 260.0, 35.0, 23.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-10"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "counter",
+ "patching_rect" : [ 20.0, 220.0, 73.0, 23.0 ],
+ "numinlets" : 5,
+ "fontname" : "Arial",
+ "numoutlets" : 4,
+ "outlettype" : [ "int", "", "", "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-9"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "metro 250",
+ "patching_rect" : [ 20.0, 180.0, 74.0, 23.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "fontsize" : 14.0,
+ "id" : "obj-8"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "toggle",
+ "patching_rect" : [ 20.0, 140.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "id" : "obj-7"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "t 0",
+ "patching_rect" : [ 140.0, 80.0, 26.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-5"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "t 1",
+ "patching_rect" : [ 20.0, 80.0, 26.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-4"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "message",
+ "text" : "Goodbye World !",
+ "patching_rect" : [ 140.0, 40.0, 115.0, 21.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "id" : "obj-3"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "message",
+ "text" : "Hello World !",
+ "patching_rect" : [ 20.0, 40.0, 90.0, 21.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "id" : "obj-2"
+ }
+
+ }
+ ],
+ "lines" : [ {
+ "patchline" : {
+ "source" : [ "obj-2", 0 ],
+ "destination" : [ "obj-4", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-3", 0 ],
+ "destination" : [ "obj-5", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-4", 0 ],
+ "destination" : [ "obj-7", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-5", 0 ],
+ "destination" : [ "obj-7", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ 149.5, 121.0, 29.5, 121.0 ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-7", 0 ],
+ "destination" : [ "obj-8", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-8", 0 ],
+ "destination" : [ "obj-9", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-9", 0 ],
+ "destination" : [ "obj-10", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-10", 0 ],
+ "destination" : [ "obj-11", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-11", 0 ],
+ "destination" : [ "obj-12", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-13", 0 ],
+ "destination" : [ "obj-14", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-14", 0 ],
+ "destination" : [ "obj-16", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-14", 1 ],
+ "destination" : [ "obj-18", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-14", 2 ],
+ "destination" : [ "obj-20", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-14", 3 ],
+ "destination" : [ "obj-22", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+ ]
+ }
+
+}
diff --git a/samples/JSON/Hello.maxpat b/samples/JSON/Hello.maxpat
new file mode 100644
index 0000000..7a27dd2
--- /dev/null
+++ b/samples/JSON/Hello.maxpat
@@ -0,0 +1,368 @@
+{
+ "patcher" : {
+ "fileversion" : 1,
+ "appversion" : {
+ "major" : 5,
+ "minor" : 1,
+ "revision" : 9
+ }
+,
+ "rect" : [ 198.0, 92.0, 365.0, 407.0 ],
+ "bglocked" : 0,
+ "defrect" : [ 198.0, 92.0, 365.0, 407.0 ],
+ "openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
+ "openinpresentation" : 0,
+ "default_fontsize" : 14.0,
+ "default_fontface" : 0,
+ "default_fontname" : "Arial",
+ "gridonopen" : 0,
+ "gridsize" : [ 20.0, 20.0 ],
+ "gridsnaponopen" : 0,
+ "toolbarvisible" : 1,
+ "boxanimatetime" : 200,
+ "imprint" : 0,
+ "enablehscroll" : 1,
+ "enablevscroll" : 1,
+ "devicewidth" : 0.0,
+ "boxes" : [ {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 260.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-22"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 240.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-20"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 220.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-18"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "button",
+ "patching_rect" : [ 200.0, 260.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "id" : "obj-16"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "route 0 1 2 3",
+ "patching_rect" : [ 200.0, 220.0, 99.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 5,
+ "outlettype" : [ "", "", "", "", "" ],
+ "fontsize" : 14.0,
+ "id" : "obj-14"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "r jojo",
+ "patching_rect" : [ 200.0, 180.0, 41.0, 23.0 ],
+ "numinlets" : 0,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ],
+ "id" : "obj-13"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "s jojo",
+ "patching_rect" : [ 20.0, 340.0, 43.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 0,
+ "fontsize" : 14.0,
+ "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ],
+ "id" : "obj-12"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "append toto",
+ "patching_rect" : [ 20.0, 300.0, 84.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "id" : "obj-11"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "% 4",
+ "patching_rect" : [ 20.0, 260.0, 35.0, 23.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-10"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "counter",
+ "patching_rect" : [ 20.0, 220.0, 73.0, 23.0 ],
+ "numinlets" : 5,
+ "fontname" : "Arial",
+ "numoutlets" : 4,
+ "outlettype" : [ "int", "", "", "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-9"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "metro 250",
+ "patching_rect" : [ 20.0, 180.0, 74.0, 23.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "bang" ],
+ "fontsize" : 14.0,
+ "id" : "obj-8"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "toggle",
+ "patching_rect" : [ 20.0, 140.0, 20.0, 20.0 ],
+ "numinlets" : 1,
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "id" : "obj-7"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "t 0",
+ "patching_rect" : [ 140.0, 80.0, 26.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-5"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "newobj",
+ "text" : "t 1",
+ "patching_rect" : [ 20.0, 80.0, 26.0, 23.0 ],
+ "numinlets" : 1,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "int" ],
+ "fontsize" : 14.0,
+ "id" : "obj-4"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "message",
+ "text" : "Goodbye World !",
+ "patching_rect" : [ 140.0, 40.0, 115.0, 21.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "presentation_rect" : [ 137.0, 42.0, 0.0, 0.0 ],
+ "id" : "obj-3"
+ }
+
+ }
+, {
+ "box" : {
+ "maxclass" : "message",
+ "text" : "Hello World !",
+ "patching_rect" : [ 20.0, 40.0, 90.0, 21.0 ],
+ "numinlets" : 2,
+ "fontname" : "Arial",
+ "numoutlets" : 1,
+ "outlettype" : [ "" ],
+ "fontsize" : 14.0,
+ "id" : "obj-2"
+ }
+
+ }
+ ],
+ "lines" : [ {
+ "patchline" : {
+ "source" : [ "obj-14", 3 ],
+ "destination" : [ "obj-22", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-14", 2 ],
+ "destination" : [ "obj-20", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-14", 1 ],
+ "destination" : [ "obj-18", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-14", 0 ],
+ "destination" : [ "obj-16", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-13", 0 ],
+ "destination" : [ "obj-14", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-11", 0 ],
+ "destination" : [ "obj-12", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-10", 0 ],
+ "destination" : [ "obj-11", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-9", 0 ],
+ "destination" : [ "obj-10", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-8", 0 ],
+ "destination" : [ "obj-9", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-7", 0 ],
+ "destination" : [ "obj-8", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-5", 0 ],
+ "destination" : [ "obj-7", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ 149.5, 121.0, 29.5, 121.0 ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-4", 0 ],
+ "destination" : [ "obj-7", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-3", 0 ],
+ "destination" : [ "obj-5", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+, {
+ "patchline" : {
+ "source" : [ "obj-2", 0 ],
+ "destination" : [ "obj-4", 0 ],
+ "hidden" : 0,
+ "midpoints" : [ ]
+ }
+
+ }
+ ]
+ }
+
+}
diff --git a/samples/JSON/person.json b/samples/JSON/person.json
new file mode 100644
index 0000000..2624199
--- /dev/null
+++ b/samples/JSON/person.json
@@ -0,0 +1,23 @@
+{
+ "firstName": "John",
+ "lastName" : "Smith",
+ "age" : 25,
+ "address" :
+ {
+ "streetAddress": "21 2nd Street",
+ "city" : "New York",
+ "state" : "NY",
+ "postalCode" : "10021"
+ },
+ "phoneNumber":
+ [
+ {
+ "type" : "home",
+ "number": "212 555-1234"
+ },
+ {
+ "type" : "fax",
+ "number": "646 555-4567"
+ }
+ ]
+ } \ No newline at end of file
diff --git a/samples/JSON/product.json b/samples/JSON/product.json
new file mode 100644
index 0000000..2d5611a
--- /dev/null
+++ b/samples/JSON/product.json
@@ -0,0 +1,7 @@
+{
+ "id": 1,
+ "name": "Foo",
+ "price": 123,
+ "tags": ["Bar","Eek"],
+ "stock": { "warehouse":300, "retail":20 }
+} \ No newline at end of file
diff --git a/samples/JSON/schema.json b/samples/JSON/schema.json
new file mode 100644
index 0000000..ee580cc
--- /dev/null
+++ b/samples/JSON/schema.json
@@ -0,0 +1,47 @@
+{
+ "name":"Product",
+ "properties":
+ {
+ "id":
+ {
+ "type":"number",
+ "description":"Product identifier",
+ "required":true
+ },
+ "name":
+ {
+ "type":"string",
+ "description":"Name of the product",
+ "required":true
+ },
+ "price":
+ {
+ "type":"number",
+ "minimum":0,
+ "required":true
+ },
+ "tags":
+ {
+ "type":"array",
+ "items":
+ {
+ "type":"string"
+ }
+ },
+ "stock":
+ {
+ "type":"object",
+ "properties":
+ {
+ "warehouse":
+ {
+ "type":"number"
+ },
+ "retail":
+ {
+ "type":"number"
+ }
+ }
+ }
+ }
+} \ No newline at end of file