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

Pitcher that drives the vocal track. More...

#include <voxer.h>

Inheritance diagram for Voxer:
Collaboration diagram for Voxer:

Public Member Functions

 Voxer (PhraseMgr *pPhraseMgr, Quantizer *pQuantizer, Sch::TickClock *pClock, const TrackData *pTrackData)
virtual ~Voxer ()
 Destroy the voxer.
virtual int Tick (int nElapsedTicks)
 Close the previous bar and keep the sustain in step with the song.
Public Member Functions inherited from Pitcher
 Pitcher (Sch::TickClock *pClock)
 Construct the three bases, the TickTask one to run every bar.
virtual ~Pitcher ()
 Inline.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.
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.
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.

Protected Member Functions

void OnPitchRiff (PitchRiffMsg *pMsg)
 Hold a level for this track and player.
void OnStopRiff (StopRiffMsg *pMsg)
 Release a level for this track and player.
void OnTrackSelect (TrackSelectMsg *pMsg)
 Install the player a TrackSelectMsg for this track selects.
void OnErase (int nBar, int bWholeStep, int bAnnounce)
 Erase mPlayer's phrases around a bar.
void OnInvalidateSeeker (int nBar)
 Turn mPlayer's seeker off, unless mPlayer is the stand-in.
virtual void DispatchPriv (Message *pMsg)
 Act on a message.

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.
Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.
Public Attributes inherited from Attachment
int mRefs
Static Public Attributes inherited from Pitcher
static constexpr int kBarPeriod = 1920
 The TickTask period, one bar of 1920 ticks.

Detailed Description

Pitcher that drives the vocal track.

Its RTTI descriptor is at 0x008f0830. It has Pitcher as its one base. Its three tables are at 0x007e61a8, 0x007e6180, and 0x007e6150, and it overrides exactly the two slots Pitcher declares pure: DispatchPriv() in the primary table and Tick() in the TickTask table. VoxingSTG's tagged allocation measures the object at 0x70 bytes, and VoxingSTG builds exactly one of these without branching.

The constructor takes four arguments, the fourth in t0, and fixes the layout of the derived part. It constructs the TickTask base with a period of 1920 ticks, which is one measure at 480 ticks per quarter note. VoxingSTG's call at 0x001da0b0 passes its phrase manager, its quantiser, the song clock, and its track description, which types all four.

The Voxer records what the singer holds into a Phrase per bar, as AxePhraseMaker does for a guitar. Holding any PitchRiffMsg level presses the sustain controller (46) and releasing the last one lets it go.

Constructor & Destructor Documentation

◆ Voxer()

Voxer::Voxer ( PhraseMgr * pPhraseMgr,
Quantizer * pQuantizer,
Sch::TickClock * pClock,
const TrackData * pTrackData )
Parameters
pPhraseMgrThe phrase manager for the track. Its +0x34 is copied into mBarTicks.
pQuantizerThe quantiser for the track.
pClockThe clock the TickTask base is posted against.
pTrackDataThe track description, which arrives in t0. Its +0x04 is copied into mTrack and its +0x08 byte into mChannel.
Ghidra address:
NTSC-U/C: 0x001d81b8
Ghidra address:
PAL: 0x001de098

◆ ~Voxer()

virtual Voxer::~Voxer ( )
virtual

Destroy the voxer.

The body only chains to Pitcher's destructor.

Ghidra address:
NTSC-U/C: 0x001d9dd0
Ghidra address:
PAL: 0x001dfd40

Member Function Documentation

◆ Tick()

virtual int Voxer::Tick ( int nElapsedTicks)
virtual

Close the previous bar and keep the sustain in step with the song.

At bar zero the sustain controller is released at position kTickInfinity. The routine finishes the phrase of the previous bar and turns the seeker off. At a bar TrackData::QueryBar() rejects while sustaining, it clears the held levels, records and sends the sustain release in a new phrase, and releases the button with an AxeButtonMsg. In the PAL build the button is released only when mPlayer is not the stand-in.

Parameters
nElapsedTicksTicks since the epoch.
Returns
1 always.
Ghidra address:
NTSC-U/C: 0x001d8dc8
Ghidra address:
PAL: 0x001ded18

Implements TickTask.

◆ OnPitchRiff()

void Voxer::OnPitchRiff ( PitchRiffMsg * pMsg)
protected

Hold a level for this track and player.

The level's bit joins mHeldLevels, UpdateSustain() runs at the message's position, and an AxeButtonMsg presses the button.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x001d8370
Ghidra address:
PAL: 0x001de250

◆ OnStopRiff()

void Voxer::OnStopRiff ( StopRiffMsg * pMsg)
protected

Release a level for this track and player.

The level's bit leaves mHeldLevels and UpdateSustain() runs at the message's position. With no level left held, an AxeButtonMsg releases the button.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x001d8430
Ghidra address:
PAL: 0x001de310

◆ OnTrackSelect()

void Voxer::OnTrackSelect ( TrackSelectMsg * pMsg)
protected

Install the player a TrackSelectMsg for this track selects.

A player still holding levels has them cleared, the sustain updated, and the button released. The PAL build also clears mSustaining and sends the sustain release at the message's position before releasing the button. A real new player gets a NowBarMsg at lane 0.5 and its seeker turned off.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x001d8840
Ghidra address:
PAL: 0x001de720

◆ OnErase()

void Voxer::OnErase ( int nBar,
int bWholeStep,
int bAnnounce )
protected

Erase mPlayer's phrases around a bar.

The bar, or with bWholeStep set every bar of its step, is cleared wherever mPlayer is its owner, and clearing nBar itself also releases the sustain controller at position kTickInfinity. When anything was cleared, bAnnounce plays SND_ERASE_SECTION or SND_ERASE and sends a ShowEraseEffectMsg. The seeker is turned off in both cases.

Parameters
nBarThe bar.
bWholeStepNon-zero to erase the whole step, an EraseMsg's +0x10.
bAnnounceNon-zero for an EraseMsg, and zero from StartPhrase().
Ghidra address:
NTSC-U/C: 0x001d8638
Ghidra address:
PAL: 0x001de518

◆ OnInvalidateSeeker()

void Voxer::OnInvalidateSeeker ( int nBar)
protected

Turn mPlayer's seeker off, unless mPlayer is the stand-in.

Parameters
nBarNot read.
Ghidra address:
NTSC-U/C: 0x001d8fb0
Ghidra address:
PAL: 0x001def20

◆ DispatchPriv()

virtual void Voxer::DispatchPriv ( Message * pMsg)
protectedvirtual

Act on a message.

Primary table slot 3.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x001d9050
Ghidra address:
PAL: 0x001defc0

Implements MsgSink.


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