Documentation for filter envelope

This commit is contained in:
Raphael Forment 2023-09-08 12:38:39 +02:00
parent 18640d59da
commit c5fb247de6
2 changed files with 92 additions and 0 deletions

View File

@ -377,10 +377,61 @@ const generic_params = [
*
*/
[['cutoff', 'resonance'], 'ctf', 'lpf', 'lp'],
/**
* Sets the filter envelope modulation depth.
* @name fenv
* @param {number | Pattern} modulation depth of the filter envelope between 0 and _n_
* @example
* note("c2 c3").fast(2).sound("sawtooth")
* .cutoff(500).fenv("<1 2 3 4 5 6 7 8>")
*/
['fenv'],
/**
* Sets the attack duration for the lowpass filter envelope.
* @name lpattack
* @param {number | Pattern} attack time of the filter envelope
* @synonyms lpa
* @example
* note("c3 e3 f3 g3 ab3 bb3")
* .sound('square').cutoff(1000)
* .lpattack("<0.05 0.1 0.25 0.5>/2").fenv(1)
* .release(0.2).attack(0)
*/
['lpattack', 'lpa'],
/**
* Sets the decay duration for the lowpass filter envelope.
* @name lpdecay
* @param {number | Pattern} decay time of the filter envelope
* @synonyms lpd
* @example
* "baba"
* note("c3 e3 f3 g3 ab3 bb3")
* .sound('square').cutoff(1000)
* .lpdecay("<0.05 0.1 0.125>/2")
* .fenv("4").lps(0).lpr(0)
*/
['lpdecay', 'lpd'],
/**
* Sets the sustain amplitude for the lowpass filter envelope.
* @name lpsustain
* @param {number | Pattern} sustain amplitude of the filter envelope
* @synonyms lps
* @example
* note("c3 e3 f3 g3 ab3 bb3")
* .sound('square').cutoff(200)
* .lpd(0.1).lpsustain("<0.1 0.5 0.75 1>")
* .fenv("2")
*/
['lpsustain', 'lps'],
/**
* Sets the release time for the lowpass filter envelope.
* @name lprelease
* @param {number | Pattern} release time of the filter envelope
* @synonyms lpr
* @example
* note("c3 e3 g3 c4").lpr("<0.1 0.25 0.5>").fenv(0.5)
*/
['lprelease', 'lpr'],
['hpattack', 'hpa'],
['hpdecay', 'hpd'],

View File

@ -78,6 +78,47 @@ Strudel uses ADSR envelopes, which are probably the most common way to describe
<JsDoc client:idle name="release" h={0} />
# Filter Envelope
Each filter can receive an additional filter envelope controlling the cutoff value dynamically. It uses an ADSR envelope similar to the one used for amplitude. There is an additional parameter to control the depth of the filter modulation: `fenv`. This allows you to play subtle or huge filter modulations just the same by only increasing or decreasing the depth.
There is one filter envelope for each filter type and thus one set of envelope filter parameters preceded either by `lp`, `hp` or `bp`:
- `lpattack`, `lpdecay`, `lpsustain`, `lprelease`: filter envelope for the lowpass filter.
- alternatively: `lpa`, `lpd`, `lps` and `lpr`.
- `hpattack`, `hpdecay`, `hpsustain`, `hprelease`: filter envelope for the highpass filter.
- alternatively: `hpa`, `hpd`, `hps` and `hpr`.
- `bpattack`, `bpdecay`, `bpsustain`, `bprelease`: filter envelope for the bandpass filter.
- alternatively: `bpa`, `bpd`, `bps` and `bpr`.
## lpattack
- Also `hpattack` and `bpattack`.
<JsDoc client:idle name="lpattack" h={0} />
## lpdecay
- Also `hpdecay` and `bpdecay`.
<JsDoc client:idle name="lpdecay" h={0} />
## lpsustain
- Also `hpsustain` and `bpsustain`.
<JsDoc client:idle name="lpsustain" h={0} />
## lprelease
- Also `hprelease` and `bprelease`.
<JsDoc client:idle name="lprelease" h={0} />
## fenv
<JsDoc client:idle name="fenv" h={0} />
# Dynamics
## gain