Skip to content

Commit

Permalink
feat(docs): patching section of the tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenykochetkov committed Apr 9, 2019
1 parent 85596d7 commit 4f66fe5
Show file tree
Hide file tree
Showing 7 changed files with 513 additions and 0 deletions.
18 changes: 18 additions & 0 deletions workspace/welcome-to-xod/300-creating-nodes/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"comments": [
{
"content": "# Creating your own nodes\n\nIn this part of the tutorial, you will learn how to create our own XOD nodes.\n\nWe will take an existing patch, and *extract* a part of it into a separate node and add pins to control hard-coded parameters. Then we will add labels and descriptions that will be displayed in the help panel for our node, just like in XOD's standard library.",
"id": "HJmjFoNFV",
"position": {
"units": "slots",
"x": 1,
"y": 1
},
"size": {
"height": 3,
"units": "slots",
"width": 7
}
}
]
}
141 changes: 141 additions & 0 deletions workspace/welcome-to-xod/301-create-new-patch/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"comments": [
{
"content": "# Creating a new patch\n\nHere is a patch that checks if a number is between `0.4` and `0.7`. Let's make it reusable. We will make a node that takes three numbers and outputs a boolean. (First number is the one we want to check and other two are boundaries instead of hard-coded `0.4` and `0.7`.)\n\n⚠️ Before you proceed, remember the location of this chapter in the Project Browser to return to it after you complete the instructions.\n\n## Instructions\n\n1. Select `less`, `greater` and `nor` nodes and copy them.\n2. Select File -> New Patch... from the main menu.\n3. Choose a name (`between` is a nice one).\n4. Your new patch will open in a new tab. Paste nodes that you copied earlier inside.\n",
"id": "SkZ6KsEFE",
"position": {
"units": "slots",
"x": -1,
"y": 1
},
"size": {
"height": 5,
"units": "slots",
"width": 8
}
}
],
"links": [
{
"id": "BJosTaOKN",
"input": {
"nodeId": "BktiaTOtV",
"pinKey": "HkXK-dGob"
},
"output": {
"nodeId": "H1_YaadK4",
"pinKey": "rJqfIRdHwkW"
}
},
{
"id": "H1sKTTuKE",
"input": {
"nodeId": "H1_YaadK4",
"pinKey": "S1dG8AOBPJW"
},
"output": {
"nodeId": "BJpLTauYE",
"pinKey": "B19RYS3lW"
}
},
{
"id": "HkO96adK4",
"input": {
"nodeId": "BJpLTauYE",
"pinKey": "rJg00Nhe-"
},
"output": {
"nodeId": "Hy19pauKN",
"pinKey": "ByfGSDjQE"
}
},
{
"id": "SJ5tppdtV",
"input": {
"nodeId": "H1_YaadK4",
"pinKey": "r1tz8CdBDkb"
},
"output": {
"nodeId": "Hkh7TTOtN",
"pinKey": "HktZUCdrPkZ"
}
},
{
"id": "rkDqaadKE",
"input": {
"nodeId": "Hkh7TTOtN",
"pinKey": "HJjZLRdBw1-"
},
"output": {
"nodeId": "Hy19pauKN",
"pinKey": "ByfGSDjQE"
}
}
],
"nodes": [
{
"boundLiterals": {
"HJbACN3gb": "0.7"
},
"id": "BJpLTauYE",
"position": {
"units": "slots",
"x": 12,
"y": 4
},
"type": "xod/core/greater"
},
{
"id": "BktiaTOtV",
"position": {
"units": "slots",
"x": 9,
"y": 7
},
"size": {
"height": 1,
"units": "slots",
"width": 2
},
"type": "xod/debug/watch"
},
{
"id": "H1_YaadK4",
"position": {
"units": "slots",
"x": 9,
"y": 5
},
"type": "xod/core/nor"
},
{
"boundLiterals": {
"SJqZ8COrDkW": "0.4"
},
"id": "Hkh7TTOtN",
"position": {
"units": "slots",
"x": 9,
"y": 4
},
"type": "xod/core/less"
},
{
"boundLiterals": {
"ByfGSDjQE": "0.5"
},
"id": "Hy19pauKN",
"position": {
"units": "slots",
"x": 9,
"y": 2
},
"size": {
"height": 1,
"units": "slots",
"width": 2
},
"type": "xod/debug/tweak-number"
}
]
}
77 changes: 77 additions & 0 deletions workspace/welcome-to-xod/302-check-your-new-patch/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"comments": [
{
"content": "# Check your new patch\n\nIf it looks like this one, you did everything right!\nContinue to the next tutorial.\n",
"id": "Sys38g5FN",
"position": {
"units": "slots",
"x": 0,
"y": 0
},
"size": {
"height": 4,
"units": "slots",
"width": 9
}
}
],
"links": [
{
"id": "BkXJAVectE",
"input": {
"nodeId": "S1-yRVxqK4",
"pinKey": "S1dG8AOBPJW"
},
"output": {
"nodeId": "rklyREgqtN",
"pinKey": "B19RYS3lW"
}
},
{
"id": "BkfyRNgqFE",
"input": {
"nodeId": "S1-yRVxqK4",
"pinKey": "r1tz8CdBDkb"
},
"output": {
"nodeId": "rJyCNl9YE",
"pinKey": "HktZUCdrPkZ"
}
}
],
"nodes": [
{
"id": "S1-yRVxqK4",
"position": {
"units": "slots",
"x": 11,
"y": 2
},
"type": "xod/core/nor"
},
{
"boundLiterals": {
"SJqZ8COrDkW": "0.4"
},
"id": "rJyCNl9YE",
"position": {
"units": "slots",
"x": 11,
"y": 1
},
"type": "xod/core/less"
},
{
"boundLiterals": {
"HJbACN3gb": "0.7"
},
"id": "rklyREgqtN",
"position": {
"units": "slots",
"x": 14,
"y": 1
},
"type": "xod/core/greater"
}
]
}
128 changes: 128 additions & 0 deletions workspace/welcome-to-xod/303-add-terminals/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"comments": [
{
"content": "# Terminals\n\nWe need a way for the between node to get values in and put values out. In XOD patch nodes interact with the outside world using terminal nodes. You can find the terminal nodes in `xod/patch-nodes` library, they are called `input-number`, `input-pulse`, `output-boolean`, etc.\n\nWe already placed an `input-number` and `output-boolean` instead of `tweak-number` and `watch`. Because of them, our node will have one number input pin and one boolean output. You can check it out by highlighting it in Project browser and invoking a help panel.\n\n## Instructions\n\n1. Add two more `input-number`s.\n2. Connect them to `less` and `greater`'s pins instead of hardcoded `0.4` and `0.7` values.\n3. Check how the node looks now in the help panel.\n\nNote that node's pin order is determined by the order of respective terminals. Try adding an `input-string` and moving it between other terminals.",
"id": "rkyWciVFV",
"position": {
"units": "slots",
"x": 0,
"y": 0
},
"size": {
"height": 5,
"units": "slots",
"width": 8
}
}
],
"links": [
{
"id": "BJId0a_FV",
"input": {
"nodeId": "r1gT8CaOYE",
"pinKey": "rJg00Nhe-"
},
"output": {
"nodeId": "SkX_Ca_YV",
"pinKey": "__out__"
}
},
{
"id": "HyfaUCp_FE",
"input": {
"nodeId": "rk-pLC6uYV",
"pinKey": "r1tz8CdBDkb"
},
"output": {
"nodeId": "S1T8RTdKV",
"pinKey": "HktZUCdrPkZ"
}
},
{
"id": "SJsvAaOFN",
"input": {
"nodeId": "ByYwA6dKN",
"pinKey": "__in__"
},
"output": {
"nodeId": "rk-pLC6uYV",
"pinKey": "rJqfIRdHwkW"
}
},
{
"id": "ryVOAp_YE",
"input": {
"nodeId": "S1T8RTdKV",
"pinKey": "HJjZLRdBw1-"
},
"output": {
"nodeId": "SkX_Ca_YV",
"pinKey": "__out__"
}
},
{
"id": "ryma8Cp_t4",
"input": {
"nodeId": "rk-pLC6uYV",
"pinKey": "S1dG8AOBPJW"
},
"output": {
"nodeId": "r1gT8CaOYE",
"pinKey": "B19RYS3lW"
}
}
],
"nodes": [
{
"id": "ByYwA6dKN",
"position": {
"units": "slots",
"x": 10,
"y": 6
},
"type": "xod/patch-nodes/output-boolean"
},
{
"boundLiterals": {
"SJqZ8COrDkW": "0.4"
},
"id": "S1T8RTdKV",
"position": {
"units": "slots",
"x": 10,
"y": 3
},
"type": "xod/core/less"
},
{
"id": "SkX_Ca_YV",
"position": {
"units": "slots",
"x": 10,
"y": 1
},
"type": "xod/patch-nodes/input-number"
},
{
"boundLiterals": {
"HJbACN3gb": "0.7"
},
"id": "r1gT8CaOYE",
"position": {
"units": "slots",
"x": 13,
"y": 3
},
"type": "xod/core/greater"
},
{
"id": "rk-pLC6uYV",
"position": {
"units": "slots",
"x": 10,
"y": 4
},
"type": "xod/core/nor"
}
]
}
Loading

0 comments on commit 4f66fe5

Please sign in to comment.