2coreModOsc

2-core oscillator featuring: -two cores which are treated as x/y coördinates to perform a "distance-from-center-relocation"-function. (or how the hack you want to name it, it provides a shaping control and that's what matters) The higher the "power" knob, the more it saturates the output. -both inputs and parameters for each control -pitch-offset for both oscillators -independent cross FM from output to the two cores, linear and exponential. -external linear FM using frequency dependent modulation-index. -external PM with PM width control -lowpass and highpass filtering over output and internal LFM with additional pitch-tracking width (pitch inputs+paramaters divided by two).
Author: Remco van der Most
License: BSD
Github: sss/osc/2coreModOsc.axo

Inlets

bool32 active

frac32.bipolar pitch

frac32.bipolar pitch2

frac32buffer frequency

frac32buffer phase

frac32 ExtLFM

frac32 ExtPM

frac32 EFM1

frac32 LFM1

frac32 EFM2

frac32 LFM2

frac32 Filtertrack

Outlets

frac32buffer.bipolar sine wave

Parameters

frac32.s.map.pitch pitch1

frac32.s.map.pitch pitch2

frac32.s.map.pitch LP

frac32.s.map.pitch HP

frac32.s.map ExtLFM

frac32.s.map ExtPM

frac32.s.map EFM1

frac32.s.map LFM1

frac32.s.map EFM2

frac32.s.map LFM2

frac32.u.map Filtertrack

frac32.u.map Power

Declaration
uint32_t Phase1;
uint32_t Phase2;
int32_t r1;
int32_t r2;
int32_t r7;
int32_t val1;
int32_t val2;
int32_t val3;
int32_t pitcin;
int32_t f;
int32_t g;
Init
Phase1 = 0;
Phase2 = 0;
val1 = 0;
val2 = 0;
val3 = 0;
r1 = 0;
r2 = 0;
r7 = 0;
Control Rate
if (inlet_active > 0) {
  pitcin = ___SMMUL((((inlet_pitch1 + inlet_pitch2) >> 1) +
                     ((param_pitch1 + param_pitch2) >> 1))
                        << 2,
                    (inlet_Filtertrack + param_Filtertrack) << 3);

  MTOF(param_LP + pitcin, f);

  MTOF(param_HP + pitcin, g);
}
Audio Rate
if (inlet_active > 0) {

  int32_t freq1;
  MTOFEXTENDED(param_pitch1 + inlet_pitch1 +
                   ___SMMUL((inlet_EFM1 + param_EFM1) << 3, r2 >> 2),
               freq1);

  int32_t freq2;
  MTOFEXTENDED(param_pitch2 + inlet_pitch2 +
                   ___SMMUL((inlet_EFM2 + param_EFM2) << 3, r1 >> 2),
               freq2);

  int32_t LFM1 = ___SMMUL((inlet_LFM1 + param_LFM1) << 3, val3 << 2);
  int32_t LFM2 = ___SMMUL((inlet_LFM2 + param_LFM2) << 3, val3 << 2);
  int32_t ExtLFM =
      ___SMMUL(inlet_freq << 3, (inlet_ExtLFM + param_ExtLFM) << 2);
  Phase1 += freq1 + ___SMMUL(ExtLFM << 3, freq1 << 6) +
            ___SMMUL(LFM1 << 3, freq1 << 5);
  ;
  int32_t p21 =
      Phase1 +
      ((___SMMUL(inlet_phase << 3, (inlet_ExtPM + param_ExtPM) << 2)) << 4);
  SINE2TINTERP(p21, r1)

  Phase2 += freq2 + ___SMMUL(ExtLFM << 3, freq2 << 6) +
            ___SMMUL(LFM2 << 3, freq2 << 5);
  int32_t p22 =
      Phase2 +
      ((___SMMUL(inlet_phase << 3, (inlet_ExtPM + param_ExtPM) << 2)) << 4);
  SINE2TINTERP(p22, r2)

  // unify distance
  int32_t r8 = ___SMMUL(r1 >> 1, r7 << 23);
  int32_t r9 = ___SMMUL(r2 >> 1, r7 << 23);
  int32_t r3 = ___SMMUL(r8 << 3, r8 << 2);
  int32_t r4 = ___SMMUL(r9 << 3, r9 << 2);
  int32_t r5 = r3 + r4;
  float aif = r5;
  aif *= (1 << 27);
  aif = _VSQRTF(aif);
  int32_t r6 = (int)aif;
  r7 = (1 << 31) / (((1 << 28) - ((param_Power) << 1)) + r6 + (1 << 19));

  int32_t r0 = ___SMMUL(((r1 >> 4) + (r2 >> 4)) << 3, r7 << 23);
  val1 = ___SMMLA((r0 - val1) << 1, f, val1);

  val2 = ___SMMLA((val1 - val2) << 1, g, val2);

  val3 = val1 - val2;
  outlet_wave = val3;
}

Privacy

© 2024 Zrna Research