64stp_4ch_Prst_Seq

Trigger sequencer with up to 64 steps. -"table": enter the table-name here. (use table save/load to actually save the presets to your SDRAM card! IF YOU DON'T, YOU WILL LOOSE YOUR PROGRAMMED RHYTHM!!!) -"channel": 4 (drum) trigger channels to program -"preset": depending on table size, you can save lots of rhythm presets. -"barlength": sets amount of steps per bar (normal=16) -selectbar: select which bar you want to edit (1 to 4) -"bars": sets max amount of bars (4 max) inputs&outputs: -connect a trigger/LFO source to "trig" input and set the desired rate on that module. -"r" input resets the counter -"v" input is the value to be entered on a position in the sequence. -"add" input asks for a trigger to save the v-input value to the selected position in the sequence. -"select" input selects position in the sequence where the data should be recorded. For a bit more easy control with entering gates, use the controller object (same map)! -"maxcount" outputs the maximum count -o1 to 04 output short triggers (not one-step-long gates!)
Author: Remco van der Most
License: BSD
Github: sss/seq/64stp_4ch_Prst_Seq.axo

Inlets

frac32 v

int32 select

bool32.rising trig

bool32.rising add

bool32 r

Outlets

bool32.pulse o1

bool32.pulse o2

bool32.pulse o3

bool32.pulse o4

int32 maxcount

int32 count

Parameters

int32.hradio channel

int32.hradio selectbar

int32 preset

int32 barlength

int32 bars

Attributes

objref table

Displays

bool32 01

bool32 02

bool32 03

bool32 04

bool32 05

bool32 06

bool32 07

bool32 08

bool32 09

bool32 10

bool32 11

bool32 12

bool32 13

bool32 14

bool32 15

bool32 16

int32.bar16 position

Declaration
int ntrig;
int32_t pcount;
int strig;
int rtrig;
int count;
int32_t maxcount;
Init
ntrig = 0;
count = 0;
strig = 0;
rtrig = 0;
Control Rate
maxcount = param_barlength * param_bars;
if ((inlet_trig > 0) && !strig) {
  count += 1;
  if (count >= maxcount) {
    count = 0;
  }
  strig = 1;
} else if (!(inlet_trig > 0))
  strig = 0;
if ((inlet_r > 0) && !rtrig) {
  count = 0;
  rtrig = 1;
} else if (!(inlet_r > 0))
  rtrig = 0;

int32_t addbar = (count >> 4) << 4;

int TRIG = count != pcount ? 1 : 0;
int32_t bor = param_selectbar * 16;
int32_t select = inlet_select + param_channel * 64 + param_preset * 256 + bor;

if ((inlet_add > 0) && !ntrig) {
  ntrig = 1;
  if (select < attr_table.LENGTH)
    attr_table.array[select] = __SSAT(inlet_v, 28) >> attr_table.GAIN;
}
if (!(inlet_add > 0))
  ntrig = 0;

int32_t readA = count + param_preset * 256;
outlet_o1 = (attr_table.array[__USAT(readA, attr_table.LENGTHPOW)]
             << attr_table.GAIN) &&
            TRIG;
outlet_o2 = (attr_table.array[__USAT(readA + 64, attr_table.LENGTHPOW)]
             << attr_table.GAIN) &&
            TRIG;
outlet_o3 = (attr_table.array[__USAT(readA + 128, attr_table.LENGTHPOW)]
             << attr_table.GAIN) &&
            TRIG;
outlet_o4 = (attr_table.array[__USAT(readA + 192, attr_table.LENGTHPOW)]
             << attr_table.GAIN) &&
            TRIG;

disp_position = count - addbar;
int32_t readB = param_channel * 64 + param_preset * 256 + bor + addbar;
disp_01 = attr_table.array[__USAT(readB, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_02 = attr_table.array[__USAT(readB + 1, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_03 = attr_table.array[__USAT(readB + 2, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_04 = attr_table.array[__USAT(readB + 3, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_05 = attr_table.array[__USAT(readB + 4, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_06 = attr_table.array[__USAT(readB + 5, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_07 = attr_table.array[__USAT(readB + 6, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_08 = attr_table.array[__USAT(readB + 7, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_09 = attr_table.array[__USAT(readB + 8, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_10 = attr_table.array[__USAT(readB + 9, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_11 = attr_table.array[__USAT(readB + 10, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_12 = attr_table.array[__USAT(readB + 11, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_13 = attr_table.array[__USAT(readB + 12, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_14 = attr_table.array[__USAT(readB + 13, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_15 = attr_table.array[__USAT(readB + 14, attr_table.LENGTHPOW)]
          << attr_table.GAIN;
disp_16 = attr_table.array[__USAT(readB + 15, attr_table.LENGTHPOW)]
          << attr_table.GAIN;

pcount = count;
outlet_count = count;

Privacy

© 2024 Zrna Research