ratios235

Author: Remco van der Most
License: BSD
Github: sss/math/ratios235.axo

Inlets

frac32 i1

frac32 rate

Outlets

frac32 o1

Parameters

frac32.s.map rate

int32 total

Declaration
float32_t A[10];
Init
A[0] = 1;
A[1] = (float32_t)6 / 5;
A[2] = (float32_t)5 / 4;
A[3] = (float32_t)4 / 3;
A[4] = (float32_t)7 / 5;
A[5] = (float32_t)3 / 2;
A[6] = (float32_t)8 / 5;
A[7] = (float32_t)5 / 3;
A[8] = (float32_t)7 / 4;
A[9] = (float32_t)9 / 5;
Control Rate
int32_t select = ___SMMUL(param_rate + inlet_rate << 2, param_total - 1 << 3);
int32_t octave = (select / 10) - (select >= 0 ? 0 : 1);
select = select - octave * 10;
if (octave >= 0) {
  outlet_o1 = inlet_i1 * A[select] * (1 << octave);
} else {
  outlet_o1 = inlet_i1 * A[select] / (1 << -octave);
}

Privacy

© 2024 Zrna Research