Copyright © 2011-2019 MultiMedia Soft

Effects.DistortionApply method

Previous pageReturn to chapter overviewNext page

Remarks

 

Applies a distortion effect to the given portion of sound under editing.

 

Similar to Pre/Post Gain & Drive controls on amps. They were first introduced as a trick to added color to a guitar's tone. Usually produced back then by turning the amp all the way up, or slightly pulling out a tube from its socket. These tones are now today referred to as Overdrives. Today, there are an almost infinite variety of these effects, and they range in 3 classes: Distortions, Fuzz, and Overdrive. One common feature to mostly all of these types of pedals is a volume and drive (also noted as distortion, fuzz, gain, ...etc.). Overdrives are usually a sustain and volume boosting pedal. Used by more traditional rock and country bands. Next are the Distortions, which range from punk style to death metal screams. They are similar to Overdrives, but have more buzzing quality to them. Finally, there are the Fuzzes which are more distorted than distortions, but are more mellow and compressed sounding. Many pedals can be confused within these names, and some may be named other than what they are. Towards the end of this era, the back-to-back diode pair became popular as a technique to provide soft clipping (with germanium diodes) and hard clipping (with silicon diodes). Today, overdrive effects usually means soft clipping, where gain is reduced beyond the clipping point, while distortion usually means hard clipping, where the level is fixed beyond the clipping point. Distortion is a little harder sound, good for rock, while overdrive gives a more natural sound.

 

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 DistortionApply (

nStartPosition as Int32,

nEndPosition as Int32,

nAffectedChannel as enumChannelMasks,

fDrive as Single,

fDryMix as Single,

fWetMix as Single,

fFeedback as Single,

fVolume as Single

) as enumErrorCodes


 

[C#]

public enumErrorCodes DistortionApply (

Int32 nStartPosition,

Int32 nEndPosition,

enumChannelMasks nAffectedChannel,

float fDrive,

float fDryMix,

float fWetMix,

float fFeedback,

float fVolume

);


 

[C++]

public: enumErrorCodes DistortionApply (

Int32 nStartPosition,

Int32 nEndPosition,

enumChannelMasks nAffectedChannel,

float fDrive,

float fDryMix,

float fWetMix,

float fFeedback,

float fVolume

);


 

 

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:

Mnemonic constant

Value

Meaning

CHANNEL_MASK_0

1 (0x01)

Channel 0 or left channel

CHANNEL_MASK_1

2 (0x02)

Channel 1 or right channel

CHANNEL_MASK_2

4 (0x04)

Channel 2

CHANNEL_MASK_3

8 (0x08)

Channel 3

CHANNEL_MASK_4

16 (0x10)

Channel 4

CHANNEL_MASK_5

32 (0x20)

Channel 5

CHANNEL_MASK_6

64 (0x40)

Channel 6

CHANNEL_MASK_7

128 (0x80)

Channel 7

CHANNEL_MASK_LEFTS

85 (0x55)

All left channels

CHANNEL_MASK_RIGHTS

170 (0xAA)

All right channels

CHANNEL_MASK_ALL

255 (0xFF)

All available channels

fDrive

Numeric value representing the distortion drive.

Supported values are in the range from 0 to 5.

fDryMix

Numeric value representing the Dry (unaffected) signal mix.

Supported values are in the range from -5 to +5.

fWetMix

Numeric value representing the Wet (affected) signal mix.

Supported values are in the range from -5 to +5.

fFeedback

Numeric value representing the output signal to feed back into input.

Supported values are in the range from -1 to +1.

fVolume

Numeric value representing the distortion volume.

Supported values are in the range from 0 to 2.

 

The fDrive controls the amount of overdrive. The fVolume to balance the effect volume with the bypassed level. It can also be used to boost the signal for solos. The fDryMix is the volume of input signal and the fWetMix is the volume of distorted signal. The fFeedback sets feedback of distortion.

 

Below some sample:

 

Effect type

fDrive

fDryMix

fWetMix

fFeedback

fVolume


 

 

 

 

 

Hard Distortion

1.0

0.0

1.0

0.0

1.0

Very Hard Distortion

5.0

0.0

1.0

0.1

1.0

Medium Distortion

0.2

1.0

1.0

0.1

1.0

Soft Distortion

0.0

-2.95

-0.05

-0.18

0.25

 

 

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.