class a

"Class A" distortion. Class A refers to an amplifier topology, with asymetrical overdrive properties. This object adds variable DC offset, a subtle highpass filter can be useful before further processing.
Author: Johannes Taelman
License: GPL
Github: jt/dist/class a.axo

Inlets

frac32buffer input

Outlets

frac32buffer output

Parameters

frac32.u.map overdrivel level

Declaration
int32_t prev = 0;
int32_t prev2 = 0;
int32_t prev_in = 0;
Control Rate
int i;

int32_t drive_complement = (1 << 27) - param_drive;
int32_t drive_complement_square = ___SMMUL(drive_complement, drive_complement)
                                  << 2;
drive_complement = drive_complement >> 1;
for (i = 0; i < BUFSIZE; i++) {
  int32_t mul1 = ___SMMUL((inlet_in[i] + prev_in), prev + prev2);
  int32_t biased1 =
      __SSAT(___SMMLA(param_drive << 4, mul1 + 0x00800000 + drive_complement,
                      drive_complement_square),
             26)
      << 5;
  prev2 = prev;
  prev = biased1;
  outlet_out[i] = mul1;
  prev_in = inlet_in[i];
}

Privacy

© 2024 Zrna Research