env - config
- config.control
- config.subControl
- config.depth
- config.depthabs
- config.attack
- config.decay
- config.sustain
- config.release
- config.acurve
- config.dcurve
- config.rcurve
- config.fxi
- id
Configures an envelope. Can be called in sequence like pat.env(...).env(...) to set up multiple envelopes There are two ways to declare which control will be modulated:
- Explicitly put
controlin the config (e.g.env({ c: "lpf" })) - If the control parameter is absent, the control immediately before the
envcall will be used (e.g.s("saw").lpf(500).env({ a: 1 })to modulatelpf)
Modulators can be referred to by id so that they can be updated later e.g. inside
a sometimes. See example below.
s("saw").note("F1").lpf(500).env({ a: 1 }) s("saw").env({ d: 1 }).note("F1")
.lpq(4).lpf(50)
.env({ a: 0.1, d: 1, ac: 0.8, dc: 0.3, depth: 50 }) s("saw").lpf(500).diode(0.3)
.env({ c: "lpf", a: 0.5, d: 0.5 }) s("pulse").lpf(500).env({ a: 1 })
.env({ c: "s", a: 1 })
.diode(0.3)
.sometimes(x => x.env({ a: "0.5" }, 1)) // envelope #1 (0-indexed) s("pulse").lpf(500).env({ a: 1 }, 'lpf_mod')
.env({ c: "s", a: 1 })
.diode(0.3)
.sometimes(x => x.env({ a: "0.5" }, 'lpf_mod')) | parameter | type |
|---|---|
| config |
|
| Envelope configuration. | |
| config.control |
|
| Node to modulate. Aliases: c | |
| config.subControl |
|
| Sub-control name to append to the control key. Aliases: sc | |
| config.depth |
|
| Relative modulation depth. Aliases: dep, dr | |
| config.depthabs |
|
| Absolute modulation depth. Aliases: da | |
| config.attack |
|
| Time to reach depth. Aliases: att, a | |
| config.decay |
|
| Time to reach sustain. Aliases: dec, d | |
| config.sustain |
|
| Sustain depth. Aliases: sus, s | |
| config.release |
|
| Time to return to nominal value. Aliases: rel, r | |
| config.acurve |
|
| Snappiness of attack curve (-1 = relaxed, 1 = snappy). Aliases: ac | |
| config.dcurve |
|
| Snappiness of decay curve (-1 = relaxed, 1 = snappy). Aliases: dc | |
| config.rcurve |
|
| Snappiness of release curve (-1 = relaxed, 1 = snappy). Aliases: rc | |
| config.fxi |
|
| FX index to target | |
| id |
|
| ID to use for this modulator | |