%rand f

probabiltiy random f
Author: Philoop
License: GPL
Github: phi/prob/%rand f.axo

Inlets

bool32 trig

Outlets

frac32 o

Parameters

frac32.s.map prob

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

if (((param_prob > val) && (inlet_trig) > 0) && !rtrig) {
  val1 = (int32_t)(GenerateRandomNumber()) >> 4;
  rtrig = 1;
} else if (!((param_prob > val) && (inlet_trig) > 0))
  rtrig = 0;
outlet_o = val1;

Privacy

© 2024 Zrna Research