Effects.CompressorApply method |
|
Remarks
Applies a compressor effect to the given portion of sound under editing.
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.
During the execution of the editing session the CallbackEditPerc delegate is invoked in order to notify about the percentage of advancement.
For further details about callback delegates see the How to synchronize the container application with the API tutorial.
For further details about methods related to the use of special effects refer to the EffectsMan class.
Syntax
[Visual Basic] Public Function CompressorApply ( nStartPosition as Int32, nEndPosition as Int32, nAffectedChannel as enumChannelMasks, fGain as Single, fThreshold as Single, fRatio as Single, fAttack as Single, fRelease as Single ) as enumErrorCodes |
[C#] public enumErrorCodes CompressorApply ( Int32 nStartPosition, Int32 nEndPosition, enumChannelMasks nAffectedChannel, float fGain, float fThreshold, float fRatio, float fAttack, float fRelease ); |
[C++] public: enumErrorCodes CompressorApply ( Int32 nStartPosition, Int32 nEndPosition, enumChannelMasks nAffectedChannel, float fGain, float fThreshold, float fRatio, float fAttack, float fRelease ); |
Parameter |
Description |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
nStartPosition |
Start position, expressed in milliseconds, of the affected sound range. |
||||||||||||||||||||||||||||||||||||
nEndPosition |
End position, expressed in milliseconds, of the affected sound range.. If set to -1 the end position will be set to the end of the sound. |
||||||||||||||||||||||||||||||||||||
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. |
Return value
Value |
Meaning |
|
|
Negative value |
An error occurred (see the LastError property for further error details) |
enumErrorCodes.NOERROR (0) |
The method call was successful. |