inject

injects a signal into a delay line
Author: Smashed Transistors
License: LGPL
Github: tiar/delay/inject.axo

Inlets

frac32buffer in

frac32.bipolar gain

Outlets

None

Parameters

frac32.u.map gain

int32 pos

Attributes

objref delayName

Control Rate
int32_t gain = __USAT(param_gain + inlet_gain, 29);
// note: read/write indexes are set BUFSIZE samples back as we will process a
// batch of BUFSIZE samples so beware of overlappings when param_delays defer by
// less than 16 samples
int32_t rw = (attr_delayName.writepos - (BUFSIZE - 1) - param_pos) &
             attr_delayName.LENGTHMASK;

// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
for (int i = 0; i < BUFSIZE; i++) {
  //                                       q27       q27
  attr_delayName.array[rw] =
      ___SMMLA(inlet_in[i], gain, attr_delayName.array[rw] << (22 - 15)) >>
      (22 - 15);
  rw = (rw + 1) & attr_delayName.LENGTHMASK;
}

Privacy

© 2024 Zrna Research