test doc structure

This commit is contained in:
Jack Armitage
2019-03-20 11:04:42 +00:00
parent 4c56b8fe20
commit dfb00c640a
4 changed files with 215 additions and 42 deletions

View File

@@ -25,7 +25,7 @@
- [show](#show) - [show](#show)
- [Color](#color) - [Color](#color)
- [contrast](#contrast) - [contrast](#contrast)
- [color](#color) - [color `vec4`](#color-vec4)
- [colorama](#colorama) - [colorama](#colorama)
- [invert](#invert) - [invert](#invert)
- [luma](#luma) - [luma](#luma)
@@ -38,6 +38,8 @@
- [scrollX](#scrollX) - [scrollX](#scrollX)
- [scrollY](#scrollY) - [scrollY](#scrollY)
- [Global variables](#global-variables) - [Global variables](#global-variables)
- [mouse](#mouse)
- [time](#time)
- [Modulators](#modulators) - [Modulators](#modulators)
- [Operators](#operators) - [Operators](#operators)
- [Sources](#sources) - [Sources](#sources)
@@ -95,7 +97,7 @@ Functions for manipulating audio signals.
Functions for manipulating color. Functions for manipulating color.
- [contrast](#contrast) - [contrast](#contrast)
- [color](#color) - [color `vec4`](#color-vec4)
- [colorama](#colorama) - [colorama](#colorama)
- [invert](#invert) - [invert](#invert)
- [luma](#luma) - [luma](#luma)
@@ -109,7 +111,7 @@ Functions for manipulating color.
Larger `amount` value makes higher contrast. Larger `amount` value makes higher contrast.
### color ### color `vec4`
`.color( r, g, b )` `.color( r, g, b )`
@@ -214,3 +216,145 @@ Scale texture.
--- ---
## Global variables
Useful variables that are defined globally, and can be used within functions as a parameter.
- [mouse](#mouse)
- [time](#time)
### mouse
`mouse`
* `.x` :: x position of mouse
* `.y` :: y position of mouse
#### Example
Control the oscillator frequency with the mouse position:
```javascript
osc(() => mouse.x).out(o0)
```
### time
`time`
* `time` :: the current time
#### Example
Control the oscillator using a sine wave based on the current time:
```javascript
osc( ({time}) => Math.sin(time) )
.out(o0)
```
---
## Modulators
Functions for describing modulations of sources.
- [modulate](#modulate)
- [modulateHue](#modulateHue)
- [modulateKaleid](#modulateKaleid)
- [modulatePixelate](#modulatePixelate)
- [modulateRotate](#modulateRotate)
- [modulateScale](#modulateScale)
- [modulateScrollX](#modulateScrollX)
- [modulateScrollY](#modulateScrollY)
### modulate
`.modulate( texture, amount )`
* `texture`
* `color` :: `vec4`, see [color `vec4`](#color-vec4)
* `src` :: see [Sources](#sources)
* `shape` :: see [Sources](#sources)
* `amount` :: float (default `0.1`)
Modulate texture. More about modulation at: <https://lumen-app.com/guide/modulation/>
### modulateHue
`.modulateHue( `color`, `amount` )`
* texture
* color :: vec4
* src
* shape
* amount :: float (default 1.0)
Changes coordinates based on hue of second input. Based on: <https://www.shadertoy.com/view/XtcSWM>
### modulateKaleid
`.modulateKaleid( `nSides` )`
* texture
* color :: vec4
* src
* shape
* nSides :: float (default 4.0)
### modulatePixelate
`.modulatePixelate( `multiple`, `offset` )`
* texture
* color :: vec4
* src
* shape
* multiple :: float (default 10.0)
* offset :: float (default 3.0)
### modulateRotate
`.modulateRotate( `multiple`, `offset` )`
* texture
* color :: vec4
* src
* shape
* multiple :: float (default 1.0)
* offset :: float (default 0.0)
### modulateScale
`.modulateScale( `multiple`, `offset` )`
* texture
* color :: vec4
* src
* shape
* multiple :: float (default 1.0)
* offset :: float (default 1.0)
### modulateScrollX
`.modulateScrollX( `multiple`, `scrollX`, `speed` )`
* texture
* color :: vec4
* src
* shape
* scrollX :: float (default 0.5)
* speed :: float (default 0.0)
### modulateScrollY
`.modulateScrollY( `multiple`, `scrollY`, `speed` )`
* texture
* color :: vec4
* src
* shape
* scrollY :: float (default 0.5)
* speed :: float (default 0.0)
---

View File

@@ -3,7 +3,7 @@
Functions for manipulating color. Functions for manipulating color.
- [contrast](#contrast) - [contrast](#contrast)
- [color](#color) - [color `vec4`](#color-vec4)
- [colorama](#colorama) - [colorama](#colorama)
- [invert](#invert) - [invert](#invert)
- [luma](#luma) - [luma](#luma)
@@ -17,7 +17,7 @@ Functions for manipulating color.
Larger `amount` value makes higher contrast. Larger `amount` value makes higher contrast.
### color ### color `vec4`
`.color( r, g, b )` `.color( r, g, b )`

View File

@@ -1,29 +1,36 @@
# Global variables ## Global variables
Useful variables that are defined globally, and can be used within functions as a parameter. Useful variables that are defined globally, and can be used within functions as a parameter.
- [mouse](#mouse) - [mouse](#mouse)
- [time](#time) - [time](#time)
---
### mouse ### mouse
* .x :: x position of mouse
* .y :: y position of mouse
Example: `mouse`
- Control the oscillator frequency with the mouse position:
``` * `.x` :: x position of mouse
* `.y` :: y position of mouse
#### Example
Control the oscillator frequency with the mouse position:
```javascript
osc(() => mouse.x).out(o0) osc(() => mouse.x).out(o0)
``` ```
### time ### time
Example: `time`
- Control the oscillator using a sine wave based on the current time:
``` * `time` :: the current time
osc(
({time}) => Math.sin(time) #### Example
)
Control the oscillator using a sine wave based on the current time:
```javascript
osc( ({time}) => Math.sin(time) )
.out(o0) .out(o0)
``` ```

View File

@@ -1,28 +1,32 @@
# Modulators ## Modulators
Functions for describing modulations of sources. Functions for describing modulations of sources.
- [.modulate( `texture`, `amount` )](#.modulate( `texture`, `amount` )) - [modulate](#modulate)
- [.modulateHue( `color`, `amount` )](#.modulateHue( `color`, `amount` )) - [modulateHue](#modulateHue)
- [.modulateKaleid( `nSides` )](#.modulateKaleid( `nSides` )) - [modulateKaleid](#modulateKaleid)
- [.modulatePixelate( `multiple`, `offset` )](#.modulatePixelate( `multiple`, `offset` )) - [modulatePixelate](#modulatePixelate)
- [.modulateRotate( `multiple`, `offset` )](#.modulateRotate( `multiple`, `offset` )) - [modulateRotate](#modulateRotate)
- [.modulateScale( `multiple`, `offset` )](#.modulateScale( `multiple`, `offset` )) - [modulateScale](#modulateScale)
- [.modulateScrollX( `multiple`, `scrollX`, `speed` )](#.modulateScrollX( `multiple`, `scrollX`, `speed` )) - [modulateScrollX](#modulateScrollX)
- [.modulateScrollY( `multiple`, `scrollY`, `speed` )](#.modulateScrollY( `multiple`, `scrollY`, `speed` )) - [modulateScrollY](#modulateScrollY)
--- ### modulate
### .modulate( `texture`, `amount` ) `.modulate( texture, amount )`
* texture
* color :: vec4 * `texture`
* src * `color` :: `vec4`, see [color `vec4`](#color-vec4)
* shape * `src` :: see [Sources](#sources)
* amount :: float (default 0.1) * `shape` :: see [Sources](#sources)
* `amount` :: float (default `0.1`)
Modulate texture. More about modulation at: <https://lumen-app.com/guide/modulation/> Modulate texture. More about modulation at: <https://lumen-app.com/guide/modulation/>
### .modulateHue( `color`, `amount` ) ### modulateHue
`.modulateHue( `color`, `amount` )`
* texture * texture
* color :: vec4 * color :: vec4
* src * src
@@ -31,14 +35,20 @@ Modulate texture. More about modulation at: <https://lumen-app.com/guide/modulat
Changes coordinates based on hue of second input. Based on: <https://www.shadertoy.com/view/XtcSWM> Changes coordinates based on hue of second input. Based on: <https://www.shadertoy.com/view/XtcSWM>
### .modulateKaleid( `nSides` ) ### modulateKaleid
`.modulateKaleid( `nSides` )`
* texture * texture
* color :: vec4 * color :: vec4
* src * src
* shape * shape
* nSides :: float (default 4.0) * nSides :: float (default 4.0)
### .modulatePixelate( `multiple`, `offset` ) ### modulatePixelate
`.modulatePixelate( `multiple`, `offset` )`
* texture * texture
* color :: vec4 * color :: vec4
* src * src
@@ -46,7 +56,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* multiple :: float (default 10.0) * multiple :: float (default 10.0)
* offset :: float (default 3.0) * offset :: float (default 3.0)
### .modulateRotate( `multiple`, `offset` ) ### modulateRotate
`.modulateRotate( `multiple`, `offset` )`
* texture * texture
* color :: vec4 * color :: vec4
* src * src
@@ -54,7 +67,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* multiple :: float (default 1.0) * multiple :: float (default 1.0)
* offset :: float (default 0.0) * offset :: float (default 0.0)
### .modulateScale( `multiple`, `offset` ) ### modulateScale
`.modulateScale( `multiple`, `offset` )`
* texture * texture
* color :: vec4 * color :: vec4
* src * src
@@ -62,7 +78,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* multiple :: float (default 1.0) * multiple :: float (default 1.0)
* offset :: float (default 1.0) * offset :: float (default 1.0)
### .modulateScrollX( `multiple`, `scrollX`, `speed` ) ### modulateScrollX
`.modulateScrollX( `multiple`, `scrollX`, `speed` )`
* texture * texture
* color :: vec4 * color :: vec4
* src * src
@@ -70,7 +89,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* scrollX :: float (default 0.5) * scrollX :: float (default 0.5)
* speed :: float (default 0.0) * speed :: float (default 0.0)
### .modulateScrollY( `multiple`, `scrollY`, `speed` ) ### modulateScrollY
`.modulateScrollY( `multiple`, `scrollY`, `speed` )`
* texture * texture
* color :: vec4 * color :: vec4
* src * src