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)
- [Color](#color)
- [contrast](#contrast)
- [color](#color)
- [color `vec4`](#color-vec4)
- [colorama](#colorama)
- [invert](#invert)
- [luma](#luma)
@@ -38,6 +38,8 @@
- [scrollX](#scrollX)
- [scrollY](#scrollY)
- [Global variables](#global-variables)
- [mouse](#mouse)
- [time](#time)
- [Modulators](#modulators)
- [Operators](#operators)
- [Sources](#sources)
@@ -95,7 +97,7 @@ Functions for manipulating audio signals.
Functions for manipulating color.
- [contrast](#contrast)
- [color](#color)
- [color `vec4`](#color-vec4)
- [colorama](#colorama)
- [invert](#invert)
- [luma](#luma)
@@ -109,7 +111,7 @@ Functions for manipulating color.
Larger `amount` value makes higher contrast.
### color
### color `vec4`
`.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.
- [contrast](#contrast)
- [color](#color)
- [color `vec4`](#color-vec4)
- [colorama](#colorama)
- [invert](#invert)
- [luma](#luma)
@@ -17,7 +17,7 @@ Functions for manipulating color.
Larger `amount` value makes higher contrast.
### color
### color `vec4`
`.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.
- [mouse](#mouse)
- [time](#time)
---
### mouse
* .x :: x position of mouse
* .y :: y position of mouse
Example:
- Control the oscillator frequency with the mouse position:
```
`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
Example:
- Control the oscillator using a sine wave based on the current time:
```
osc(
({time}) => Math.sin(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)
```

View File

@@ -1,28 +1,32 @@
# Modulators
## Modulators
Functions for describing modulations of sources.
- [.modulate( `texture`, `amount` )](#.modulate( `texture`, `amount` ))
- [.modulateHue( `color`, `amount` )](#.modulateHue( `color`, `amount` ))
- [.modulateKaleid( `nSides` )](#.modulateKaleid( `nSides` ))
- [.modulatePixelate( `multiple`, `offset` )](#.modulatePixelate( `multiple`, `offset` ))
- [.modulateRotate( `multiple`, `offset` )](#.modulateRotate( `multiple`, `offset` ))
- [.modulateScale( `multiple`, `offset` )](#.modulateScale( `multiple`, `offset` ))
- [.modulateScrollX( `multiple`, `scrollX`, `speed` )](#.modulateScrollX( `multiple`, `scrollX`, `speed` ))
- [.modulateScrollY( `multiple`, `scrollY`, `speed` )](#.modulateScrollY( `multiple`, `scrollY`, `speed` ))
- [modulate](#modulate)
- [modulateHue](#modulateHue)
- [modulateKaleid](#modulateKaleid)
- [modulatePixelate](#modulatePixelate)
- [modulateRotate](#modulateRotate)
- [modulateScale](#modulateScale)
- [modulateScrollX](#modulateScrollX)
- [modulateScrollY](#modulateScrollY)
---
### modulate
### .modulate( `texture`, `amount` )
* texture
* color :: vec4
* src
* shape
* amount :: float (default 0.1)
`.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( `color`, `amount` )
### modulateHue
`.modulateHue( `color`, `amount` )`
* texture
* color :: vec4
* 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>
### .modulateKaleid( `nSides` )
### modulateKaleid
`.modulateKaleid( `nSides` )`
* texture
* color :: vec4
* src
* shape
* nSides :: float (default 4.0)
### .modulatePixelate( `multiple`, `offset` )
### modulatePixelate
`.modulatePixelate( `multiple`, `offset` )`
* texture
* color :: vec4
* src
@@ -46,7 +56,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* multiple :: float (default 10.0)
* offset :: float (default 3.0)
### .modulateRotate( `multiple`, `offset` )
### modulateRotate
`.modulateRotate( `multiple`, `offset` )`
* texture
* color :: vec4
* src
@@ -54,7 +67,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* multiple :: float (default 1.0)
* offset :: float (default 0.0)
### .modulateScale( `multiple`, `offset` )
### modulateScale
`.modulateScale( `multiple`, `offset` )`
* texture
* color :: vec4
* src
@@ -62,7 +78,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* multiple :: float (default 1.0)
* offset :: float (default 1.0)
### .modulateScrollX( `multiple`, `scrollX`, `speed` )
### modulateScrollX
`.modulateScrollX( `multiple`, `scrollX`, `speed` )`
* texture
* color :: vec4
* src
@@ -70,7 +89,10 @@ Changes coordinates based on hue of second input. Based on: <https://www.shadert
* scrollX :: float (default 0.5)
* speed :: float (default 0.0)
### .modulateScrollY( `multiple`, `scrollY`, `speed` )
### modulateScrollY
`.modulateScrollY( `multiple`, `scrollY`, `speed` )`
* texture
* color :: vec4
* src