wavelength 1.0.0
Loading...
Searching...
No Matches
effects.h File Reference
Include dependency graph for effects.h:

Go to the source code of this file.

Functions

short Saturate (short sample)
 Apply the cubic saturation curve to a sample, clamping beyond full scale.
short SoftClip (short sample, short threshold)
 Pass a sample below threshold unchanged and saturate the part above it.
void InitEffects ()
 Clear the delay line and the state of every effect.
void SetEffectParams (const EffectParams *params)
 Make the target parameters current and store new targets.
void InitDelayLine ()
 Clear the delay line and the tracking echo's state.
void EffectEcho (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Echo the mono mix through two taps of the delay line.
void EffectTrackingEcho (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Echo the mono mix through two taps whose delays follow the time between runs of zero crossings.
void EffectTriangleWave (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Write a triangle test tone to both outputs.
void EffectSquareWave (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Write a square test tone to both outputs.
void EffectBypass (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Copy the inputs to the outputs.
void EffectReverseSwap (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Write each input reversed to the other channel's output.
void EffectNone (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Do nothing.
void EffectSilence (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Write silence to both outputs.
void EffectConstant (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight, short value)
 Write one value to every sample of both outputs.
void SetStreamStatusAddress (void *address)
 Record the EE address that receives the stream's free space.
int StreamData (void *data, int size)
 Append data to the stream, or end the stream and discard its contents when size is zero.
void EffectStream (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Play one block pair from the stream, or silence while the stream holds less than one pair.
void InitLadderFilter ()
 Clear the ladder filter's state.
void EffectLadderFilter (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Run the mono mix through a four-stage ladder filter and a saturator, and step the current left parameters toward their targets.
void EffectMonoSweep (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Write the mono mix to both outputs, and step the current left parameters toward their targets.
void EffectStutter (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Pass the input only on the samples where a phase accumulator advanced by the left level wraps, and silence the rest.
void EffectResonantFilter (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Run each channel through a resonant state variable low-pass filter.
void EffectDistortedFilter (SampleBlock *inLeft, SampleBlock *inRight, SampleBlock *outLeft, SampleBlock *outRight)
 Run each channel through the resonant filter and clip loud output samples to full scale.

Variables

bool g_bMonoStream
 The effects.

Function Documentation

◆ Saturate()

short Saturate ( short sample)

Apply the cubic saturation curve to a sample, clamping beyond full scale.

Parameters
sampleThe sample.
Returns
The saturated sample.
Ghidra address:
NTSC-U/C: 0x00001000
Ghidra address:
PAL: 0x00001000

◆ SoftClip()

short SoftClip ( short sample,
short threshold )

Pass a sample below threshold unchanged and saturate the part above it.

The routine has no caller.

Parameters
sampleThe sample.
thresholdMagnitude where the curve starts.
Returns
The clipped sample.
Ghidra address:
NTSC-U/C: 0x00001078
Ghidra address:
PAL: 0x00001078

◆ InitEffects()

void InitEffects ( )

Clear the delay line and the state of every effect.

Ghidra address:
NTSC-U/C: 0x000011a0
Ghidra address:
PAL: 0x000011a0

◆ SetEffectParams()

void SetEffectParams ( const EffectParams * params)

Make the target parameters current and store new targets.

For the swept filter, also compute the steps that move the current parameters a third of the way to the targets.

Parameters
paramsThe left and then the right channel's parameters.
Ghidra address:
NTSC-U/C: 0x000011c8
Ghidra address:
PAL: 0x000011c8

◆ InitDelayLine()

void InitDelayLine ( )

Clear the delay line and the tracking echo's state.

Ghidra address:
NTSC-U/C: 0x00001408
Ghidra address:
PAL: 0x00001408

◆ EffectEcho()

void EffectEcho ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Echo the mono mix through two taps of the delay line.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output, a copy of the left output.
Ghidra address:
NTSC-U/C: 0x00001488
Ghidra address:
PAL: 0x00001488

◆ EffectTrackingEcho()

void EffectTrackingEcho ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Echo the mono mix through two taps whose delays follow the time between runs of zero crossings.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output, a copy of the left output.
Ghidra address:
NTSC-U/C: 0x000017ac
Ghidra address:
PAL: 0x000017ac

◆ EffectTriangleWave()

void EffectTriangleWave ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Write a triangle test tone to both outputs.

The routine has no caller.

Parameters
inLeftLeft input, unused.
inRightRight input, unused.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00001bf0
Ghidra address:
PAL: 0x00001bf0

◆ EffectSquareWave()

void EffectSquareWave ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Write a square test tone to both outputs.

The routine has no caller.

Parameters
inLeftLeft input, unused.
inRightRight input, unused.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00001cac
Ghidra address:
PAL: 0x00001cac

◆ EffectBypass()

void EffectBypass ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Copy the inputs to the outputs.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00001d2c
Ghidra address:
PAL: 0x00001d2c

◆ EffectReverseSwap()

void EffectReverseSwap ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Write each input reversed to the other channel's output.

The routine has no caller.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00001d78
Ghidra address:
PAL: 0x00001d78

◆ EffectNone()

void EffectNone ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Do nothing.

The routine has no caller.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00001dd4
Ghidra address:
PAL: 0x00001dd4

◆ EffectSilence()

void EffectSilence ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Write silence to both outputs.

Parameters
inLeftLeft input, unused.
inRightRight input, unused.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00001ddc
Ghidra address:
PAL: 0x00001ddc

◆ EffectConstant()

void EffectConstant ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight,
short value )

Write one value to every sample of both outputs.

The routine has no caller.

Parameters
inLeftLeft input, unused.
inRightRight input, unused.
outLeftLeft output.
outRightRight output.
valueThe sample value.
Ghidra address:
NTSC-U/C: 0x00001e1c
Ghidra address:
PAL: 0x00001e1c

◆ SetStreamStatusAddress()

void SetStreamStatusAddress ( void * address)

Record the EE address that receives the stream's free space.

Parameters
addressEE address.
Ghidra address:
NTSC-U/C: 0x00001e50
Ghidra address:
PAL: 0x00001e50

◆ StreamData()

int StreamData ( void * data,
int size )

Append data to the stream, or end the stream and discard its contents when size is zero.

Parameters
dataThe data.
sizeByte count.
Returns
Zero.
Ghidra address:
NTSC-U/C: 0x00001e78
Ghidra address:
PAL: 0x00001e78

◆ EffectStream()

void EffectStream ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Play one block pair from the stream, or silence while the stream holds less than one pair.

Parameters
inLeftLeft input, unused.
inRightRight input, unused.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00001f4c
Ghidra address:
PAL: 0x00001f4c

◆ InitLadderFilter()

void InitLadderFilter ( )

Clear the ladder filter's state.

Ghidra address:
NTSC-U/C: 0x00002238
Ghidra address:
PAL: 0x00002238

◆ EffectLadderFilter()

void EffectLadderFilter ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Run the mono mix through a four-stage ladder filter and a saturator, and step the current left parameters toward their targets.

The routine has no caller.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00002278
Ghidra address:
PAL: 0x00002278

◆ EffectMonoSweep()

void EffectMonoSweep ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Write the mono mix to both outputs, and step the current left parameters toward their targets.

The routine has no caller.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00002794
Ghidra address:
PAL: 0x00002794

◆ EffectStutter()

void EffectStutter ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Pass the input only on the samples where a phase accumulator advanced by the left level wraps, and silence the rest.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00002880
Ghidra address:
PAL: 0x00002880

◆ EffectResonantFilter()

void EffectResonantFilter ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Run each channel through a resonant state variable low-pass filter.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x0000291c
Ghidra address:
PAL: 0x0000291c

◆ EffectDistortedFilter()

void EffectDistortedFilter ( SampleBlock * inLeft,
SampleBlock * inRight,
SampleBlock * outLeft,
SampleBlock * outRight )

Run each channel through the resonant filter and clip loud output samples to full scale.

Parameters
inLeftLeft input.
inRightRight input.
outLeftLeft output.
outRightRight output.
Ghidra address:
NTSC-U/C: 0x00002a58
Ghidra address:
PAL: 0x00002a58

Variable Documentation

◆ g_bMonoStream

bool g_bMonoStream
extern

The effects.

Each one reads a block of each input channel and writes a block of each output channel. The module runs them in place, with each output block the same as its input block. Whether the stream effect mixes the stream to mono.