DevilSync

Advanced version with built-in Master oscillator. See help patch for usage !!
Author: Smashed Transistors
License: LGPL
Github: tiar/osc/DevilSync.axo

Inlets

frac32.bipolar pitch_slave

frac32.bipolar pitch master

Outlets

frac32buffer.bipolar out

Parameters

frac32.s.map.pitch pitch slave

frac32.s.map.pitch pitch master

Declaration
// dissym picky sqr
float F(float p) {
  float x = p - (int)(p);
  x = 4 * x - 1;
  if (x > 1)
    return 0.125f * 0.5f * (2 - x);
  else
    return x * x * x * 0.5f * 0.125f;
}

float pM, pS, dpM, _dpM, dpS, _dpS, f, FpS;
Init
pM = 0;
pS = 0;
FpS = 0;
Control Rate
int32_t idp;
MTOFEXTENDED(param_pitch_space_slave + inlet_pitch_space_slave, idp);
dpS = (idp * (0.25f / (1 << 30)));
_dpS = 1.0f / dpS;

// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
MTOFEXTENDED(param_pitch_space_master + inlet_pitch_space_master, idp);
dpM = (idp * (0.25f / (1 << 30)));
_dpM = 1 / dpM;
Audio Rate
pM += dpM;
if (pM > 1) {
  pM -= 1;
  float a = pM * _dpM;

  f = F(pS + (1 - a) * dpS) - FpS;
  pS = a * dpS;
  FpS = F(pS);
  f += FpS - F(0);
  f *= _dpS;
} else {
  f = FpS;
  pS += dpS;
  if (pS > 1)
    pS -= 1;
  FpS = F(pS);
  f = (FpS - f) * _dpS;
}
outlet_out = (int32_t)((1 << 27) * f);

Privacy

© 2024 Zrna Research