add filter synonyms

This commit is contained in:
Felix Roos 2023-01-06 21:37:31 +01:00
parent 605a1365d3
commit 8781fa2e33
3 changed files with 32 additions and 21 deletions

View File

@ -155,22 +155,26 @@ const generic_params = [
* *
* @name bandf * @name bandf
* @param {number | Pattern} frequency center frequency * @param {number | Pattern} frequency center frequency
* @synonyms bpf
* @example * @example
* s("bd sd,hh*3").bandf("<1000 2000 4000 8000>") * s("bd sd,hh*3").bandf("<1000 2000 4000 8000>")
* *
*/ */
['f', 'bandf', 'A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter.'], ['f', 'bandf', 'A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter.'],
['f', 'bpf', ''],
// TODO: in tidal, it seems to be normalized // TODO: in tidal, it seems to be normalized
/** /**
* Sets the q-factor of the band-pass filter * Sets the q-factor of the band-pass filter
* *
* @name bandq * @name bandq
* @param {number | Pattern} q q factor * @param {number | Pattern} q q factor
* @synonyms bpq
* @example * @example
* s("bd sd").bandf(500).bandq("<0 1 2 3>") * s("bd sd").bandf(500).bandq("<0 1 2 3>")
* *
*/ */
['f', 'bandq', 'a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter.'], ['f', 'bandq', 'a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter.'],
['f', 'bpq', ''],
/** /**
* a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample. * a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample.
* *
@ -282,53 +286,50 @@ const generic_params = [
* *
* @name cutoff * @name cutoff
* @param {number | Pattern} frequency audible between 0 and 20000 * @param {number | Pattern} frequency audible between 0 and 20000
* @synonyms lpf
* @example * @example
* s("bd sd,hh*3").cutoff("<4000 2000 1000 500 200 100>") * s("bd sd,hh*3").cutoff("<4000 2000 1000 500 200 100>")
* *
*/ */
// TODO: add lpf synonym
['f', 'cutoff', 'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter.'], ['f', 'cutoff', 'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter.'],
['f', 'lpf'],
/** /**
* Applies the cutoff frequency of the high-pass filter. * Applies the cutoff frequency of the high-pass filter.
* *
* @name hcutoff * @name hcutoff
* @param {number | Pattern} frequency audible between 0 and 20000 * @param {number | Pattern} frequency audible between 0 and 20000
* @synonyms hpf
* @example * @example
* s("bd sd,hh*4").hcutoff("<4000 2000 1000 500 200 100>") * s("bd sd,hh*4").hcutoff("<4000 2000 1000 500 200 100>")
* *
*/ */
// TODO: add hpf synonym ['f', 'hcutoff', ''],
[ ['f', 'hpf', ''],
'f',
'hcutoff',
'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@',
],
/** /**
* Applies the resonance of the high-pass filter. * Applies the resonance of the high-pass filter.
* *
* @name hresonance * @name hresonance
* @param {number | Pattern} q resonance factor between 0 and 50 * @param {number | Pattern} q resonance factor between 0 and 50
* @synonyms hpq
* @example * @example
* s("bd sd,hh*4").hcutoff(2000).hresonance("<0 10 20 30>") * s("bd sd,hh*4").hcutoff(2000).hresonance("<0 10 20 30>")
* *
*/ */
[ ['f', 'hpq', ''],
'f', ['f', 'hresonance', ''],
'hresonance',
'a pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter. Has alias @hpq@',
],
// TODO: add hpq synonym // TODO: add hpq synonym
/** /**
* Applies the cutoff frequency of the low-pass filter. * Applies the cutoff frequency of the low-pass filter.
* *
* @name resonance * @name resonance
* @param {number | Pattern} q resonance factor between 0 and 50 * @param {number | Pattern} q resonance factor between 0 and 50
* @synonyms lpq
* @example * @example
* s("bd sd,hh*4").cutoff(2000).resonance("<0 10 20 30>") * s("bd sd,hh*4").cutoff(2000).resonance("<0 10 20 30>")
* *
*/ */
['f', 'resonance', 'a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter.'], ['f', 'lpq'],
// TODO: add lpq synonym? ['f', 'resonance', ''],
/** /**
* DJ filter, below 0.5 is low pass filter, above is high pass filter. * DJ filter, below 0.5 is low pass filter, above is high pass filter.
* *

View File

@ -211,12 +211,22 @@ export const webaudioOutput = async (hap, deadline, hapDuration) => {
n = 0, n = 0,
note, note,
gain = 0.8, gain = 0.8,
cutoff, // low pass
resonance = 1, lpf,
hcutoff, cutoff = lpf,
hresonance = 1, lpq = 1,
bandf, resonance = lpq,
bandq = 1, // high pass
hpf,
hcutoff = hpf,
hpq = 1,
hresonance = hpq,
// band pass
bpf,
bandf = bpf,
bpq = 1,
bandq = bpq,
//
coarse, coarse,
crush, crush,
shape, shape,

View File

@ -102,4 +102,4 @@ it aims to provide a standalone live coding environment that runs entirely in th
### Audio Effects ### Audio Effects
Many of SuperDirt's effects have been reimplemented in Strudel, using the Web Audio API. Many of SuperDirt's effects have been reimplemented in Strudel, using the Web Audio API.
You can find a (not totally complete) [list of available effects here](./learn/effects). You can find a [list of available effects here](./learn/effects).