137temperaments

Temperament module with 137 different temperaments taken from historic composers. For this module to work, first create a project containing the "scaleGenerator" module and press play (you only have to do this once for each SDcard!). This automatically creates a file on your SDcard, which will be called upon by the "scaleBank2" module. The scalebank2 module will contain data for the 46scales module as well as the 137 temperaments module, so these can be combined to easily choose between different keys, scales and temperaments on the fly. This module also adds a "stretch" function, that stretches each octave up by a couple of cents, creating lovely unison voices. (till further notice) I'll let this function be up to the user to decide what the stretch will be. The stretch-knob's value is divided by 1024, giving it an accuracy of tenth of cents per octave and will be needed to be tuned by ear (best done in polyphonic setting with harmonically rich waveforms)
Author: Remco van der Most
License: BSD
Github: sss/harmony/137temperaments.axo

Inlets

frac32 in

frac32 stretch

int32 temper

Outlets

frac32 out

Attributes

objref scale

Declaration
int i;
Control Rate
int mn = (inlet_in + (1 << 20) >> 21) + 9;
int32_t stretch = mn / 12;

stretch = stretch * (inlet_stretch / 1000);
int oct = mn / 12 * 12;
oct = inlet_in < 0 ? oct - 12 : oct;
mn = mn - oct;
mn = mn % 12;
mn += mn < 0 ? 12 : 0;
int tmpr = inlet_temper;
tmpr = tmpr - tmpr / 137 * 137;
tmpr += tmpr < 0 ? 137 : 0;
tmpr *= 12;
outlet_out = attr_scale.TMPR[mn + tmpr] + inlet_in + stretch; //+(mn+oct<<21);//

Privacy

© 2024 Zrna Research