wavelength 1.0.0
Loading...
Searching...
No Matches
Scratcher Class Reference

Player of the three recorded pieces one scratch button plays. More...

#include <scratcher.h>

Classes

class  ScratchNoteCB
 Receiver that shows each note a piece starts on the scratching player's track. More...

Public Member Functions

 Scratcher (Muse *pFirst, Muse *pSecond, Muse *pThird, int nQuantumTicks, int nLengthTicks, int nChannel)
 Construct a scratcher over three recorded pieces.
virtual ~Scratcher ()
 Stop scratching and release the pieces.
virtual void Start (int nPlayer, int nTickOffset)
 Start scratching for a player.
virtual void Stop ()
 Stop scratching and bend the channel back.
virtual int IsScratching ()
 Report whether the scratcher is scratching.
virtual int GetLoopLength ()
 Report the ticks of one loop of the pieces.
virtual void SetPitch (float fPitch)
 Set the pitch.
virtual void SetPosition (float fPosition)
 Pick the piece from the horizontal position of the stick.

Static Public Attributes

static constexpr int kNumPieces = 3
 Number of pieces, one for each stick position.

Detailed Description

Player of the three recorded pieces one scratch button plays.

The RTTI includes the class name and records no base, and the nested Scratcher::ScratchNoteCB. The vtable at 0x003ca460 has eight slots after the type function: the destructor, Start(), Stop(), IsScratching(), GetLoopLength(), SetPitch(), and SetPosition(). ScratchTrackBuilder builds one per button of each scratch set, and ScratchTrack drives the scratchers of the current set. The stick picks the piece that plays, and the pitch bends the channel.

Constructor & Destructor Documentation

◆ Scratcher()

Scratcher::Scratcher ( Muse * pFirst,
Muse * pSecond,
Muse * pThird,
int nQuantumTicks,
int nLengthTicks,
int nChannel )

Construct a scratcher over three recorded pieces.

The scratcher loops each piece and keeps a copy of each.

Parameters
pFirstThe piece for the stick held left.
pSecondThe piece for the stick at rest.
pThirdThe piece for the stick held right.
nQuantumTicksThe ticks of the beat a piece starts on.
nLengthTicksThe ticks of one loop of each piece.
nChannelThe MIDI channel of the pieces.
Ghidra address:
NTSC-U/C: 0x00153e88
Ghidra address:
PAL: 0x001556f0

◆ ~Scratcher()

virtual Scratcher::~Scratcher ( )
virtual

Stop scratching and release the pieces.

Ghidra address:
NTSC-U/C: 0x00154210
Ghidra address:
PAL: 0x00155a78

Member Function Documentation

◆ Start()

virtual void Scratcher::Start ( int nPlayer,
int nTickOffset )
virtual

Start scratching for a player.

A piece starts at once in the first half of a beat and at the next beat otherwise.

Parameters
nPlayerThe player index.
nTickOffsetThe ticks the notes of the pieces are shown ahead of the current tick.
Ghidra address:
NTSC-U/C: 0x00154360
Ghidra address:
PAL: 0x00155bc8

◆ Stop()

virtual void Scratcher::Stop ( )
virtual

Stop scratching and bend the channel back.

Ghidra address:
NTSC-U/C: 0x00154440
Ghidra address:
PAL: 0x00155ca8

◆ IsScratching()

virtual int Scratcher::IsScratching ( )
virtual

Report whether the scratcher is scratching.

Returns
Non-zero while scratching.
Ghidra address:
NTSC-U/C: 0x001544b0
Ghidra address:
PAL: 0x00155d18

◆ GetLoopLength()

virtual int Scratcher::GetLoopLength ( )
virtual

Report the ticks of one loop of the pieces.

Returns
The ticks.
Ghidra address:
NTSC-U/C: 0x00154340
Ghidra address:
PAL: 0x00155ba8

◆ SetPitch()

virtual void Scratcher::SetPitch ( float fPitch)
virtual

Set the pitch.

A change of 0.02 or less is ignored.

Parameters
fPitchThe pitch, from -3 to 3 semitones.
Ghidra address:
NTSC-U/C: 0x001544b8
Ghidra address:
PAL: 0x00155d20

◆ SetPosition()

virtual void Scratcher::SetPosition ( float fPosition)
virtual

Pick the piece from the horizontal position of the stick.

Parameters
fPositionThe stick position, from -1 to 1.
Ghidra address:
NTSC-U/C: 0x00154508
Ghidra address:
PAL: 0x00155d70

Member Data Documentation

◆ kNumPieces

int Scratcher::kNumPieces = 3
staticconstexpr

Number of pieces, one for each stick position.


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