oscLight

PIWT osc, needs to connect to a PIWT.
Author: Smashed Transistors
License: LGPL
Github: tiar/PIW/oscLight.axo

Inlets

bool32 disables the object

frac32.bipolar pitch

frac32.bipolar freq offset

Outlets

frac32buffer.bipolar wave

Parameters

frac32.s.map.pitch pitch

Attributes

objref piwt

Declaration
uint32_t p, dp; // phase and delta phase aka freq
int32_t I1_1;
int32_t inv;
Init
p = 0;
dp = 1;
I1_1 = 0;
Control Rate
if (!inlet_disable) {
  int32_t nextDp;
  MTOFEXTENDED(param_pitch + inlet_pitch, nextDp);
  nextDp = ___SMMLA(0x01000000, inlet_freq_space_offset, nextDp);
  nextDp >>= 32 - 22 - attr_piwt.LENGTHPOW;
  // the float division execs in parallel with integer operations.
  float nextInv = (((float)(1 << 16)) / arm::q_to_float(nextDp, 32));
  for (int j = 0; j < BUFSIZE; j++) {
    p += dp;
    int32_t I1_0 = attr_piwt.I1p32(p);
    outlet_wave[j] = ___SMMUL(I1_0 - I1_1, inv) << 13;
    I1_1 = I1_0;
  }
  dp = nextDp;
  inv = (int32_t)nextInv;
} else { // disabled
  for (int j = 0; j < BUFSIZE; j++) {
    outlet_wave[j] = 0;
  }
}

Privacy

© 2024 Zrna Research