|
resonance 1.0.1
|
Pitcher that drives the vocal track. More...
#include <voxer.h>


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. | |
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.
| Voxer::Voxer | ( | PhraseMgr * | pPhraseMgr, |
| Quantizer * | pQuantizer, | ||
| Sch::TickClock * | pClock, | ||
| const TrackData * | pTrackData ) |
| pPhraseMgr | The phrase manager for the track. Its +0x34 is copied into mBarTicks. |
| pQuantizer | The quantiser for the track. |
| pClock | The clock the TickTask base is posted against. |
| pTrackData | The track description, which arrives in t0. Its +0x04 is copied into mTrack and its +0x08 byte into mChannel. |
|
virtual |
Destroy the voxer.
The body only chains to Pitcher's destructor.
|
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.
| nElapsedTicks | Ticks since the epoch. |
Implements TickTask.
|
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.
| pMsg | The message. |
|
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.
| pMsg | The message. |
|
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.
| pMsg | The message. |
|
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.
| nBar | The bar. |
| bWholeStep | Non-zero to erase the whole step, an EraseMsg's +0x10. |
| bAnnounce | Non-zero for an EraseMsg, and zero from StartPhrase(). |
|
protected |
Turn mPlayer's seeker off, unless mPlayer is the stand-in.
| nBar | Not read. |
|
protectedvirtual |
Act on a message.
Primary table slot 3.
| pMsg | The message. |
Implements MsgSink.