simpleTable

simple wavetable oscillator loads wavetables created with the "TheCreator" module.
Author: Remco van der Most
License: BSD
Github: sss/osc/simpleTable.axo

Inlets

frac32buffer frequency

frac32buffer expFM

frac32buffer phase

frac32buffer sync

int32 waveform

frac32 mixSine

frac32.bipolar pitch

Outlets

frac32buffer.bipolar sine wave

Parameters

frac32.s.map.pitch pitch

frac32.s.map.pitch LP

int32 octSine

int32 waveform

frac32.u.map mixSine

Attributes

objref table

Declaration
uint32_t Phase;
int32_t mix1;
int32_t mix2;
int32_t mix3;
int32_t MIX1;
int32_t MIX2;
int32_t MIX3;
int32_t read1;
int32_t read2;
int32_t read3;
int32_t read4;
int i;
int Strig;
int32_t wave;
int32_t smooth;
int32_t mixSine;
Init
Phase = 0;
Control Rate
int16_t preset1 = (param_waveform + inlet_waveform) & 1023;
int32_t f;
MTOF(param_LP, f)
Audio Rate
int32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch + inlet_expFM, freq);
int32_t Freq = freq + ___SMMUL(inlet_linFM << 3, freq << 3);
if ((inlet_sync > 0) && !Strig) {
  Phase = 0;
  Strig = 1;
} else if (inlet_sync < 1) {
  Strig = 0;
}

mixSine = mixSine + (((param_mixSine + inlet_mixSine) - mixSine) >> 8);

Phase += Freq;
int32_t r;
int32_t p2 = Phase + inlet_phase;
SINE2TINTERP((p2) << param_octSine, r)
read1 =
    attr_table
        .array[(((p2 >> 22) & 1023) + (preset1 << 10)) & attr_table.LENGTHMASK];
wave = (___SMMUL(mixSine << 3, read1 << 2) + ___SMMUL(r, (1 << 27) - mixSine));
smooth = __SMMLA((wave - smooth) << 1, f, smooth);
outlet_wave = smooth;

Privacy

© 2024 Zrna Research