stackableScope

bipolar audio rate signal oscilloscope (time domain), showing 128 consecutive samples after the signal becomes positive. this module has outputs to link several scopes behind each other for a big scope
Author: Remco van der Most
License: BSD
Github: sss/disp/stackableScope.axo

Inlets

frac32buffer.bipolar input

bool32 hold

frac32buffer.positive syncIn

Outlets

frac32buffer thru

frac32buffer syncOut

Displays

int8array128.vbar scope

Declaration
int8_t t[128];
int index;
int32_t pval;
int32_t write;
int32_t array[128];
Init
int i;
for (i = 0; i < 128; i++)
  t[i] = 0;
index = 0;
pval = 0;
Control Rate
int i;
int32_t val;
if (index < 0) {
  for (i = 0; i < 16; i++) {

    val = (inlet_syncIn[i] - (1 << 10)) > (1 << 19);
    if (val && (!pval)) {

      index = 0;
      break;
    }
    pval = val;
  }
  if (index == 0) {
    for (; i < 16; i++) {
      t[index++] = (uint8_t)(inlet_in[i] >> 21);
    }
  }
} else {
  for (i = 0; i < 16; i++) {
    if (index == 128) {

      index = -1;
      break;
    }
    t[index++] = (uint8_t)(inlet_in[i] >> 21);
  }
  if ((index == -1) && (!inlet_hold)) {
    for (i = 0; i < 128; i++)
      disp_scope[i] = t[i];
    pval = (inlet_syncIn[BUFSIZE - 1] - (1 << 10)) > (1 << 19);
  }
}
for (i = 0; i < 16; i++) {
  outlet_thru[i] = inlet_in[i];
}
Audio Rate
write += 1;
write = write & 127;
outlet_syncOut = array[(write)];
array[write] = (val && (!pval)) > 0 ? 1 << 27 : -1 << 27;

Privacy

© 2024 Zrna Research