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

One riff of a track at one difficulty level, as a sequence of MIDI messages. More...

#include <riff.h>

Inheritance diagram for Riff:
Collaboration diagram for Riff:

Public Member Functions

void * operator new (size_t nSize)
 Allocate a riff from the tagged heap under the tag Riff.
void operator delete (void *pBlock)
 Release a riff to the tagged heap.
 Riff (int nId)
 Construct an empty riff for one difficulty level.
virtual void Print (std::ostream &stream)
 Write riff[id= and the level, then the sequence through MultiMuse::Print().
void AddNoteMsg (int nTick, unsigned char nNote, unsigned char nVelocity, int nLength, unsigned char nChannel)
 Schedule a NoteMsg.
void AddMidiMsg (int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2, unsigned char nChannel)
 Schedule a StdMidiMsg built from a status byte and two data bytes.
Public Member Functions inherited from MultiMuse
void * operator new (size_t nSize)
 Allocate a sequence from the tagged heap under the tag "MultiMuse".
void operator delete (void *pBlock)
 Release a sequence to the tagged heap.
virtual ~MultiMuse ()
 Delete every stored message, then release the vector.
void SaveFields (OBStream &stream)
 Write the sequence to an output stream.
void LoadFields (IBStream &stream)
 Read the sequence back from an input stream.
void Add (MuseMsg *pMsg, int nTick, int bCheckLast)
 Schedule a copy of a message at a song position.
MuseMsg * Find (int nTick)
 Find the message scheduled at exactly a song position.
void Append (const MultiMuse &other)
 Append a Clone() of every message of another sequence, at the same song positions.
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 Attributes

int mId
Public Attributes inherited from MultiMuse
std::vector< TickObj< MuseMsg * > > mEntries
 Every message of the sequence, in ascending song position.
Public Attributes inherited from Attachment
int mRefs

Friends

class AutoRiffer
class LevelConverter

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.

Detailed Description

One riff of a track at one difficulty level, as a sequence of MIDI messages.

It has MultiMuse as its one base. Its vtable at 0x007e4f78 runs four entries: the type function, the destructor at 0x001cead0, the retained Attachment::Destroy(), and the Print() override below. The object is 0x1c bytes, the 0x14-byte MultiMuse followed by the two members below.

mId is the difficulty level the riff belongs to. RiffSet stores a riff at the index mId names, and Print() labels it riff[id=.

The destructor is implicitly declared. It runs MultiMuse's destructor and releases the object under the tag Riff.

Both members are private apart from mId. RiffSet and TrackData read mId directly.

Constructor & Destructor Documentation

◆ Riff()

Riff::Riff ( int nId)
explicit

Construct an empty riff for one difficulty level.

Parameters
nIdThe difficulty level.
Ghidra address:
NTSC-U/C: 0x001cebb0
Ghidra address:
PAL: 0x001d4a68

Member Function Documentation

◆ operator new()

void * Riff::operator new ( size_t nSize)

Allocate a riff from the tagged heap under the tag Riff.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.
Ghidra address:
NTSC-U/C: 0x001ceb70
Ghidra address:
PAL: 0x001d4a28

◆ operator delete()

void Riff::operator delete ( void * pBlock)

Release a riff to the tagged heap.

Parameters
pBlockThe block.
Ghidra address:
NTSC-U/C: 0x001ceb90
Ghidra address:
PAL: 0x001d4a48

◆ Print()

virtual void Riff::Print ( std::ostream & stream)
virtual

Write riff[id= and the level, then the sequence through MultiMuse::Print().

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x001cec58
Ghidra address:
PAL: 0x001d4b10

Reimplemented from MultiMuse.

◆ AddNoteMsg()

void Riff::AddNoteMsg ( int nTick,
unsigned char nNote,
unsigned char nVelocity,
int nLength,
unsigned char nChannel )

Schedule a NoteMsg.

A position at or before tick 2 moves to 0, and one after tick 30 moves one tick later, clamped to the finite range. The message is added through MultiMuse::Add() with appending allowed.

Parameters
nTickThe song position, in MIDI ticks.
nNoteThe note number.
nVelocityThe note-on velocity.
nLengthThe length of the note, in MIDI ticks.
nChannelThe MIDI channel.
Ghidra address:
NTSC-U/C: 0x001ce778
Ghidra address:
PAL: 0x001d4630

◆ AddMidiMsg()

void Riff::AddMidiMsg ( int nTick,
unsigned char nStatus,
unsigned char nData1,
unsigned char nData2,
unsigned char nChannel )

Schedule a StdMidiMsg built from a status byte and two data bytes.

The position is adjusted as AddNoteMsg() adjusts it, and the status is the bitwise or of the second and the fifth arguments.

Parameters
nTickThe song position, in MIDI ticks.
nStatusThe status byte without its channel.
nData1The first data byte.
nData2The second data byte.
nChannelThe channel, combined into the status with a bitwise or.
Ghidra address:
NTSC-U/C: 0x001ce8d0
Ghidra address:
PAL: 0x001d4788

◆ AutoRiffer

friend class AutoRiffer
friend

◆ LevelConverter

friend class LevelConverter
friend

Member Data Documentation

◆ mId

int Riff::mId

The difficulty level, 0 through 3. +0x14


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