From fde6b7c90de477c372a28d3df4eb40439560dfe7 Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 20 May 2020 13:39:24 +0200 Subject: [PATCH 1/6] docs: fix typo in remote-control /SET --- resources/docs/docs/remote-control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/docs/docs/remote-control.md b/resources/docs/docs/remote-control.md index de3c752e..6a598334 100644 --- a/resources/docs/docs/remote-control.md +++ b/resources/docs/docs/remote-control.md @@ -115,7 +115,7 @@ Same as `/GET` but uses the widget's address instead of `/GET` to reply. ---- -#### `/SET target id value` +#### `/SET id value` Set a widget's value as if it was interacted with from the interface. This is likely to make it send its value. From 28fa4172ffbe5027d3cc318ab2e69759117cd62e Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 20 May 2020 18:32:31 +0200 Subject: [PATCH 2/6] docs: update --- resources/docs/docs/widgets/properties-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index bef02052..20b787cc 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -59,7 +59,7 @@ | property | type |default | description | | --- | --- | --- | --- | - |
address#
| `string` | "auto" | OSC address for sending messages, it must start with a / | + |
address#
| `string` | "auto" | OSC address for sending / receiving messages, it must start with a slash (`/`)

By default ("auto"), the widget's id is used: `/widget_id` | |
preArgs#
| `*`|
`array` | "" | A value or array of values that will be prepended to the OSC messages. | |
typeTags#
| `string` | "" | Defines the osc argument types, one letter per argument (including preArgs)
- If empty, the types are infered automatically from the values (with numbers casted to floats by default)
- If there are more arguments than type letters, the last type is used for the extra arguments

See http://opensoundcontrol.org/spec-1_0 for existing typetags | |
decimals#
| `integer` | 2 | Defines the number of decimals to send. | From ef85302500f2546dea0a6c7fe0546af0ee9b7909 Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 20 May 2020 18:32:46 +0200 Subject: [PATCH 3/6] package: beta 5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bf1d7a7c..4ca4a9b5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.0.0-beta4", + "version": "1.0.0-beta5", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From a1fc5a6dbe97d5f79cbb6257de5f90d712014f50 Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 21 May 2020 21:38:00 +0200 Subject: [PATCH 4/6] docs: add some custom-module examples --- resources/docs/docs/custom-module/examples.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 resources/docs/docs/custom-module/examples.md diff --git a/resources/docs/docs/custom-module/examples.md b/resources/docs/docs/custom-module/examples.md new file mode 100644 index 00000000..2a83ca05 --- /dev/null +++ b/resources/docs/docs/custom-module/examples.md @@ -0,0 +1,108 @@ +## Basic address routing + +```js +module.exports = { + + oscInFilter:function(data){ + + var {address, args, host, port} = data + + if (address === '/some_address') { + address = '/fader_1' + } + + return {address, args, host, port} + + }, + + oscOutFilter:function(data){ + + var {address, args, host, port, clientId} = data + + if (address === '/fader_1') { + address = '/some_address' + } + + return {address, args, host, port} + } + +} +``` + +## Arguments split / merge + +```js + +var xyValue = [0, 0] + +module.exports = { + + oscInFilter:function(data){ + + var {address, args, host, port} = data + + // split + if (address === '/some_xy_address') { + var arg1 = args[0].value, + arg2 = args[1].value + + receive('/fader_1', arg1) + receive('/fader_2', arg2) + + return // bypass original message + } + + return {address, args, host, port} + + }, + + oscOutFilter:function(data){ + + var {address, args, host, port, clientId} = data + + // merge + if (address === '/fader_1') { + + xyValue[0] = args[0].value + send(host, port, '/some_xy_address', ...xyValue) + return // bypass original message + + } else if (address === '/fader_2') { + + xyValue[1] = args[1].value + send(host, port, '/some_xy_address', ...xyValue) + return // bypass original message + + } + + return {address, args, host, port} + } + +} +``` + +## Reply + +```js + +var xyValue = [0, 0] + +module.exports = { + + oscInFilter:function(data){ + + var {address, args, host, port} = data + + if (address === '/knock_knock') { + + send(host, port, '/who_is_there') + + return // bypass original message + } + + return {address, args, host, port} + + }, + +} +``` From a0f95c558b3ce6a0bda621fd1e925764147c7301 Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 21 May 2020 21:40:12 +0200 Subject: [PATCH 5/6] docs: add md --- resources/mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/mkdocs.yml b/resources/mkdocs.yml index 7c21cac2..10b03382 100644 --- a/resources/mkdocs.yml +++ b/resources/mkdocs.yml @@ -50,6 +50,7 @@ nav: - Custom module: - docs/custom-module/custom-module.md - docs/custom-module/managing-big-modules.md + - docs/custom-module/examples.md - Customization: - docs/customization/themes.md - docs/customization/css-tips.md From 45600424a708fdcf220d9ee11f192143d1831eff Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 21 May 2020 21:40:25 +0200 Subject: [PATCH 6/6] docs: clean --- resources/docs/docs/custom-module/examples.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/docs/docs/custom-module/examples.md b/resources/docs/docs/custom-module/examples.md index 2a83ca05..ccca6191 100644 --- a/resources/docs/docs/custom-module/examples.md +++ b/resources/docs/docs/custom-module/examples.md @@ -85,8 +85,6 @@ module.exports = { ```js -var xyValue = [0, 0] - module.exports = { oscInFilter:function(data){