mirror of
https://github.com/hydra-synth/hydra.git
synced 2025-12-15 19:29:58 +01:00
test doc structure
This commit is contained in:
@@ -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)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user