scaleLIVE

Used together with the "scalebankLIVE" module. Uses it's internal array of allowed notes in the scale to only allow notes to play that are set as active. Ratio is 1:1 for octaves->no change. Notes not in the scale will just be transposed down till they meet a note that is allowed.
Author: Remco van der Most
License: BSD
Github: sss/harmony/scaleLIVE.axo

Inlets

int32 note

Outlets

int32 note

Attributes

objref scale

Declaration
int prv;
Control Rate
outlet_note = inlet_note;
int oct = inlet_note / 12;
oct -= inlet_note < 0 ? 1 : 0;
int note = inlet_note - oct * 12;
if (attr_scale.notes > 0) {
  int A = 0;
  int B = note;
  // if(!(prv==note)){
  while (A == 0) {
    B = B - B / 12 * 12;
    B += B < 0 ? 12 : 0;
    A = ((attr_scale.array[B] <= attr_scale.NT) && (attr_scale.array[B] >= 1))
            ? 1
            : 0;
    B -= 1;
    //}
  }
  outlet_note = B + oct * 12;
}

prv = note;

Privacy

© 2024 Zrna Research