s2f mul

converts samples to units suitable for setting the frequency of oscillators. the result is multiplied with inle 'mul'.
Author: robert schirmer
License: who cares
Github: rbrt/math/s2f mul.axo

Inlets

frac32 multiplier

int32 samples in

Outlets

frac32 frequency out

Control Rate
uint32_t freq;

if (inlet_smps) {
  if (inlet_smps < (1 << 21))
    freq = (int)(281474976710656.f / (inlet_smps * (128 << 3)));
  else
    freq = (281474976710656 >> 10) / ((inlet_smps >> 10) * (128 << 3));
  outlet_freq = ___SMMUL(inlet_mul, freq) << 5;
} else
  outlet_freq = 0;

Privacy

© 2024 Zrna Research