kscope 128 b trig

bipolar control rate signal oscilloscope (time domain), showing 128 consecutive samples after the signal becomes positive.
Author: Johannes Taelman
License: BSD
Github: disp/kscope 128 b trig.axo

Inlets

frac32.bipolar input

bool32 hold

Outlets

None

Displays

int8array128.vbar scope

Declaration
int8_t t[128];
int index;
int32_t pval;
Init
int i;
for (i = 0; i < 128; i++)
  t[i] = 0;
index = 0;
pval = 0;
Control Rate
int i;
if (index < 0) {
  int32_t val = (inlet_in) > (1 << 19);
  if (val && (!pval)) {
    index = 0;
  }
  pval = val;
  if (index == 0) {
    t[index++] = (uint8_t)(inlet_in >> 21);
  }
} else {
  if (index == 128) {
    index = -1;
  } else
    t[index++] = (uint8_t)(inlet_in >> 21);
  if ((index == -1) && (!inlet_hold)) {
    int i;
    for (i = 0; i < 128; i++)
      disp_scope[i] = t[i];
    pval = inlet_in > (1 << 19);
  }
}

Privacy

© 2024 Zrna Research