ScopeRG

bipolar audio rate signal oscilloscope (time domain), showing 128 consecutive samples after the signal becomes positive. Has rate control and gain ( x1.000=unity)
Author: Remco van der Most
License: BSD
Github: sss/disp/ScopeRG.axo

Inlets

frac32buffer.bipolar input

bool32 hold

Outlets

None

Parameters

int32 rate

frac32.u.map.gain16 gain

Displays

int8array128.vbar scope

Declaration
int8_t t[128];
int index;
int32_t pval;
int count;
int i;
int C1;
int gtrig;
Init
for (i = 0; i < 128; i++)
  t[i] = 0;
index = 0;
pval = 0;
Control Rate
if (C1 == 127) {
  for (i = 0; i < 128; i++) {
    disp_scope[i] = t[i];
  }
}
Audio Rate
if ((inlet_in > 0) && !gtrig) {
  gtrig = 1;
  C1 = 0;
  count = 0;
} else if (C1 == 127) {
  gtrig = 0;
}

if (count >= param_rate) {
  count = 0;
}
if (count == 0) {
  t[C1] = ___SMMUL(inlet_in >> 16, param_gain);
  C1 += 1;

  C1 = C1 & 127;
}
count += 1;

Privacy

© 2024 Zrna Research