ktransport f

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 factor,where 'factor' < 1 results in a division. 'reset' resets the phase to the value at inlet 'pos'. outlet 'kticks'== the length in kticks after the scaling.
Author: robert schirmer
License: BSD
Github: rbrt/seq/ktransport f.axo

Inlets

int32 length in samples

frac32.positive scaling factor

frac32.positive pos

bool32.rising reset phase to 'pos'

Outlets

frac32 phase 0. till 64.

int32 step index from 0 to 'steps'

int32 length in k-ticks

bool32.pulse 24 ppq pulse

Parameters

frac32.u.map factor

Attributes

combo how many steps per bar?

Declaration
uint32_t Phase;
uint32_t pos;
uint32_t r;
uint64_t freq;
uint32_t base;
uint32_t factor;
uint8_t steps;
uint32_t prev;
uint32_t ppq;
Init
Phase = 0;
r = 1;
Control Rate
factor = (param_factor + inlet_factor) >> 16;
base = (inlet_kticks << 5) / factor;
freq = (int)(281474976710656.f / (base * (128 << 7)));
steps = 29 - attr_steps;

{
  if (inlet_reset && r) {
    Phase = inlet_pos << 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;
}

outlet_kticks = base;

Privacy

© 2024 Zrna Research