ribbonKeyboard

Ribbon like keyboard Works with the scalebank modules (not the 7-note-only version) Selected scale is shown on the keyboard Black notes won't respond when clicked Possible to "swipe" over the keyboard, playing arpeggio's trg-output sends triggers while swiping, note though, that this also seems to happen even though your still o the same note..
Author: Remco van der Most
License: BSD
Github: sss/harmony/ribbonKeyboard.axo

Inlets

int32 key

int32 scale

Outlets

int32 note

bool32 trg

Parameters

bin32 b1

Attributes

objref scalebank

Displays

int32.label val

Declaration
int64_t ch;
int i;
int64_t tmp;
bool trg;
int prv;
int64_t cur;
Control Rate
int k;
if (!((inlet_key + inlet_scale) == prv)) {
  cur = 0;
  for (i = 0; i < 32; i++) {
    int m = i - i / 12 * 12;
    k = i + inlet_key;
    k = k - k / 32 * 32;
    k = k < 0 ? k + 32 : k;
    trg = (!(attr_scalebank.note[m + inlet_scale * 12] == m));
    cur += trg << k;
  }
  PExParameterChange(&parent->PExch[PARAM_INDEX_attr_legal_name_b1], cur,
                     0xFFFD);
}

outlet_trg = 0;
if (!(param_b1 == cur)) {
  outlet_trg = 1;
  tmp = param_b1 - cur;
  if (tmp > 0) {
    ch = 0;
    for (i = 0; i < 32; i++) {
      ch += ((tmp >> i) & 1) * i;
    }
  }
}
outlet_note = ch;

disp_val = tmp;

PExParameterChange(&parent->PExch[PARAM_INDEX_attr_legal_name_b1], cur, 0xFFFD);

prv = inlet_key + inlet_scale;

Privacy

© 2024 Zrna Research