Updated smnp.audio.synth (markdown)

Bartłomiej Przemysław Pluta
2020-03-29 10:31:09 +02:00
parent 56677e9f42
commit 614c1d0b90

@@ -130,7 +130,7 @@ Compiles a given notes to wave, which is represented by list of integers with va
| tuning | `float` | A base frequency for _A4_ sound | 440.0
| envelope | `map<string><>` | A config map that determines wave's envelope with respective parameters | `{ name -> "adsr", p1 -> 0.1, p2 -> 0.3, p3 -> 0.8, s -> 0.8 }`
* `notes` - a list of items intended for compilation to wave. Strings are not supported, however, because of compatibility with [smnp.audio.midi](https://github.com/bartlomiej-pluta/smnp/wiki/smnp.audio.midi/) module are accepted and simply ignored.
* `notes` - a list of items intended for compilation to wave. Strings are not supported, however, because of compatibility with [[smnp.audio.midi]] module are accepted and simply ignored.
#### Output
* `list<int>` - compiled wave ready to be played via `synth()` function
@@ -148,12 +148,12 @@ synth(wave: list<int>) #1
synth(config: map<string><>, notes: ...list<note, int, string>) #2
synth(...notes: list<note, int, string>) #3
```
Synthesises produced wave (`#1`) or calls internaly [smnp.audio::wave](https://github.com/bartlomiej-pluta/smnp/wiki/smnp.audio.synth#wave) function and then synthesises it (`#2`, `#3`).
Synthesises produced wave (`#1`) or calls internaly '[smnp.audio.synth#wave]] function and then synthesises it (`#2`, `#3`).
#### Arguments
* `wave` - a wave in the form of lists of integers with values between 0 and 255 (one byte)
* `config` - see [smnp.audio::wave](https://github.com/bartlomiej-pluta/smnp/wiki/smnp.audio.synth#wave)
* `notes` - see [smnp.audio::wave](https://github.com/bartlomiej-pluta/smnp/wiki/smnp.audio.synth#wave)
* `config` - see [[smnp.audio.synth#wave]]
* `notes` - see [[smnp.audio.synth#wave]]
#### Example
```
@@ -166,7 +166,7 @@ synth(wave);
adsr(p1: float = 0.1, p2: float = 0.3, p3: float = 0.8, s: float = 0.8)
```
Produces ADSR (_Attack-Decay-Sustain-Release_) wave envelope of given parameters. In fact, it produces a config map
that is parsed by [smnp.audio::wave](https://github.com/bartlomiej-pluta/smnp/wiki/smnp.audio.synth#wave) function. Find out more on [[smnp.audio.synth#adsr]].
that is parsed by [smnp.audio.synth#wave]] function. Find out more on [[smnp.audio.synth#adsr]].
#### Arguments
* `p1` - (values between 0.0 and 1.0) the end point of _Attack_
@@ -189,7 +189,7 @@ synth(wave);
constant()
```
Produces constant wave envelope with value of 1.0. In fact, it produces a config map
that is parsed by [smnp.audio::wave](https://github.com/bartlomiej-pluta/smnp/wiki/smnp.audio.synth#wave) function. Find out more on [[smnp.audio.synth#constant]].
that is parsed by [[smnp.audio.synth#wave]] function. Find out more on [[smnp.audio.synth#constant]].
#### Output
* `map<string><string>` - a config map that represents the constant envelope - actually it is exactly `{ name -> "const" }`