46scales7

46-scale scaling module, but with a 1-key per note response like the factory harmony module All the generated notes will be scaled to the selected scale. 46! scales are included and each scale can be set to a key. See the Local Date for which scales are included. Scales are somewhat ordered on alphabetic orde (except the main major/minor scale variations which are the first ones). You can always set them to another order if you want, but keep the total at 46 as this selecting value gets wrapped above 46 in the code.
Author: Remco van der Most
License: BSD
Github: sss/harmony/46scales7.axo

Inlets

int32 pitch

int32 key

int32 scale

Outlets

int32 note

int32 octave

int32 semi

Attributes

objref scale

Control Rate
int scale = inlet_scale;
scale = scale - scale / 46 * 46;
scale = scale < 0 ? scale + 46 : scale;
scale = scale * 7;

int key = (inlet_key)*7 - 4;
key = key - (key / 12) * 12;
key = key < 0 ? key + 12 : key;
int32_t pitch = inlet_pitch + 64;
int32_t octave = pitch / 7;
int semitone = pitch - octave * 7;
outlet_octave = octave;
outlet_semi = semitone;
outlet_note = (attr_scale.note[semitone + scale] + octave * 12) - 112 + key;

Privacy

© 2024 Zrna Research