wf_12Harm

For use with O2_12Steps(Sync)
Author: Thierry Smashed Transistors
License: LGPL
Github: tiar/osc/wf12/wf_12Harm.axo

Inlets

None

Outlets

frac32buffer.bipolar waveform

Parameters

frac32.s.mapvsl h1

frac32.s.mapvsl h2

frac32.s.mapvsl h3

frac32.s.mapvsl h4

frac32.s.mapvsl h5

frac32.s.mapvsl h6

Declaration
const int32_t tiar_h4w12[12 * 6] = {
    +134217728, +116235962, +67108864,  +0,         -67108864,
    -116235962, -134217728, -116235962, -67108864,  +0,
    +67108864,  +116235962, +124617325, +105479145, -19138181,
    -124617325, -105479145, +19138181,  +124617325, +105479145,
    -19138181,  -124617325, -105479145, +19138181,  -68758842,
    +115267603, +68758842,  -115267603, -68758842,  +115267603,
    +68758842,  -115267603, -68758842,  +115267603, +68758842,
    -115267603, +115981577, -116488688, +507111,    +115981577,
    -116488688, +507111,    +115981577, -116488688, +507111,
    +115981577, -116488688, +507111,    -65763890,  -1547888,
    +68444912,  -117002176, +134208802, -115454288, +65763890,
    +1547888,   -68444912,  +117002176, -134208802, +115454288,
    -105479145, +105479145, -105479145, +105479145, -105479145,
    +105479145, -105479145, +105479145, -105479145, +105479145,
    -105479145, +105479145}; // phases chosen for reduced crest factor

int32_t *h1, h2, h3, h4, h5, h6;
Init
h1 = tiar_h4w12 + 0 * 12;
h2 = tiar_h4w12 + 1 * 12;
h3 = tiar_h4w12 + 2 * 12;
h4 = tiar_h4w12 + 3 * 12;
h5 = tiar_h4w12 + 4 * 12;
h6 = tiar_h4w12 + 5 * 12;
Control Rate
int j;
/*
for(j = 0;j<12;j++){
  outlet_waveform[j] =
  __SMMLA(param_h6, h6[j],
    __SMMLA(param_h5, h5[j],
      __SMMLA(param_h4, h4[j],
        __SMMLA(param_h3, h3[j],
          __SMMLA(param_h2, h2[j],
            ___SMMUL(param_h1, h1[j]))))))<<5;
}
*/
// optim nb reg ?...
// 6vars
for (j = 0; j < 12; j++) {
  outlet_waveform[j] = __SMMLA(param_h2, h2[j], ___SMMUL(param_h1, h1[j]));
}
for (j = 0; j < 12; j++) {
  outlet_waveform[j] =
      __SMMLA(param_h4, h4[j], __SMMLA(param_h3, h3[j], outlet_waveform[j]));
}
for (j = 0; j < 12; j++) {
  outlet_waveform[j] =
      __SMMLA(param_h6, h6[j], __SMMLA(param_h5, h5[j], outlet_waveform[j]))
      << 5;
}

Privacy

© 2024 Zrna Research