reverb

reverb/early reflection module with internal feedback path, uses SDRAM memory. use bipolar 16x slider table for setting writevolume and readvolume for all delay-taps use unipolar 16x slider table for setting panning, writesize and readsize for all delay-taps -predelay sets an extra time-offset between write-taps and read-taps -feed allows the sum of both outputs to be fed back into all write-taps -damp is a simple lowpass filter, filtering the delayed input and feedback -wet sets the wet-level of the delayed signal. -stackwrite sets how many writers will be created (write-taps) -stackread sets how many readers will be created (read-taps)
Author: Remco van der Most
License: BSD
Github: sss/fx/reverb.axo

Inlets

frac32buffer wave input

frac32buffer R

Outlets

frac32buffer outL

frac32buffer outR

Parameters

frac32.u.map predelay

frac32.s.map feed

frac32.s.map wet

frac32.s.map.pitch damp

int32 stackwrite

int32 stackread

Attributes

combo size

objref writesize

objref readsize

objref writevolume

objref readvolume

objref panning

Declaration
static const uint32_t LENGTHPOW = (attr_size);
static const uint32_t LENGTH = (1 << attr_size);
static const uint32_t LENGTHMASK = ((1 << attr_size) - 1);
int16_t *array;
uint32_t writepos;
int i;
uint32_t rnd[32];
int32_t sum1;
int32_t sum2;
int32_t damp;
int rtrig;
int32_t HP;
Init
static int16_t _array[attr_poly][1 << attr_size]
    __attribute__((section(".sdram")));
array = &_array[parent->polyIndex][0];
int i;
writepos = 0;
for (i = 0; i < LENGTH; i++)
  array[i] = 0;
Control Rate
int32_t D;
MTOF(param_damp, D)
Audio Rate
int32_t in =
    __SSAT((inlet_L + inlet_R >> 1) +
               ___SMMUL((param_feed * 3 /
                         (((param_stackread + param_stackwrite >> 1) - 1) + 1))
                            << 1,
                        (sum1 + sum2) << 4),
           27);
damp = ___SMMLA((in - damp) << 1, D, damp);
HP = HP + ((damp - HP) >> 13);
writepos = (writepos + 1) & LENGTHMASK;
array[writepos] = __SSAT(damp - HP >> 14, 28);
sum1 = 0;
sum2 = 0;
for (i = 0; i < param_stackwrite; i++) {
  array[(writepos - (attr_writesize.array[i] >> 27 - LENGTHPOW - 1)) &
        LENGTHMASK] +=
      ___SMMUL(damp - HP >> 11, attr_writevolume.array[i] << 2);
}
for (i = 0; i < param_stackread; i++) {
  int32_t H = ___SMMUL(
      ((array[(writepos - (attr_readsize.array[i] >> 27 - LENGTHPOW - 1) -
               ___SMMUL(param_predelay << 3, LENGTHMASK << 2)) &
              LENGTHMASK]
        << 14))
          << 3,
      attr_readvolume.array[i] << 2);
  sum1 += ___SMMUL(attr_panning.array[i] << 3, H << 2);
  sum2 += ___SMMUL(((1 << 27) - (attr_panning.array[i])) << 3, H << 2);
}
outlet_outL = inlet_L + ___SMMUL(sum1 << 3, param_wet << 3);
outlet_outR = inlet_R + ___SMMUL(sum2 << 3, param_wet << 3);

Privacy

© 2024 Zrna Research