ktransport

sort of a transport for sequencing. 3000 at inlet 'kticks' 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/ktransport.axo

Inlets

frac32 reset phase to position

int32 length in kticks

int32 multiplies 'factor'

bool32.risingfalling or 'mode'

bool32.rising reset phase

Outlets

int32 step index from 0 to 'steps'

bool32.pulse 24 ppq pulse

frac32 phase 0. till 64.

Parameters

bool32.tgl 0 = multiply, 1 = divide

int32 multiplication or division factor

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_kticks * factor)
                                  : (inlet_kticks / factor);
freq = (int)(281474976710656.f / (base * (128 << 7)));
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