ldub

adds data to the content of a table,at inlet pos (in fraction of the table's size).feedback controls feedback amount.attack and release control fade in and out.
Author: robert schirmer
License: BSD
Github: rbrt/looper/ldub.axo

Inlets

frac32.positive feedback amount

frac32buffer.positive index in fraction of table size

frac32buffer audio in

bool32.risingfalling overdub

Outlets

bool32 recording state,post - fadeout

Parameters

bool32.tgl if 'hard' is on,there will be NO fade-in

bool32.tgl disable fades

frac32.u.map feedback

frac32.s.map.kdecaytime.exp attack

frac32.s.map.kdecaytime.exp release

Attributes

objref table

Declaration
uint32_t csample;
uint32_t dub;

uint8_t shift;

int32_t env;
bool dubstate;
Init
shift = 27 - attr_table.LENGTHPOW;
Control Rate
if (!param_nofade) {
  if (inlet_overdub)
    env = (param_hard)
              ? (1 << 27)
              : (1 << 27) - (___SMMUL((1 << 27) - env, param_attack) << 1);
  else
    env = ___SMMUL(env, param_release) << 1;
  dubstate = env;
} else {
  dubstate = inlet_overdub;
  env = inlet_overdub << 27;
}

outlet_fade = dubstate;
Audio Rate
if (dubstate) {

  csample = (__USAT(inlet_phase, 27) >> shift);
  dub = (___SMMUL((attr_table.array[csample] << attr_table.GAIN),
                  (inlet_feedback + param_feedback))
         << 5);

  attr_table.array[csample] =
      (__SSAT((___SMMUL((inlet_wave), env) << 5) + dub, 28)) >> attr_table.GAIN;
}

Privacy

© 2024 Zrna Research