more instructions
This commit is contained in:
30
README.md
30
README.md
@ -28,12 +28,14 @@ To run the application:
|
|||||||
- `Ctrl+I`: initialisation buffer.
|
- `Ctrl+I`: initialisation buffer.
|
||||||
- `Ctrl+L`: local buffers.
|
- `Ctrl+L`: local buffers.
|
||||||
- `F1...F9`: switch to one of the 9 local buffers.
|
- `F1...F9`: switch to one of the 9 local buffers.
|
||||||
|
- `Ctrl+B`: switch between universes.
|
||||||
|
- `Ctrl+Shift+V`: toggle Vim editor mode.
|
||||||
|
|
||||||
To evaluate code, press `Ctrl+Enter` (no visible animation).
|
To evaluate code, press `Ctrl+Enter` (no visible animation). This is true for every buffer. To stop a buffer from playing, comment your code or delete it.
|
||||||
|
|
||||||
# Small tutorial for devs and people passing by :)
|
# Small tutorial for devs and people passing by :)
|
||||||
|
|
||||||
The global buffer is evaluated at a very high rate, for every pulse of the clock. To play your first note, it is best to pick a specific pulse or beat to play on and stick to it. In the global buffer (`Ctrl+G`), write:
|
The global buffer is evaluated at a very high rate, typically for every pulse of the clock. To play your first note, it is best to pick a specific pulse or beat to play on and stick to it. In the global buffer (`Ctrl+G`), write:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
if (mod(12)) beep(400, 0.5);
|
if (mod(12)) beep(400, 0.5);
|
||||||
@ -41,4 +43,26 @@ if (mod(12)) beep(400, 0.5);
|
|||||||
|
|
||||||
Press `Ctrl+Enter` to submit that code for evaluation. If successful, the playback will start immediately and this code will loop on every tick. You can trigger one of the local scripts by using the `script(x)` function that also accepts multiple arguments: (_e.g._ `script(1, 4)`).
|
Press `Ctrl+Enter` to submit that code for evaluation. If successful, the playback will start immediately and this code will loop on every tick. You can trigger one of the local scripts by using the `script(x)` function that also accepts multiple arguments: (_e.g._ `script(1, 4)`).
|
||||||
|
|
||||||
There are no _fancy_ web audio instruments for the moment, just a _beep_ function.
|
To get a glimpse of the intended workflow, let's create a simple musical piece. In your global buffer write:
|
||||||
|
|
||||||
|
```js
|
||||||
|
if (mod(12)) {
|
||||||
|
if Math.random() > 0.5 {
|
||||||
|
script(1);
|
||||||
|
} else {
|
||||||
|
script(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This code will trigger either the first or the second local buffer on every 12th pulse. Now, let's write some code in the first local buffer (`Ctrl+L` and/or `F1`):
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Local file n°1
|
||||||
|
if (sometimes()) beep(400, 0.5);
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Local file n°2
|
||||||
|
if (sometimes()) beep(pick(800, 1200, 1600), 0.5);
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user