Fix: update docs about snd
This commit is contained in:
@@ -17,13 +17,13 @@ Variables let you name values and share data between steps. They are global -- a
|
||||
`,name` stores just like `!name` but keeps the value on the stack. Useful when you want to name something and keep using it:
|
||||
|
||||
```forth
|
||||
440 ,freq sine s . ;; stores 440 in freq AND passes it to the pipeline
|
||||
440 ,freq sine snd . ;; stores 440 in freq AND passes it to the pipeline
|
||||
```
|
||||
|
||||
Without `,`, you'd need `dup`:
|
||||
|
||||
```forth
|
||||
440 dup !freq sine s . ;; equivalent, but noisier
|
||||
440 dup !freq sine snd . ;; equivalent, but noisier
|
||||
```
|
||||
|
||||
## Sharing Between Steps
|
||||
@@ -35,7 +35,7 @@ Variables are shared across all steps. One step can store a value that another r
|
||||
c4 iter 7 mod + !root
|
||||
|
||||
;; step 4: read it
|
||||
@root 7 + note sine s .
|
||||
@root 7 + note sine snd .
|
||||
```
|
||||
|
||||
Every time the pattern loops, step 0 picks a new root. Step 4 always harmonizes with it.
|
||||
@@ -46,7 +46,7 @@ Fetch, modify, store back. A classic pattern for evolving values:
|
||||
|
||||
```forth
|
||||
@n 1 + !n ;; increment n each time this step runs
|
||||
@n 12 mod note sine s . ;; cycle through 12 notes
|
||||
@n 12 mod note sine snd . ;; cycle through 12 notes
|
||||
```
|
||||
|
||||
Reset on some condition:
|
||||
@@ -69,7 +69,7 @@ Store a sound name in a variable, reuse it across steps:
|
||||
"sine" !synth
|
||||
|
||||
;; step 1, 2, 3...
|
||||
c4 note @synth s .
|
||||
c4 note @synth snd .
|
||||
```
|
||||
|
||||
Change one step, all steps follow.
|
||||
|
||||
Reference in New Issue
Block a user