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

Holder of the track description the beat-quantising paths consult. More...

#include <quantizer.h>

Public Member Functions

 Quantizer (const TrackData *pTrackData)
 Retain the track description.
int Quantize (int nTick)
 Round a song position to the quantisation of its bar.
int GetQuantum (int nTick)
 Report the quantisation of the bar a song position falls in.

Static Public Member Functions

static unsigned Round (unsigned nTick, unsigned nQuantum)
 Round a song position to the nearest multiple of a quantum.

Detailed Description

Holder of the track description the beat-quantising paths consult.

The class emits no RTTI, because it is not polymorphic. Its name is attested by the signature of Catcher::Catcher() the image records, whose second parameter is Quantizer *.

The object is four bytes. ScoreTrackGraph builds one with the global operator new(4), and the constructor at 0x001ce670 stores its argument and returns.

Constructor & Destructor Documentation

◆ Quantizer()

Quantizer::Quantizer ( const TrackData * pTrackData)

Retain the track description.

Parameters
pTrackDataThe track this quantiser works over.
Ghidra address:
NTSC-U/C: 0x001ce670
Ghidra address:
PAL: 0x001d4528

Member Function Documentation

◆ Quantize()

int Quantizer::Quantize ( int nTick)

Round a song position to the quantisation of its bar.

Parameters
nTickThe song position, in MIDI ticks.
Returns
The rounded position.
Ghidra address:
NTSC-U/C: 0x001ce680
Ghidra address:
PAL: 0x001d4538

◆ GetQuantum()

int Quantizer::GetQuantum ( int nTick)

Report the quantisation of the bar a song position falls in.

Parameters
nTickThe song position, in MIDI ticks.
Returns
TrackData::GetQuant() for the bar, in MIDI ticks.
Ghidra address:
NTSC-U/C: 0x001ce6b0
Ghidra address:
PAL: 0x001d4568

◆ Round()

unsigned Quantizer::Round ( unsigned nTick,
unsigned nQuantum )
static

Round a song position to the nearest multiple of a quantum.

The position is moved eight ticks earlier before rounding. The arithmetic is unsigned, and a zero quantum traps.

Parameters
nTickThe song position, in MIDI ticks.
nQuantumThe quantum, in MIDI ticks.
Returns
The rounded position.
Ghidra address:
NTSC-U/C: 0x001ce710
Ghidra address:
PAL: 0x001d45c8

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