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

Program settings of one instrument of a bank, shared with the synthesiser on the IOP. More...

#include <Instrument.h>

Public Member Functions

 Instrument ()
 Create an instrument and reset it.
void Init ()
 Reset every field to its default.
int FromStream (const unsigned char *data)
 Read the instrument from its stream form.
int ToStream (unsigned char *data) const
 Write the instrument in its stream form, as version 1.

Static Public Member Functions

static int StreamSize ()
 Report the size of the stream form.

Public Attributes

unsigned short mProgram
unsigned char mPan
unsigned char mVolume
signed char mTranspose
signed char mFineTranspose
unsigned short mNumSampleDescs

Detailed Description

Program settings of one instrument of a bank, shared with the synthesiser on the IOP.

The class has no RTTI, and its name is inferred from its source file. The record is 8 bytes, laid out as the program of the IOP synthesiser. Its stream form is a version word followed by the fields, 0xc bytes in all.

Constructor & Destructor Documentation

◆ Instrument()

Instrument::Instrument ( )

Create an instrument and reset it.

Ghidra address:
0x1002b7f0

Member Function Documentation

◆ Init()

void Instrument::Init ( )

Reset every field to its default.

Ghidra address:
0x1002b80a

◆ FromStream()

int Instrument::FromStream ( const unsigned char * data)

Read the instrument from its stream form.

Only version 1 is accepted.

Parameters
dataThe stream form.
Returns
The number of bytes read.
Ghidra address:
0x1002b83c

◆ ToStream()

int Instrument::ToStream ( unsigned char * data) const

Write the instrument in its stream form, as version 1.

Parameters
dataReceives StreamSize() bytes.
Returns
The number of bytes written.
Ghidra address:
0x1002b98c

◆ StreamSize()

int Instrument::StreamSize ( )
static

Report the size of the stream form.

Returns
The size in bytes.
Ghidra address:
0x1002ba8e

Member Data Documentation

◆ mProgram

unsigned short Instrument::mProgram

Program number a program change requests.

◆ mPan

unsigned char Instrument::mPan

Pan offset, where 64 is the centre.

◆ mVolume

unsigned char Instrument::mVolume

Volume, an index into the volume curve.

◆ mTranspose

signed char Instrument::mTranspose

Transposition in semitones.

◆ mFineTranspose

signed char Instrument::mFineTranspose

Transposition in cents.

◆ mNumSampleDescs

unsigned short Instrument::mNumSampleDescs

Sample descriptions of the instrument.


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