docs: new material theme, reorganize (wip)
This commit is contained in:
parent
02d4bd5b17
commit
a9b0a8725e
29 changed files with 498 additions and 503 deletions
77
resources/docs/widgets/buttons.md
Normal file
77
resources/docs/widgets/buttons.md
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# Buttons
|
||||
|
||||
Buttons are exactly what you think they are.
|
||||
|
||||
|
||||
|
||||
## Toggle
|
||||
```js
|
||||
{
|
||||
type:'toggle',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `on`
|
||||
- type: `string|number|object`
|
||||
- default: `1`
|
||||
- usage: defines which value is sent on `on` position
|
||||
- set to `null` to send send no argument in the osc message
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](../widgets-properties.md#preargs))
|
||||
|
||||
### `off`
|
||||
- type: `string|number|object`
|
||||
- default: `0`
|
||||
- usage: defines which value is sent on `off` position
|
||||
- set to `null` to send send no argument in the osc message
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](../widgets-properties.md#preargs))
|
||||
|
||||
|
||||
|
||||
|
||||
## Push
|
||||
```js
|
||||
{
|
||||
type:'push',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `on`
|
||||
- type: `string|number|object`
|
||||
- default: `1`
|
||||
- usage: defines which value is sent when pushing the button
|
||||
- set to `null` to send send no argument in the osc message
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](../widgets-properties.md#preargs))
|
||||
|
||||
### `off`
|
||||
- type: `string|number|object`
|
||||
- default: `0`
|
||||
- usage: defines which value is sent when releasing the button
|
||||
- set to `null` to send send no argument in the osc message
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](../widgets-properties.md#preargs))
|
||||
|
||||
### `norelease`
|
||||
- type: `bool`
|
||||
- default: `false`
|
||||
- usage: set to true to prevent sending any osc message when releasing the button
|
||||
|
||||
Setting the `push`'s value externally (via osc) will toggle it's inner light.
|
||||
|
||||
|
||||
|
||||
|
||||
## Switch
|
||||
```js
|
||||
{
|
||||
type:'switch',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `values`
|
||||
- type: `array|object`
|
||||
- default: `{"Value 1":1,"Value 2":2}`
|
||||
- usage:
|
||||
- `array` of possible values to switch between : `[1,2,3]`
|
||||
- `object` of `"label":value` pairs
|
||||
110
resources/docs/widgets/containers.md
Normal file
110
resources/docs/widgets/containers.md
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
# Containers
|
||||
|
||||
Containers can contain any widgets.
|
||||
|
||||
|
||||
## Panel
|
||||
|
||||
Panels can contains tabs or widgets. These can be absolutely positioned and can overflow their parent's size (which will then display scrollbars). When a panel contains tabs, it can send and receive its active tab's index through osc.
|
||||
|
||||
|
||||
```js
|
||||
{
|
||||
type:'panel',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `scroll`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to disable scrollbars
|
||||
|
||||
### `widgets`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage: each element of the `array` must be a widget `object`. A panel cannot contain widgets and tabs simultaneously.
|
||||
|
||||
### `tabs`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage: each element of the `array` must be a tab `object`. A panel cannot contain widgets and tabs simultaneously.
|
||||
|
||||
|
||||
### `variables`
|
||||
- type: `*`
|
||||
- default: `@{parent.variables}`
|
||||
- usage: defines one or more arbitrary variables that can be inherited by children widgets.
|
||||
- examples:
|
||||
- `1` (`@{parent.variables}` will return `1`)
|
||||
- `{a: [1, 2], b: 2}` (`@{parent.variables.a}` will return `[1, 2]`)
|
||||
- `[1, 2]` (`@{parent.variables.0}` will return `1`)
|
||||
- `@{parent.variables}` useful when nesting containers
|
||||
|
||||
|
||||
### `layout`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: `layout` must be a valid [Visual Format Language](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html) expression. It accepts the [Extended Visual Format Language](https://github.com/IjzerenHein/autolayout.js#extended-visual-format-language-evfl) as well. Widgets are targeted using their `id` or their index prefixed with a `$` (`$0, $1, etc`), the latter method being incompatible with the [range spread operator](https://github.com/IjzerenHein/autolayout.js#view-ranges-spread-operator). Expressions can be tested and debugged with the online [Visual Format Editor](https://rawgit.com/IjzerenHein/visualformat-editor/master/dist/index.html).
|
||||
- note: this only applies when the panel contains widgets, not tabs
|
||||
|
||||
### `spacing`
|
||||
- type: `integer|array`
|
||||
- default: `0`
|
||||
- usage: spacing size used in `layout` expression, can be set as a `[vertical,horizontal]` array.
|
||||
- note: this only applies when the panel contains widgets, not tabs
|
||||
|
||||
|
||||
|
||||
## Strip
|
||||
|
||||
Unidirectionnal panel with stretching capability. By default, children widgets that don't have an explicit `width`/`height` set will be shrinked to respect the sizes specified by others. Adding `flex:1;` to a children's `css` will give it the ability the fill the remaining space. Multiple children can have a `flex:x;` css property (`x` will ponderate their expansion).
|
||||
|
||||
```js
|
||||
{
|
||||
type:'strip',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `horizontal`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display widgets horizontally
|
||||
|
||||
### `stretch`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to stretch widgets evenly
|
||||
|
||||
### `widgets`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage: each element of the `array` must be a widget `object`
|
||||
|
||||
|
||||
|
||||
|
||||
## Modal
|
||||
|
||||
Modals are buttons that turn into a centered popup panels when enabled. They can only contain widgets. They can send and receive their state via osc (1 to enable, 0 to disable).
|
||||
|
||||
```js
|
||||
{
|
||||
type:'modal',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the modal require a double tap to open instead of a single tap
|
||||
|
||||
### `popupWidth` / `popupHeight`
|
||||
- type: `number|percentage`
|
||||
- default: `100%`
|
||||
- usage: sets the modal's size once opened
|
||||
|
||||
### `options`
|
||||
- see panel's [`options`](#panel)
|
||||
38
resources/docs/widgets/maths.md
Normal file
38
resources/docs/widgets/maths.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Maths
|
||||
|
||||
Maths do the maths !
|
||||
|
||||
|
||||
|
||||
## Formula
|
||||
|
||||
Formula evaluates mathematical expressions over other widgets' values each one of these widgets changes.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'formula',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### `formula`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: a [mathjs](http://mathjs.org/docs/expressions/syntax.html) expression in which
|
||||
- `${id}` will be replaced the `id`'s value
|
||||
- example: `${fader_1} * 2 + ${fader_2}`
|
||||
- **important note**: contrary to what is stated in *mathjs*' documentation, **matrix indexes are zero-based** here
|
||||
|
||||
### `condition`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage:
|
||||
- a [mathjs](http://mathjs.org/docs/expressions/syntax.html) comparison expression that bypasses widget's osc sending when returning`false`
|
||||
- example: `${fader_1} > 0.5`
|
||||
|
||||
### `split`
|
||||
- type: `object`
|
||||
- default: `[]`
|
||||
- usage: specify a different `address` for each item of the widget's value : `['/a', '/b']`
|
||||
- note: only use this is the formula return an `array`
|
||||
175
resources/docs/widgets/matrices.md
Normal file
175
resources/docs/widgets/matrices.md
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
# Matrices
|
||||
|
||||
Matrices are special containers that only contain one type of widget. All contained widgets will be traversed by single dragging gestures.
|
||||
|
||||
## Multifader
|
||||
|
||||
Multifader creates a row of vertical faders that respond to the same gestures.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'multifader',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `strips`
|
||||
- type: `integer`
|
||||
- default: `2`
|
||||
- usage: number of faders in the row, each fader will inherit its parent's properties and the following ones (where `i` is the fader's index in the row)
|
||||
- `id`: same as the widget's with `/i` appended to it
|
||||
- `label`: `i`
|
||||
- `address`: same as the widget's with `/i` appended to it
|
||||
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: first faders's index
|
||||
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
|
||||
### `split`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: if `true`, the fader's index will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
|
||||
### `color`
|
||||
- type: `string|array`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: can be an `array` of css color `strings`, which will be sequentially passed to the faders
|
||||
|
||||
### `options`
|
||||
- see fader's [`options`](sliders/#fader)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Multitoggle
|
||||
```js
|
||||
{
|
||||
type:'multitoggle',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `matrix`
|
||||
- type: `array`
|
||||
- default: `[2,2]`
|
||||
- usage: defines the number of columns and and rows. Each cell will contain a toggle button that will inherit its parent's properties and the following ones (where `i` is the fader's index in the row)
|
||||
- `id`: same as the widget's with `/i` appended to it
|
||||
- `label`: `i`
|
||||
- `address`: same as the widget's with `/i` appended to it
|
||||
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: first toggle's index
|
||||
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
|
||||
### `split`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: if `true`, the toggle's index will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
|
||||
### `color`
|
||||
- type: `string|array`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: can be an `array` of css color `strings`, which will be sequentially passed to the toggles
|
||||
|
||||
|
||||
|
||||
### `options`
|
||||
- see toggle's [`options`](buttons/#toggle)
|
||||
|
||||
|
||||
|
||||
## Multipush
|
||||
```js
|
||||
{
|
||||
type:'multipush',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `matrix`
|
||||
- type: `array`
|
||||
- default: `[2,2]`
|
||||
- usage: defines the number of columns and and rows. Each cell will contain a push button that will inherit its parent's properties and the following ones (where `i` is the fader's index in the row)
|
||||
- `id`: same as the widget's with `/i` appended to it
|
||||
- `label`: `i`
|
||||
- `address`: same as the widget's with `/i` appended to it
|
||||
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: first push's index
|
||||
|
||||
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
|
||||
### `split`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: if `true`, the push's index will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
|
||||
### `color`
|
||||
- type: `string|array`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: can be an `array` of css color `strings`, which will be sequentially passed to the pushes
|
||||
|
||||
### `options`
|
||||
- see push's [`options`](buttons/#push)
|
||||
|
||||
|
||||
|
||||
## Keyboard
|
||||
|
||||
This one works pretty much like the multipush, excepts it looks like a piano keyboard ad
|
||||
|
||||
```js
|
||||
{
|
||||
type:'keyboard',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `keys`
|
||||
- type: `integer`
|
||||
- default: `24`
|
||||
- usage: defines the number keys
|
||||
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `60`
|
||||
- usage: MIDI note number to start with (default is C4)
|
||||
|
||||
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
|
||||
### `split`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: if `true`, the note's midi code will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
|
||||
### `options`
|
||||
- see push's [`options`](buttons/#push)
|
||||
|
||||
### `css`
|
||||
```
|
||||
--color-white:color; /* white keys color */
|
||||
--color-black:color; /* black keys color */
|
||||
```
|
||||
148
resources/docs/widgets/pads.md
Normal file
148
resources/docs/widgets/pads.md
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
# Pads
|
||||
|
||||
Pads are multidimensional widgets that output multiple values.
|
||||
|
||||
|
||||
|
||||
## XY
|
||||
|
||||
```js
|
||||
{
|
||||
type:'xy',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### `rangeX`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `x` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
### `rangeY`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `logScaleY`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
|
||||
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
||||
### `spring`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: when set to `true`, the widget will go back to its initial value when released.
|
||||
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the xy reset to its initial value when receiving a double tap
|
||||
|
||||
### `split`
|
||||
- type: `boolean|object`
|
||||
- default: `false`
|
||||
- usage:
|
||||
- set to `true` to send separate osc messages for `x` and `y` axis. The `address` will be the same as the widget's with `/x` or `/y` appended to it
|
||||
- can be set as an object to specify a different `address` : `['/osc_address_x', '/osc_address_y']`
|
||||
- note: the widget will only respond to its original osc address, not to the splitted version
|
||||
|
||||
|
||||
|
||||
## MultiXy
|
||||
|
||||
```js
|
||||
{
|
||||
type:'multixy',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `points`
|
||||
- type: `integer|array`
|
||||
- default: `2`
|
||||
- usage: defines the number of points on the pad. Can be an `array` of `strings` that will be used as labels for the points (ex: `['A', 'B']`)
|
||||
|
||||
### `pointSize`
|
||||
- type: `integer`
|
||||
- default: `15`
|
||||
- usage: defines the points's size
|
||||
|
||||
### `rangeX`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `x` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
### `rangeY`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `logScaleY`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
|
||||
|
||||
### `split`
|
||||
- type: `boolean|object`
|
||||
- default: `false`
|
||||
- usage:
|
||||
- set to `true` to send separate osc messages for each point's `x` and `y` axis. The `address` will be the same as the widget's with `/N/x` or `/N/y` appended to it, where `N` is the point's id (or the point's label if `points` is an `array`).
|
||||
- can be set as an object to specify a different `address` : `['/0/x', '/0/y', '/1/x', '/2/y']`
|
||||
- note: the widget will only respond to its original osc address, not to the splitted version
|
||||
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, the points are dragged from their initial position; if set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates (one per touch).
|
||||
|
||||
|
||||
|
||||
## RGB
|
||||
|
||||
RGB is a variant of XY, it outputs rgb values between 0 and 255.
|
||||
|
||||
|
||||
```js
|
||||
{
|
||||
type:'rgb',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### `precision`
|
||||
- default:`0`
|
||||
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position.
|
||||
|
||||
### `split`
|
||||
- type: `boolean|object`
|
||||
- default: `false`
|
||||
- usage:
|
||||
- set to `true` to send separate osc messages for `r` and `g` & `b`. The `address` will be the same as the widget's with `/r`, `/g` or `/b` appended to it
|
||||
- can be set as an object to specify a different `address` : `['/r', '/b', '/b']`
|
||||
211
resources/docs/widgets/plots.md
Normal file
211
resources/docs/widgets/plots.md
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
# Plots
|
||||
|
||||
Plots are tools that display other widgets' state or incomming osc messages. They are not sensitive to mouse and touch interactions.
|
||||
|
||||
## Led
|
||||
```js
|
||||
{
|
||||
type:'led',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` value the led's intensity will be mapped to
|
||||
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to true use logarithmic scaling
|
||||
|
||||
|
||||
## RgbLed
|
||||
|
||||
```js
|
||||
{
|
||||
type:'rgbled',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
This one is like the `led` except it takes three arguments (red, green and blue values between 0 and 255) with an optionnal forth argument (alpha, between 0 and 1)
|
||||
|
||||
|
||||
## Plot
|
||||
|
||||
The plot receives an array of [x,y] coordinates and draws them on a chart with linear or logarithmic interpolation.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'plot',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `points`
|
||||
- type: `array|string`
|
||||
- default: `[]`
|
||||
- usage:
|
||||
- as a `string`: a widget's `id` whose multiple values will be displayed on the `y` axis, evenly spaced on the `x` axis (only *[matrices](matrices.md)* and *[pads](pads.md)* will work)
|
||||
- as an `array`: each element must be an `array` of `[x,y]` coordinates, where `x` and `y` can either be a:
|
||||
- `number`: constant values
|
||||
- `string`: a widget's `id` whose value will be used
|
||||
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{
|
||||
x:{"min":0,"max":1},
|
||||
y:{"min":0,"max":1}
|
||||
}`
|
||||
- usage: defines the `min` and `max` values for the `x` and `y` axis
|
||||
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `logScaleY`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
|
||||
|
||||
### `origin`
|
||||
- type: `number`
|
||||
- default: `auto`
|
||||
- usage: defines the y-axis origin. Set to `false` to disable it.
|
||||
|
||||
## Eq
|
||||
|
||||
The Eq receives an array of filter objects and draws their frequency response between 20Hz and 22050Hz.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'eq',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `filters`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage:
|
||||
- each item must be an object of the form below
|
||||
- all filters parameters can be filled with widget ids, whose value will be used
|
||||
|
||||
```
|
||||
{
|
||||
type:[string], // "highpass", "highshelf", "lowpass", "lowshelf", "peak", "notch"
|
||||
freq:[number], //
|
||||
q:[number], //
|
||||
gain:[number], //
|
||||
on:[bool] // 1 or true = active, 0 or false = bypassed
|
||||
}
|
||||
```
|
||||
|
||||
### `resolution`
|
||||
- type: `number`
|
||||
- default: `128`
|
||||
- usage: defines the number of points used to compute the frequency response
|
||||
|
||||
### `rangeY`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":-20,"max":20}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis (dB level)
|
||||
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `origin`
|
||||
- type: `number`
|
||||
- default: `auto`
|
||||
- usage: defines the y-axis origin. Set to `false` to disable it.
|
||||
|
||||
## Visualizer
|
||||
|
||||
The visualizer displays the evolution in time of a received value (through osc) *or* another widget's value.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'visualizer',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `object`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be displayed (thus bypassing the incoming osc)
|
||||
|
||||
### `duration`
|
||||
- type: `number`
|
||||
- default: `1`
|
||||
- usage: window size in seconds
|
||||
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis
|
||||
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` use logarithmic scaling (log10)
|
||||
|
||||
### `origin`
|
||||
- type: `number`
|
||||
- default: `auto`
|
||||
- usage: defines the y-axis origin. Set to `false` to disable it.
|
||||
|
||||
## Text
|
||||
|
||||
Text displays incoming values (via osc) as text. Sending a message with no argument to the widget will reset it to its default text.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'text',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `object`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be displayed
|
||||
|
||||
### `vertical`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` display vertically
|
||||
|
||||
## Meter
|
||||
|
||||
Meter displays incoming numerical values (via osc) as a gauge level
|
||||
|
||||
```js
|
||||
{
|
||||
type:'meter',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `object`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be displayed
|
||||
|
||||
### `horizontal`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display the meter horizontally
|
||||
|
||||
### `range`
|
||||
- see fader's [`range`](sliders/#fader)
|
||||
|
||||
### `logScale`
|
||||
- see fader's [`logScale`](sliders/#fader)
|
||||
233
resources/docs/widgets/sliders.md
Normal file
233
resources/docs/widgets/sliders.md
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
# Sliders
|
||||
|
||||
Sliders are unidimensional widgets that output one value at a time.
|
||||
|
||||
|
||||
|
||||
## Fader
|
||||
```js
|
||||
{
|
||||
type:'fader',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `horizontal`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display the fader horizontally
|
||||
|
||||
### `alignRight`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to invert the pip's and fader's position
|
||||
|
||||
### `noPip`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to hide the scale
|
||||
|
||||
### `compact`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display a compact alternative for the widget. Disables default mouse/touch focusing on the value display (right-click/long-touch still triggers it).
|
||||
|
||||
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: `range` defines the breakpoints of the fader's scale
|
||||
- keys can be percentages and/or `min` / `max`
|
||||
- values can be `number` or `object` if a custom label is needed
|
||||
- example:
|
||||
```js
|
||||
range: {
|
||||
"min":0,
|
||||
"50%":1,
|
||||
"max": {"inf":10} // "inf" will be used as a custom label on the scale
|
||||
}
|
||||
```
|
||||
|
||||
### `origin`
|
||||
- type: `number`
|
||||
- default: `auto`
|
||||
- usage: `origin` defines the starting point's value of the fader's gauge
|
||||
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` use logarithmic scaling between breakpoints (log10)
|
||||
|
||||
|
||||
### `unit`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
|
||||
|
||||
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
||||
### `spring`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: when set to `true`, the widget will go back to its initial value when released.
|
||||
|
||||
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the fader reset to its initial value when receiving a double tap
|
||||
|
||||
### `meter`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to true to display a vu-meter next in the fader
|
||||
- the meter's `id` will be the same as the widget's with `/meter` appended to it
|
||||
- the meter's `address `will be the same as the widget's with `/meter` appended to it
|
||||
|
||||
### `meterAddress`
|
||||
- type: `boolean`
|
||||
- default: `empty`
|
||||
- usage: overrides the `meter`'s osc address
|
||||
|
||||
### `css`
|
||||
```
|
||||
--color-gauge:color;
|
||||
--color-knob:color;
|
||||
--color-pips:color;
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Knob
|
||||
|
||||
```js
|
||||
{
|
||||
type:'knob',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### `noPip`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to show the scale
|
||||
|
||||
### `compact`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display a compact alternative for the widget. Disables mouse/touch focusing on the value display.
|
||||
|
||||
### `angle`
|
||||
- type: `number`
|
||||
- default: `270`
|
||||
- usage: `angle` defines the angle's width of the knob, in degrees
|
||||
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: `range` defines the breakpoints of the fader's scale
|
||||
- keys can be percentages and/or `min` / `max`
|
||||
- values can be `number` or `object` if a custom label is needed
|
||||
- example:
|
||||
```js
|
||||
range: {
|
||||
"min":0,
|
||||
"50%":1,
|
||||
"max": {"inf":10} // "inf" will be used as a custom label on the scale
|
||||
}
|
||||
```
|
||||
|
||||
### `origin`
|
||||
- type: `number`
|
||||
- default: `auto`
|
||||
- usage: `origin` defines the starting point's value of the knob's gauge
|
||||
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` use logarithmic scaling between breakpoints
|
||||
|
||||
|
||||
### `unit`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
|
||||
|
||||
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget *vertically* will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
||||
### `spring`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: when set to `true`, the widget will go back to its initial value when released.
|
||||
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the knob reset to its initial value when receiving a double tap
|
||||
|
||||
### `css`
|
||||
```
|
||||
--color-gauge:color;
|
||||
--color-knob:color;
|
||||
--color-pips:color;
|
||||
```
|
||||
|
||||
## Encoder
|
||||
|
||||
An endless knob that only responds to rotative gestures.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'encoder',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `ticks`
|
||||
- type: `number`
|
||||
- default: `360`
|
||||
- usage: defines the granularity / verbosity of the encoder (number of step for a 360° arc)
|
||||
|
||||
### `back`
|
||||
- type: `string|number|object`
|
||||
- default: `-1`
|
||||
- usage: defines which value is sent when rotating the encoder anticlockwise
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](../widgets-properties.md#preargs))
|
||||
|
||||
### `forth`
|
||||
- type: `string|number|object`
|
||||
- default: `1`
|
||||
- usage: defines which value is sent when rotating the encoder clockwise
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](../widgets-properties.md#preargs))
|
||||
|
||||
### `release`
|
||||
- type: `string|number|object`
|
||||
- default: `empty`
|
||||
- usage: defines which value is sent when releasing the encoder
|
||||
- set to `null` to send send no argument in the osc message
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](../widgets-properties.md#preargs))
|
||||
|
||||
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the encoder reset to its initial value when receiving a double tap
|
||||
|
||||
### `css`
|
||||
```
|
||||
--color-knob:color;
|
||||
```
|
||||
38
resources/docs/widgets/switchers.md
Normal file
38
resources/docs/widgets/switchers.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Switchers
|
||||
|
||||
Switcher can store and recall the state of other widgets.
|
||||
|
||||
|
||||
|
||||
## Switcher
|
||||
|
||||
The switcher looks like the [`switch`](buttons/#switch). Each of its possible values represent a bank that stores the values from the widgets listed in its `linkedWidgets` attribute.
|
||||
|
||||
|
||||
```js
|
||||
{
|
||||
type:'switcher',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `linkedWidgets`
|
||||
- type: `array|string`
|
||||
- default:
|
||||
`empty`
|
||||
- usage:
|
||||
- as a `string`: a widget's `id` whose state changes will be stored
|
||||
- as an `array`: a list of widget `id` `strings`
|
||||
|
||||
|
||||
### `values`
|
||||
- type: `array|object`
|
||||
- default: `["A", "B"]`
|
||||
- usage:
|
||||
- `array` of possible values to switch between : `[1,2,3]`
|
||||
- `object` of `"label":value` pairs
|
||||
|
||||
|
||||
## Crossfader
|
||||
|
||||
The crossfader is a 2-states-only switcher that comes with a slider allowing to fade from one state to the other by interpolating the values.
|
||||
125
resources/docs/widgets/widgets.md
Normal file
125
resources/docs/widgets/widgets.md
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
# Widgets properties
|
||||
|
||||
All widgets share a set of generic properties described below.
|
||||
|
||||
## Basics
|
||||
|
||||
### `type`
|
||||
- type: `string`
|
||||
- default: `fader`
|
||||
|
||||
### `id`
|
||||
- type: `string`
|
||||
- default: generated unique 'widget_n'
|
||||
- usage: widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages.
|
||||
|
||||
### `linkId`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages.
|
||||
|
||||
|
||||
## Style
|
||||
|
||||
### `label`
|
||||
- type: `string|false`
|
||||
- default: `auto`, which displays `id`
|
||||
- usage:
|
||||
- set to `false` to hide completely
|
||||
- insert icons from [FontAwesome](http://fontawesome.io/icons/) using the prefix `^` followed by the icon's name : `made with ^heart`, etc
|
||||
|
||||
### `top` / `left`
|
||||
- type: `number|percentage`
|
||||
- default: `auto`
|
||||
- usage:
|
||||
- when both `top` and `left` are set to `auto`, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).
|
||||
- otherwise, the widget will be absolutely positioned
|
||||
|
||||
|
||||
### `width` / `height`
|
||||
- type: `number|percentage`
|
||||
- default: `auto`
|
||||
|
||||
### `color`
|
||||
- type: `string`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: any valid `css` color code is valid, this will change the default accent color for the widget and all its children
|
||||
|
||||
|
||||
### `css`
|
||||
- type: `string`
|
||||
- default: *empty*
|
||||
- usage: the `css` property can be used to override inherited [theming](theming.md) variables. Also, some widgets expose specific theming variables that allow a finer customization. Standard `css` properties can be applied to the widget's root element through this property, `css` selectors can also be used apply custom styles to the widget's children.
|
||||
- examples:
|
||||
- `border-radius:5rem; .label {font-size: 20rem}` will round the widget's corners and increase its label's font-size and all its children's labels'
|
||||
- `border-radius:5rem; > .label {font-size: 20rem}` will round the widget's corners and increase its label's font-size (the `>` selector targets only the direct children of the widget element)
|
||||
|
||||
|
||||
## OSC
|
||||
|
||||
|
||||
### `value`
|
||||
- type: `*`
|
||||
- default: `empty`
|
||||
- usage: if set, the widget will be initialized with this `value`. This won't affect linked widgets and won't send any osc message.
|
||||
- note: its `type` must match the widget's value type (ie a `number` for sliders, an `array` for pads, etc). **Changes made to `value` won't be visible until the session is reloaded.**
|
||||
|
||||
|
||||
### `precision`
|
||||
- type: `integer`
|
||||
- default: `2`
|
||||
- usage: the `precision` property defines the number of decimals to display and to send. Set to `0` to send `integers` only.
|
||||
|
||||
### `target`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage:
|
||||
- this defines the targets of the widget's osc messages
|
||||
- each element of the `array` must be a string formatted as follows : `"ip:port"`
|
||||
- multiple targets can be specified : `["ip1:port1","ip2:port2"]`
|
||||
- if no target is set, messages can still be sent if the server has synchronized hosts (`-s / --sync`)
|
||||
- if [`midi`](midi.md) is enabled, targets can be `"midi:device_name"`
|
||||
|
||||
### `address`
|
||||
- type: `string`
|
||||
- default: `/widgets_id`
|
||||
- usage: this is the `address` of the osc messages sent by the widget, it must start with a `/`
|
||||
|
||||
### `touchAddress`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: sliders and pads can send special osc messages to inform weither they are currently touched or not. The osc message will be of the following form :
|
||||
```
|
||||
/touch/address [preArgs] 0/1
|
||||
```
|
||||
|
||||
### `preArgs`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage:
|
||||
- each element of the `array` defines a constant value that will be prepended to the osc message
|
||||
- values can be defined as objects if the type needs to be specified (ie different from the default implied by the `precision`)
|
||||
- example:
|
||||
```js
|
||||
preArgs: [
|
||||
"1", // this will always be sent as a string
|
||||
0.5, // this will be sent as an integer if precision equals 0
|
||||
1, // this will be sent as float if precision is different from 0
|
||||
{
|
||||
type:"f",
|
||||
value:0.5
|
||||
},
|
||||
{
|
||||
type:"i",
|
||||
value:1
|
||||
},
|
||||
{
|
||||
type:"T",
|
||||
value:true
|
||||
},
|
||||
{
|
||||
type:"F",
|
||||
value:false
|
||||
}
|
||||
]
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue