46Scales2

46-scale scaling 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/46Scales2.axo

Inlets

int32 pitch

int32 scale

int32 key

Outlets

frac32 note

Attributes

objref scale

Control Rate
int key = inlet_key;
key = key - (key / 12) * 12;
key = key < 0 ? key + 12 : key;
int Scale = inlet_scale;
Scale = Scale - (Scale / 46) * 46;
Scale = Scale < 0 ? Scale + 46 : Scale;
int pitch = inlet_pitch + 4 - (key - 4);
int octave = pitch / 12 - (pitch < 0 ? 1 : 0);
int semitone = pitch - octave * 12;
outlet_note = (attr_scale.note[semitone + Scale * 12] + octave * 12 + (key - 4))
              << 21;

Privacy

© 2024 Zrna Research