Compression currently works on a single sample, essentially sample = Math.pow(sample, compression). It would be useful to have a compressor that amplifies quiet parts of the sound, based on the RMS of a short sliding window, or (easier) the RMS of all samples so far, exponentially weighted to favour recent ones. The current compressor would be a special case for falloff = 0.
Compression currently works on a single sample, essentially
sample = Math.pow(sample, compression). It would be useful to have a compressor that amplifies quiet parts of the sound, based on the RMS of a short sliding window, or (easier) the RMS of all samples so far, exponentially weighted to favour recent ones. The current compressor would be a special case forfalloff = 0.