Merge branch 'master' of github.com:jean-emmanuel/open-stage-control
This commit is contained in:
commit
048bf557e6
5 changed files with 110 additions and 3 deletions
|
|
@ -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"
|
||||
|
|
|
|||
106
resources/docs/docs/custom-module/examples.md
Normal file
106
resources/docs/docs/custom-module/examples.md
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
## 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
|
||||
|
||||
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}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
```
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="address">address<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#address" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | OSC address for sending messages, it must start with a / |
|
||||
| <h6 id="address">address<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#address" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | OSC address for sending / receiving messages, it must start with a slash (`/`)<br/><br/>By default ("auto"), the widget's id is used: `/widget_id` |
|
||||
| <h6 id="preArgs">preArgs<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#preArgs" title="Permanent link">#</a></h6> | `*`|<br/>`array` | <code>""</code> | A value or array of values that will be prepended to the OSC messages. |
|
||||
| <h6 id="typeTags">typeTags<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#typeTags" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Defines the osc argument types, one letter per argument (including preArgs)<br/>- If empty, the types are infered automatically from the values (with numbers casted to floats by default)<br/>- If there are more arguments than type letters, the last type is used for the extra arguments<br/><br/>See http://opensoundcontrol.org/spec-1_0 for existing typetags |
|
||||
| <h6 id="decimals">decimals<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#decimals" title="Permanent link">#</a></h6> | `integer` | <code>2</code> | Defines the number of decimals to send. |
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue