78 unsigned char bankVolume,
79 unsigned char programVolume,
80 unsigned char sampleVolume,
81 unsigned char channelVolume,
82 unsigned char channelExpression,
86 signed char surround);
101 unsigned char note,
unsigned char baseKey,
int semitones,
int cents,
int sampleRate);
A sample descriptor loaded into a bank, linked to the sample it plays.
Definition banksampledesc.h:12
unsigned char mPriority
Definition voice.h:135
unsigned char mNote
Definition voice.h:126
unsigned char mVelocity
Definition voice.h:128
Voice()
Construct a free voice with no descriptor.
Definition voice.h:23
void Dump() const
Print the voice's descriptor to the console.
int mVibratoTable
Definition voice.h:131
int mVibratoPhase
Definition voice.h:130
unsigned char mChannel
Definition voice.h:125
unsigned short mBank
Definition voice.h:127
BankSampleDesc * mSampleDesc
Definition voice.h:134
static unsigned int CalculatePitch(unsigned char note, unsigned char baseKey, int semitones, int cents, int sampleRate)
Compute the pitch register of a note.
int mState
Definition voice.h:133
unsigned int mAge
Definition voice.h:132
void Init()
Free the voice.
static void CalculateVolume(unsigned char velocity, unsigned char bankVolume, unsigned char programVolume, unsigned char sampleVolume, unsigned char channelVolume, unsigned char channelExpression, unsigned char pan, unsigned int *left, unsigned int *right, signed char surround)
Compute the left and right volume registers of a note.
int mPitch
Definition voice.h:129
void ComputeVolume(unsigned int *left, unsigned int *right) const
Compute the voice's volume registers from its channel, bank, program, and descriptor.
unsigned int ComputePitch() const
Compute the voice's pitch register from its channel, program, and descriptor, without vibrato.
static int FindFree(Voice *voices, int count, int *stealIndex)
Find the first free voice of a core, or else the best voice to steal.
VoiceState
The life of a Voice.
Definition voice.h:6
@ kVoiceFree
Definition voice.h:7
@ kVoiceReleased
Definition voice.h:10
@ kVoicePlaying
Definition voice.h:9
@ kVoiceKeyOn
Definition voice.h:8