resonance 1.0.1
Loading...
Searching...
No Matches
WahEffector Class Reference

Effect that sweeps a channel's filter controller with a triangle wave while it is applied. More...

#include <waheffector.h>

Inheritance diagram for WahEffector:
Collaboration diagram for WahEffector:

Public Member Functions

 WahEffector (Sch::TickClock *pClock, unsigned char nChannel, int nDepth, int nPeriod)
 Build the effect with a triangle oscillator starting half way through its period.
virtual ~WahEffector ()
 Switch the effect off through this class's own SetEnabled(), then release the oscillator.
virtual int Type ()
 Report which effect this object applies.
virtual void SetEnabled (int bEnabled)
 Send controller 0x51 with 0x7f to apply the effect or zero to release it.
virtual int Tick (int nElapsedTicks)
 Send controller 0x4a with mDepth times the oscillator's value at the elapsed count.
Public Member Functions inherited from TickTask
 TickTask (Sch::TickClock *pClock, int nPeriod, int bAligned)
virtual ~TickTask ()
 Withdraw the queued command.
virtual void Print (std::ostream &stream)
 Write the task to a diagnostic stream.
void Start (int nEpochOffset)
 Post the task on its clock.
void Run ()
 Run Tick() for the run now due and post the next one.
void Stop ()
 Withdraw the queued command and forget its handle.
Public Member Functions inherited from Attachment
 Attachment ()
virtual ~Attachment ()
int Release ()
 Give back one reference and destroy the object once the last one is gone.
virtual void Destroy ()
 Destroy the object.
Public Member Functions inherited from Effector
 Effector ()
virtual ~Effector ()
Public Member Functions inherited from MsgSource
virtual ~MsgSource ()
virtual void AddSink (MsgSink *pSink)
 Register a sink, ignoring a sink that is already registered.
virtual void RemoveSink (MsgSink *pSink)
 Unregister the first occurrence of a sink.
void Send (Message *pMsg) const
 Deliver a message to every registered sink, in registration order.
void ClearSinks ()
 Unregister every sink.

Additional Inherited Members

Static Public Member Functions inherited from Attachment
static void ReleaseIfSet (Attachment *pAttachment)
 Give back one reference to an object that may be null.
Static Public Member Functions inherited from Effector
static Effector * CreateForType (int nType, unsigned char nChannel, int nTrack)
 Build the effect one type selects.
Public Attributes inherited from Attachment
int mRefs
Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.

Detailed Description

Effect that sweeps a channel's filter controller with a triangle wave while it is applied.

Its RTTI descriptor is at 0x008f2a60. It has TickTask at offset 0 and Effector at offset 0x20. Its tables are at 0x007de770 for TickTask and 0x007de738 for the Effector subobject. The factory's allocation measures the object at 0x48 bytes.

The task runs every 60 ticks and is not aligned. Each run samples mOscillator and sends controller 0x4a with mDepth scaled by the sample. Switching the effect sends controller 0x51.

The factory reads the depth from configuration code 0x390 and the oscillator period from code 0x38f, both for the track.

Constructor & Destructor Documentation

◆ WahEffector()

WahEffector::WahEffector ( Sch::TickClock * pClock,
unsigned char nChannel,
int nDepth,
int nPeriod )
inline

Build the effect with a triangle oscillator starting half way through its period.

Inline. Effector::CreateForType() expands it, and the image also keeps this out-of-line copy.

Parameters
pClockThe clock the task runs against.
nChannelThe MIDI channel the controller changes go to.
nDepthThe controller value at the top of the sweep.
nPeriodThe oscillator period, in the ticks the task reports.
Ghidra address:
NTSC-U/C: 0x001a1ed8
Ghidra address:
PAL: 0x001a7c40

◆ ~WahEffector()

virtual WahEffector::~WahEffector ( )
virtual

Switch the effect off through this class's own SetEnabled(), then release the oscillator.

Ghidra address:
NTSC-U/C: 0x001a2040
Ghidra address:
PAL: 0x001a7da8

Member Function Documentation

◆ Type()

virtual int WahEffector::Type ( )
virtual

Report which effect this object applies.

Returns
kEffectorTypeWah.
Ghidra address:
NTSC-U/C: 0x001a2128
Ghidra address:
PAL: 0x001a7e90

Implements Effector.

◆ SetEnabled()

virtual void WahEffector::SetEnabled ( int bEnabled)
virtual

Send controller 0x51 with 0x7f to apply the effect or zero to release it.

A request that repeats the current position sends nothing once a request has been sent.

Parameters
bEnabledNon-zero to apply the effect.
Ghidra address:
NTSC-U/C: 0x001a08f8
Ghidra address:
PAL: 0x001a6660

Reimplemented from Effector.

◆ Tick()

virtual int WahEffector::Tick ( int nElapsedTicks)
virtual

Send controller 0x4a with mDepth times the oscillator's value at the elapsed count.

Parameters
nElapsedTicksTicks since the task's epoch.
Returns
1 always.
Ghidra address:
NTSC-U/C: 0x001a0a10
Ghidra address:
PAL: 0x001a6778

Implements TickTask.


The documentation for this class was generated from the following file: