stransport

sort of a transport for sequencing. 48000 at inlet 'smps' will result in a 1hz wave ranging from 0 to 64. also,a position between 0 and the value of 'steps' is put out,as well as 24ppq - pulses. 'factor' sets a multiplikation or divison factor,while 'mode' selects whether to multiply or divide the 'tempo'.
Author: robert schirmer
License: BSD
Github: rbrt/seq/stransport.axo

Inlets

bool32.risingfalling or 'mode'

bool32.rising reset phase

frac32 reset phase to position

int32 length in samples

int32 multiplies 'factor'

Outlets

frac32 phase 0. till 64.

int32 step index from 0 to 'steps'

bool32.pulse 24 ppq pulse

Parameters

int32 multiplication or division factor

bool32.tgl 0 = multiply, 1 = divide

Attributes

combo how many steps per bar?

Declaration
uint32_t Phase;
uint32_t r;
uint64_t freq;
uint32_t base;
uint8_t factor;
uint8_t steps;
uint32_t prev;
uint32_t ppq;
Init
Phase = 0;
r = 1;
Control Rate
factor = ((inlet_factor) ? inlet_factor : 1) * param_factor;

base =
    (param_mode || inlet_mode) ? (inlet_smps * factor) : (inlet_smps / factor);
freq = (int)(281474976710656.f / (base * (128 << 3)));
steps = 29 - attr_steps;

{
  if (inlet_reset && r) {
    Phase = inlet_topos << 5;
    r = 0;
  } else {
    if (!inlet_reset)
      r = 1;
    Phase += freq >> 2;
  }
  outlet_phase = (Phase >> 5);
  outlet_step = (Phase >> steps);

  ppq = ((Phase >> 25) * 3) >> 2;
  if (ppq != prev) {
    outlet_24ppq = 1;
    prev = ppq;
  } else
    outlet_24ppq = 0;
}

Privacy

© 2024 Zrna Research