pyramid

This object makes a list, consisting of sequences, which length are based on the amount of steps in the sequence. Example: 1: 1 2:1,2 3:1,2,3 4:1,2,3,4 5:1,2,3,4,5 etc... Each number is output individually and evenutally it will a pyramid like pattern, like you see above. Can be used for many things.
Author: Jaffasplaffa
License: BSD
Github: jaffa/math/pyramid.axo

Inlets

None

Outlets

int32 out

int32 s

Parameters

int32 Sel

Declaration
int s, l, pSel;
Control Rate
/*
 * http://community.axoloti.com/t/math-help-needed/5028/6
 */

if (param_Sel != pSel) {
  pSel = param_Sel;
  s = 0;
  l = 1;
  for (int i = 1; i <= param_Sel; i++) {
    if (s < l) {
      s++;
    } else {
      l++;
      s = 1;
    }
  }
}
outlet_l = l;
outlet_s = s;

Privacy

© 2024 Zrna Research