beatmachine

Bytebeat style "noise" generator, a good description of bytebeat can be found @ http://canonical.org/~kragen/bytebeat/ Provides a number of preset "beats", selecting 0 will use the beat field on the object (make sure this is populated). Beat equations can be found in beatmachine/equations.c Check the help patch!
Author: Stephen Hughes
License: GPL
Github: hc/osc/beatmachine.axo

Inlets

int32 beat

int32 divider

frac32.bipolar rate

frac32 startpos

frac32 x

frac32 y

frac32 z

bool32.rising rst

Outlets

frac32buffer out

Attributes

table beat

Declaration
uint32_t t;
uint64_t index;
int32_t inc;
uint32_t reset;
uint32_t divider;
uint64_t startpos;
uint32_t compute_output;
uint32_t beat_table;
Init
inc = 0;
t = 0;
index = 0;
x = 0;
y = 0;
z = 0;

beat_table = 0;
Audio Rate
x = inlet_x >> 19;
y = inlet_y >> 19;
z = inlet_z >> 19;

inc = inlet_rate >> 20;

if (inlet_rst && reset) {
  index = inlet_startpos << 4;
  reset = 0;
} else {
  if (!inlet_rst)
    reset = 1;
  inc = inc << 1;
  index += inc;
  beat_table = attr_beat;
  t = ((inlet_startpos << 4) + index) >> inlet_divider;
  if (!beat_table) {
    compute_output = (((Equation(inlet_beat, t, x, y, z, 1)) << 23) - (1 << 26))
                     << 1;
  } else {
    compute_output =
        (((Equation(inlet_beat, t, x, y, z, attr_beat)) << 23) - (1 << 26))
        << 1;
  }
  outlet_out = ___SMMUL(0x10000000, compute_output);
}

Privacy

© 2024 Zrna Research