46Scales

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/46Scales.axo

Inlets

int32 pitch

int32 scale

int32 key

Outlets

frac32 note

int32 key

Attributes

objref scale

Control Rate
int key = inlet_key - 4;
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 octave = inlet_pitch / 12 - (inlet_pitch < 0 ? 1 : 0);
int semitone = inlet_pitch - octave * 12;
outlet_note = (attr_scale.note[semitone + Scale * 12] + octave * 12 + key)
              << 21;
outlet_key = key;

Privacy

© 2024 Zrna Research