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

One program (instrument) of a bank, as the bank file records it. More...

#include <program.h>

Inheritance diagram for Program:

Public Member Functions

 Program ()
 Construct a program with the defaults Init() sets.
void Init ()
 Reset every field to its default.
int Unpack (const unsigned char *data)
 Read the program from a serialised record.
int Pack (unsigned char *data) const
 Write the program as a serialised record of the current version.
int PackedSize () const
 Report the size of a serialised record of the current version.

Public Attributes

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

Detailed Description

One program (instrument) of a bank, as the bank file records it.

The class has no RTTI, and its name is inferred from its role. A program has a run of sample descriptors, one per key range. The serialised record is a version word followed by the fields in member order, with no padding.

Constructor & Destructor Documentation

◆ Program()

Program::Program ( )

Construct a program with the defaults Init() sets.

Ghidra address:
NTSC-U/C: 0x00000880
Ghidra address:
PAL: 0x00000880

Member Function Documentation

◆ Init()

void Program::Init ( )

Reset every field to its default.

Ghidra address:
NTSC-U/C: 0x000008a8
Ghidra address:
PAL: 0x000008a8

◆ Unpack()

int Program::Unpack ( const unsigned char * data)

Read the program from a serialised record.

A record of an unknown version does not change the program.

Parameters
dataThe record, at any alignment.
Returns
The bytes consumed, four for an unknown version.
Ghidra address:
NTSC-U/C: 0x000008cc
Ghidra address:
PAL: 0x000008cc

◆ Pack()

int Program::Pack ( unsigned char * data) const

Write the program as a serialised record of the current version.

Parameters
dataReceives the record, at any alignment.
Returns
The bytes written.
Ghidra address:
NTSC-U/C: 0x00000980
Ghidra address:
PAL: 0x00000980

◆ PackedSize()

int Program::PackedSize ( ) const

Report the size of a serialised record of the current version.

Returns
The size in bytes.
Ghidra address:
NTSC-U/C: 0x000009fc
Ghidra address:
PAL: 0x000009fc

Member Data Documentation

◆ mProgram

unsigned short Program::mProgram

Program number a program change requests.

◆ mPan

unsigned char Program::mPan

Pan offset, where 64 is the centre.

◆ mVolume

unsigned char Program::mVolume

Volume, an index into the volume curve.

◆ mTranspose

signed char Program::mTranspose

Transposition in semitones.

◆ mFineTranspose

signed char Program::mFineTranspose

Transposition in cents.

◆ mNumSampleDescs

unsigned short Program::mNumSampleDescs

Sample descriptors in the program's run.


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