ABchance

uniform distributed (white) noise, triggered generation. Range -64..64
Author: Johannes Taelman
License: BSD
Github: sss/logic/ABchance.axo

Inlets

frac32 chance

bool32.rising trigger

Outlets

bool32 A

bool32 B

Parameters

frac32.u.map Bchance

Declaration
int32_t val;
int ntrig;
Init
val = (int32_t)(GenerateRandomNumber()) >> 4;
ntrig = 0;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  val =
      ((uint32_t)(GenerateRandomNumber()) >> 5) > (param_Bchance + inlet_chance)
          ? 1
          : 0;
  ntrig = 1;
} else if (!(inlet_trig > 0))
  ntrig = 0;
outlet_A = val > 0 ? inlet_trig : 0;
outlet_B = val == 0 ? inlet_trig : 0;

Privacy

© 2024 Zrna Research