The rate at which to vary between the max left pan and max right pan. The range of level is 0 to 10 and the samples are 16-bit words. The higher the level, the greater the distortion. Thus, you can achieve distortion this way. A Noise gate should be used with the compressor, since the compressor will amplify background noise when there is no foreground signal.
Expansion is the opposite of compression and uses the inverse of the above function.
This is the simplest form of a noise gate, but it can lead to distorted output since all signals close to the zero-line is clipped. It also cuts off any form of sustain. The conept of hysteresis can be added to the Noise gate to make it more effective. To do this, the signal threshold required to turn the noise gate off is made lower than the signal threshold required to turn the noise gate back on. There are various ways of detecting a peak, but the easiest way is to assume that a peak will arrive when a positive gradient is detected in the input buffer, eg.