%prob d

probabiltiy bang
Author: Philoop
License: BSD
Github: phi/prob/%prob d.axo

Inlets

bool32 trig

Outlets

bool32 output

Parameters

frac32.s.map prob

Displays

bool32 on

Declaration
int32_t val;
int ntrig;
int rnd;
Init
val = (int32_t)(GenerateRandomNumber()) >> 4;
ntrig = 0;
rnd = 0;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  val = (int32_t)(GenerateRandomNumber()) >> 4;
  ntrig = 1;
} else if (!(inlet_trig > 0))
  ntrig = 0;
rnd = val;
rnd = param_prob > val;
outlet_o = (rnd) && (inlet_trig);
disp_on = outlet_o;

Privacy

© 2024 Zrna Research