SyncPM3

Author: Smashed Transistors
License: LGPL
Github: tiar/osc/SyncPM3.axo

Inlets

frac32.bipolar pitch

frac32.bipolar pitchC

frac32.bipolar pitchM1

frac32.bipolar pitchM2

frac32.bipolar index1C

frac32.bipolar index21

Outlets

frac32buffer.bipolar out

Parameters

frac32.u.map index1C

frac32.u.map index21

frac32.s.map.pitch pitch

frac32.s.map.pitch pitchC

frac32.s.map.pitch pitchM1

frac32.s.map.pitch pitchM2

Declaration
uint32_t pC, pM1, pM2;
int32_t dpC, dpM1, dpM2;
int32_t index1C, index21;
float pMast;
float dpMast, _dpMast;
Init
pC = 0;
pM1 = 0;
pM2 = 0;
pMast = 0;
Control Rate
int32_t idp;
MTOFEXTENDED(inlet_pitch + param_pitch, idp);
dpMast = (0.25f / (1 << 30)) * idp;
_dpMast = 1.0f / dpMast;

MTOFEXTENDED(inlet_pitchC + param_pitchC, dpC);
MTOFEXTENDED(inlet_pitchM2 + param_pitchM2, dpM2);
MTOFEXTENDED(inlet_pitchM1 + param_pitchM1, dpM1);
index1C = inlet_index1C + param_index1C;
index21 = inlet_index21 + param_index21;
Audio Rate
pC += dpC;
pM1 += dpM1;
pM2 += dpM2;
int32_t m12 = (___SMMLA(index21, sine2t[pM2 >> 20], pM1 >> 7) >> 13) & 4095;
int32_t y = sine2t[(___SMMLA(index1C, sine2t[m12], pC >> 7) >> 13) & 4095] >> 5;
if (pMast > 0.9f) {
  y = (int32_t)(y * 10 * (1 - pMast));
}
if (pMast < 0.1f) {
  y = (int32_t)(y * 10 * pMast);
}
// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

pMast += dpMast;
if (pMast > 1) {
  pMast -= 1;
  float a = pMast * _dpMast;
  pC = (uint32_t)(a * dpC);
  pM1 = (uint32_t)(a * dpM1);
  pM2 = (uint32_t)(a * dpM2);
  /*  y = (y + (sine2t[(___SMMLA(index, sine2t[pM >> 20], pC >> 7) >> 13) &
   * 4095] >> 5)) >> 1;*/
}
outlet_out = y;

Privacy

© 2024 Zrna Research