PCM8.Channel

Defines a single channel's statuses.

Members

Functions

calculateJumpAm
void calculateJumpAm(int sampleRate, float lfoOut)

Calculates jump amount for the sample.

decodeMore
void decodeMore(SampleAssignment sa, Sample slmp)

Decodes one more block worth of samples, depending on internal state.

reset
void reset()

Resets all internal states.

setADSR
void setADSR(int sampleRate)
Undocumented in source. Be warned that the author may not have intended to support it.
setShpVals
void setShpVals(float vel)

Recalculates shape params.

Variables

bankNum
ushort bankNum;

Bank select number.

currNote
ubyte currNote;

The currently played note + Bit 8 indicates suspension.

currShpA
float currShpA;

The current attack shape

currShpR
float currShpR;

The current release shape

decoderBuffer
int[256] decoderBuffer;

Stores decoded samples.

decoderWorkpad
DecoderWorkpad decoderWorkpad;

Stores the current state of the decoder.

envGen
ADSREnvelopGenerator envGen;

Channel envelop generator.

freqRatio
double freqRatio;

Sampling-to-playback frequency ratio, with pitch bend, LFO, and envGen applied.

jumpAm
uint jumpAm;

Jump amount for current sample, calculated from freqRatio.

modWheel
float modWheel;

Modulation wheel normalized between 0 and 1

outPos
ulong outPos;

Position in decoded amount, including fractions

pitchBend
float pitchBend;

Current amount of pitch bend.

presetCopy
Preset presetCopy;

The copy of the preset.

presetNum
ubyte presetNum;

Selected preset.

samplesHave
ulong samplesHave;

Amount of decoded samples with fractions offsetted

savedDWState
DecoderWorkpad savedDWState;

The state of the decoder when the beginning of the looppoint has been reached.

status
uint status;

Channel status flags. Bit 1: Note on, Bit 2: Sample run out approaching, Bit 3: In loop, Bit 4: Bufferhalf

velocity
float velocity;

Velocity normalized between 0 and 1

waveModWorkpad
WavemodWorkpad waveModWorkpad;

Stores the current state of the wave modulator.

Meta