gen t

Author: Smashed Transistors
License: LGPL
Github: tiar/8bit/gen t.axo

Inlets

bool32.rising reset

frac32 offset

Outlets

frac32buffer.bipolar wave

Parameters

int32 clkDiv

Attributes

text code

Declaration
int32_t tc;
int16_t c;
int32_t out;
bool ares = false;
int32_t s(int32_t x) { return (sine2t[(x & 255) << 4] >> 24) + 128; }
Init
c = 0;
tc = 0;
Control Rate
int32_t offset = inlet_offset >> 9;
if (inlet_reset && !ares) {
  tc = 0;
}
ares = inlet_reset;
Audio Rate
if (c >= param_clkDiv) {
  c = 0;
  // t*((t>>12|t>>8)&63&t>>4)
  // t&17*t&91+t>>5
  int32_t t = tc + offset;
  out = (attr_code);
  tc++;

  out &= 255;
  out -= 128;
  out <<= 20;
}
c++;
outlet_wave = out;

Privacy

© 2024 Zrna Research