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

Collector of a MIDI channel's controller state, for replaying it before playback starts. More...

#include <midichase.h>

Inheritance diagram for MidiChase:
Collaboration diagram for MidiChase:

Public Member Functions

 MidiChase ()
 Start with nothing collected.
virtual ~MidiChase ()
virtual void DispatchPriv (Message *pMsg)
 Record the channel, and the state a controller change, a program change, or a pitch bend sets.
void HandleRange (const TickObj< MuseMsg * > *pBegin, const TickObj< MuseMsg * > *pEnd)
 Pass every message of a range to MsgSink::Dispatch().
void Replay (MsgSink *pSink)
 Send the collected state to a sink.
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.

Static Public Attributes

static constexpr unsigned char kUnset = 0xff
 The value every collected byte starts at.
static constexpr int kControllerCount = 128
 The number of MIDI controllers.

Detailed Description

Collector of a MIDI channel's controller state, for replaying it before playback starts.

It has MsgSink as its one base. Its unit spans 0x001a6488 through 0x001a6960. BGTrackGraph::BuildSequencer() builds one on its stack, feeds it every bar of the track, and has it replay what it collected into the synthesiser.

Every byte of state starts at kUnset, which Replay() treats as nothing collected.

Constructor & Destructor Documentation

◆ MidiChase()

MidiChase::MidiChase ( )

Start with nothing collected.

Ghidra address:
NTSC-U/C: 0x001a6888
Ghidra address:
PAL: 0x001ac5f0

◆ ~MidiChase()

virtual MidiChase::~MidiChase ( )
virtual
Ghidra address:
NTSC-U/C: 0x001a67d8
Ghidra address:
PAL: 0x001ac540

Member Function Documentation

◆ DispatchPriv()

virtual void MidiChase::DispatchPriv ( Message * pMsg)
virtual

Record the channel, and the state a controller change, a program change, or a pitch bend sets.

Every other message is ignored.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x001a6660
Ghidra address:
PAL: 0x001ac3c8

Implements MsgSink.

◆ HandleRange()

void MidiChase::HandleRange ( const TickObj< MuseMsg * > * pBegin,
const TickObj< MuseMsg * > * pEnd )

Pass every message of a range to MsgSink::Dispatch().

The title is inferred.

Parameters
pBeginThe first message.
pEndOne past the last message.
Ghidra address:
NTSC-U/C: 0x001a6900
Ghidra address:
PAL: 0x001ac668

◆ Replay()

void MidiChase::Replay ( MsgSink * pSink)

Send the collected state to a sink.

Sends a controller change for every collected controller in order, then the program change, then the pitch bend, each only when collected, all on the recorded channel at kTickInfinity. The title is inferred.

Parameters
pSinkThe sink.
Ghidra address:
NTSC-U/C: 0x001a6488
Ghidra address:
PAL: 0x001ac1f0

Member Data Documentation

◆ kUnset

unsigned char MidiChase::kUnset = 0xff
staticconstexpr

The value every collected byte starts at.

◆ kControllerCount

int MidiChase::kControllerCount = 128
staticconstexpr

The number of MIDI controllers.


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