QM816.Operator

Implements a single operator.

Contains an oscillator, an ADSR envelop generator, and locals.

Members

Functions

calculateKSL
void calculateKSL(ubyte note)

Calculates KSL values

keyOff
void keyOff(int sampleRate)

Sets the key to off on this channel. Also calculates adaptive release rates if needed.

setEG
void setEG(int sampleRate, ubyte note, float vel)

Sets the Envelop generator

setFrequency
void setFrequency(int slmpFreq, ubyte note, double pitchBend, double tuning)

Sets the frequency of the operator Also calculates KSL levels

setShpVals
void setShpVals(float vel)

Recalculates shape params.

Variables

eg
ADSREnvelopGenerator eg;

The envelop generator of the operator.

fbL
float fbL;

Calculated feedback level containing KSL damping

feedback
int feedback;

Feedback register. Either out_0[n-1] or out[n-1] multiplied by feedback amount. The amount which the oscillator will be offsetted. Negative if inverted.

input
int input;

Input register. The amount which the oscillator will be offsetted.

outL
float outL;

Calculated output level containing KSL damping

output
int output;

Output register. Not affected by either level or EG Might be used for ring modulation.

output_0
int output_0;

Output affected by EEG and level. Either used for audible output, or to modulate other operators

pos
uint pos;

The current position of the oscillator, including fractions.

preset
Preset.Op preset;

Local copy of operator preset data.

shpA0
float shpA0;

Live calculated out of shpA

shpR0
float shpR0;

Live calculated out of shpR

step
uint step;

The amount the oscillator must be stepped forward each cycle, including fractions.

Meta