peuclid_seq

Pseudo euclidean sequencer
Author: JLS
License: BSD
Github: jls/seq/peuclid_seq.axo

Inlets

bool32.rising trigger

bool32.rising reset

bool32 active

Outlets

frac32.positive wave

bool32 gate

Attributes

spinner steps

spinner hits

Displays

bool32 bit

Declaration
int res;
int gate;
int bit;
int steps;
int hits;
int nx;
int ny;
int tx;
int ty;
Init
gate = 0;
res = 0;
bit = 0;
steps = attr_steps;
hits = attr_hits;
tx = 0;
ty = 0;
Control Rate
if (inlet_active > 0) {

  if ((inlet_trig > 0) && !gate) {

    nx = tx;
    ny = ty;

    if (ny == 0) {

      tx = 1 + (GenerateRandomNumber() % steps);
      ty = hits;

      bit = 1;

    } else {

      tx = ny;
      ty = nx % ny;

      bit = 0;
    }

    gate = 1;

  }

  else if (!(inlet_trig > 0))
    gate = 0;

  outlet_gate = bit;

  disp_bit = bit;

  outlet_wave = nx * (1 << 22);

}

else {

  outlet_wave = 0;
  outlet_gate = 0;
}

if ((inlet_rst > 0) && !res) {

  tx = 0;
  ty = 0;
  bit = 0;
  res = 1;

}

else if (!(inlet_rst > 0))
  res = 0;

Privacy

© 2024 Zrna Research