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

The state of one MIDI channel. More...

#include <channel.h>

Public Member Functions

 Channel ()
 Construct a channel with the defaults Init() sets.
void ResetControllers ()
 Reset the controllers ResetAllControllers() covers, retaining the bank, program, pitch bend, and transposition.
void Init ()
 Reset every field, clearing the bank and program.
void SetTranspose (signed char transpose)
 Set the transposition.

Public Attributes

int mBank
int mProgram
unsigned char mVolume
unsigned char mExpression
unsigned char mPan
signed char mPitchBendSemitones
signed char mPitchBendCents
signed char mTranspose
unsigned char mPriority
unsigned char mBusMode
unsigned short mBus
unsigned int mDetune
unsigned int mStereo
unsigned int mMonophonic
unsigned char mControllerEnable [kNumControllerEnables]

Static Public Attributes

static constexpr int kNoBank = -1
static constexpr int kNoProgram = -1
static constexpr unsigned char kBusModeFromSampleDesc = 4
 mBusMode value that defers to each sample descriptor's bus and mix.

Detailed Description

The state of one MIDI channel.

The class has no RTTI, and its name is inferred from its role. A change to a controller whose mControllerEnable entry is at least 64 updates the channel's sounding voices at once; otherwise it applies only to later notes.

Constructor & Destructor Documentation

◆ Channel()

Channel::Channel ( )
inline

Construct a channel with the defaults Init() sets.

Member Function Documentation

◆ ResetControllers()

void Channel::ResetControllers ( )

Reset the controllers ResetAllControllers() covers, retaining the bank, program, pitch bend, and transposition.

It is never called.

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

◆ Init()

void Channel::Init ( )

Reset every field, clearing the bank and program.

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

◆ SetTranspose()

void Channel::SetTranspose ( signed char transpose)

Set the transposition.

Parameters
transposeTransposition in semitones.
Ghidra address:
NTSC-U/C: 0x00002188
Ghidra address:
PAL: 0x00002188

Member Data Documentation

◆ kNoBank

int Channel::kNoBank = -1
staticconstexpr

mBank when the channel has no bank.

◆ kNoProgram

int Channel::kNoProgram = -1
staticconstexpr

mProgram when the channel has no program.

◆ kBusModeFromSampleDesc

unsigned char Channel::kBusModeFromSampleDesc = 4
staticconstexpr

mBusMode value that defers to each sample descriptor's bus and mix.

◆ mBank

int Channel::mBank

Bank slot, or kNoBank.

◆ mProgram

int Channel::mProgram

Program slot in the bank, or kNoProgram.

◆ mVolume

unsigned char Channel::mVolume

Volume, controller 7.

◆ mExpression

unsigned char Channel::mExpression

Expression, controller 17.

◆ mPan

unsigned char Channel::mPan

Pan, controller 10, where 64 is the centre.

◆ mPitchBendSemitones

signed char Channel::mPitchBendSemitones

Pitch bend, whole semitones.

◆ mPitchBendCents

signed char Channel::mPitchBendCents

Pitch bend, remaining cents.

◆ mTranspose

signed char Channel::mTranspose

Transposition in semitones, controller 91.

◆ mPriority

unsigned char Channel::mPriority

Voice priority, controller 16; lower is stolen first.

◆ mBusMode

unsigned char Channel::mBusMode

Dry and reverb mix, controller 93.

◆ mBus

unsigned short Channel::mBus

Preferred core, controller 94.

◆ mDetune

unsigned int Channel::mDetune

Nonzero to add vibrato, controller 18.

◆ mStereo

unsigned int Channel::mStereo

Nonzero for hard-panned pairs, controller 19.

◆ mMonophonic

unsigned int Channel::mMonophonic

Nonzero to silence before a note, controller 13.

◆ mControllerEnable

unsigned char Channel::mControllerEnable[kNumControllerEnables]

Live-update switches.


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