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

Effect that chops a channel's level with a square wave while it is applied. More...

#include <stuttereffector.h>

Inheritance diagram for StutterEffector:
Collaboration diagram for StutterEffector:

Public Member Functions

 StutterEffector (Sch::TickClock *pClock, unsigned char nChannel, int nPeriod, int nFloor)
 Build the effect with a square oscillator.
virtual ~StutterEffector ()
 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)
 Apply or release the effect.
virtual int Tick (int nElapsedTicks)
 Send controller 0x30 at the level the oscillator's value selects.
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 chops a channel's level with a square wave while it is applied.

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

The task runs every half period, aligned. Each run samples mOscillator and sends controller 0x30 between 127 and mFloor. Applying the effect runs the task at once, sends controller 0x50 with 0x7f, and starts the task. Releasing it stops the task, restores controller 0x30 to 0x7f, and sends controller 0x50 with zero.

The factory reads both tuning values from configuration code 0x391, which must hold exactly two values.

Constructor & Destructor Documentation

◆ StutterEffector()

StutterEffector::StutterEffector ( Sch::TickClock * pClock,
unsigned char nChannel,
int nPeriod,
int nFloor )
inline

Build the effect with a square oscillator.

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.
nPeriodThe oscillator period. The task runs every half period.
nFloorThe level the chop falls to.
Ghidra address:
NTSC-U/C: 0x001a21c8
Ghidra address:
PAL: 0x001a7f30

◆ ~StutterEffector()

virtual StutterEffector::~StutterEffector ( )
virtual

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

Ghidra address:
NTSC-U/C: 0x001a2338
Ghidra address:
PAL: 0x001a80a0

Member Function Documentation

◆ Type()

virtual int StutterEffector::Type ( )
virtual

Report which effect this object applies.

Returns
kEffectorTypeStutter.
Ghidra address:
NTSC-U/C: 0x001a2420
Ghidra address:
PAL: 0x001a8188

Implements Effector.

◆ SetEnabled()

virtual void StutterEffector::SetEnabled ( int bEnabled)
virtual

Apply or release the effect.

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: 0x001a0ae0
Ghidra address:
PAL: 0x001a6848

Reimplemented from Effector.

◆ Tick()

virtual int StutterEffector::Tick ( int nElapsedTicks)
virtual

Send controller 0x30 at the level the oscillator's value selects.

The level is the value times 127 plus one minus the value times mFloor, computed in double precision.

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

Implements TickTask.


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