freq2pitch

Author: Remco van der Most
License: BSD
Github: sss/conv/freq2pitch.axo

Inlets

frac32 freq

Outlets

frac32 pitch

Parameters

bool32.tgl lfo

Declaration
int32_t out;
int32_t LOG(int32_t in) {
  Float_t f;
  f.f = in;
  int32_t r1 = ((f.parts.exponent & 0x7F) - 18) << 24;
  int32_t r3 = logt[f.parts.mantissa >> 15] << 10;
  out = r1 + r3;
}

int32_t FTOM(int32_t freq) {
  int32_t ptch;
  int32_t mid;
  MTOFEXTENDED(0, mid);
  LOG(mid);
  mid = out;

  int32_t to;
  LOG(freq);
  to = out;
  return ptch = (to - mid >> 1) * 3;
};
Control Rate
int32_t pitch;

outlet_pitch = FTOM(inlet_freq >> (param_lfo << 2));

Privacy

© 2024 Zrna Research