track

Polyphonic, Polyrythmic, Polymetric sequencer outputs the current step for a give track and pulse for each step change, connect to polyseq/read or polyseq/note
Author: Mark Harris
License: GPL
Github: tb/seq/polyseq/track.axo

Inlets

int32.positive trkIdx

Outlets

int32 stepIdx

bool32.pulse stepTrig

int32.positive trkIdx

Attributes

objref seq

Declaration
uint32_t count_ = 0;
uint32_t step_ = 0;
Control Rate
int32_t trkIdx =
    inlet_trkIdx < attr_seq.maxTracks_ ? inlet_trkIdx : attr_seq.maxTracks_ - 1;

outlet_stepTrig = false;
if (attr_seq.clkTrig_) {
  int32_t clkDiv = attr_seq.seqClkDivs_[trkIdx];
  count_ = (++count_) % clkDiv;
  if (!count_) {
    int32_t maxStep = attr_seq.seqSteps_[trkIdx];
    step_ = (++step_) % maxStep;
    outlet_stepTrig = true;
  }
}

outlet_stepIdx = step_;
outlet_trkIdx = trkIdx;

Privacy

© 2024 Zrna Research