VCV Rack API  v1
rack::random Namespace Reference

Random number generator. More...

Functions

void init ()
 Initializes the thread-local RNG state. More...
 
uint32_t u32 ()
 Returns a uniform random uint32_t from 0 to UINT32_MAX. More...
 
uint64_t u64 ()
 Returns a uniform random uint64_t from 0 to UINT64_MAX. More...
 
float uniform ()
 Returns a uniform random float in the interval [0.0, 1.0) More...
 
float normal ()
 Returns a normal random number with mean 0 and standard deviation 1. More...
 

Detailed Description

Random number generator.

Function Documentation

◆ init()

void rack::random::init ( )

Initializes the thread-local RNG state.

Must call per-thread, otherwise the RNG will always return 0.

◆ u32()

uint32_t rack::random::u32 ( )

Returns a uniform random uint32_t from 0 to UINT32_MAX.

◆ u64()

uint64_t rack::random::u64 ( )

Returns a uniform random uint64_t from 0 to UINT64_MAX.

◆ uniform()

float rack::random::uniform ( )

Returns a uniform random float in the interval [0.0, 1.0)

◆ normal()

float rack::random::normal ( )

Returns a normal random number with mean 0 and standard deviation 1.