Effects.CompressorApply method |
|
Remarks
Applies a compressor effect on the playing song. This effect can be reset through the Effects.CompressorReset method.
Compressors are commonly used in recording to control the level, by making loud passages quieter, and quiet passages louder. This is useful in allowing a vocalist to sing quiet and loud for different emphasis, and always be heard clearly in the mix. Compression is generally applied to guitar to give clean sustain, where the start of a note is "squashed" with the gain automatically increased as the not fades away. Compressors take a short time to react to a picked note, and it can be difficult to find settings that react quickly enough to the volume change without killing the natural attack sound of your guitar.
See the How to apply special effects to a playing sound section for further details.
Syntax
[Visual Basic] control.Effects.CompressorApply ( nPlayer as Integer, nAffectedChannel as enumChannelMasks, fGain as Single, fThreshold as Single, fRatio as Single, fAttack as Single, fRelease as Single, nPriority as Integer ) as enumErrorCodes |
[C++] short control.Effects.CompressorApply ( short nPlayer, short nAffectedChannel, float fGain, float fThreshold, float fRatio, float fAttack, float fRelease, short nPriority ); |
Parameter |
Description |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
nPlayer |
Number representing the zero-based index of the involved player |
||||||||||||||||||||||||||||||||||||
nAffectedChannel |
Numeric value that determines the combination of affected channels. Supported values are the following:
|
||||||||||||||||||||||||||||||||||||
fGain |
Numeric value representing the output gain of signal after compression expressed in dB. Supported values are in the range from -60 to +60. The default value is 0 dB. |
||||||||||||||||||||||||||||||||||||
fThreshold |
Numeric value representing the point at which compression begins expressed in dB. Supported values are in the range from -60 to 0. The default value is -15 dB. |
||||||||||||||||||||||||||||||||||||
fRatio |
Numeric value representing the compression ratio. Supported values start from 1. The default value is 3, which means 3:1 compression. |
||||||||||||||||||||||||||||||||||||
fAttack |
Numeric value representing the time before compression reaches its full value expressed in milliseconds. Supported values are in the range from 0.01 to 1000. The default value is 10 ms. |
||||||||||||||||||||||||||||||||||||
fRelease |
Numeric value representing the speed, expressed in milliseconds, at which compression is stopped after input drops below fThreshold. Supported values are in the range from 0.01 to 5000. The default value is 200 ms. |
||||||||||||||||||||||||||||||||||||
nPriority |
Effect's priority level inside the chain of DirectX effects, custom DSP effects and VST effects. Effects with higher priority are applied before effects with lower priority; in case more effects should have the same priority, they would be invoked in the same order that they were added. |
Return value
Value |
Meaning |
|
|
Negative value |
An error occurred (see the LastError property for further error details) |
enumErrorCodes.ERR_NOERROR (0) |
The call was successful. |