![]() |
VCV Rack API v2
|
Random number generation. More...
Classes | |
| struct | Xoroshiro128Plus |
| xoroshiro128+. More... | |
Functions | |
| void | init () |
| Xoroshiro128Plus & | local () |
| Returns the generator. | |
| template<typename T> | |
| T | get () |
| template<> | |
| uint32_t | get () |
| template<> | |
| uint16_t | get () |
| template<> | |
| uint8_t | get () |
| template<> | |
| bool | get () |
| template<> | |
| float | get () |
| template<> | |
| double | get () |
| uint64_t | u64 () |
| Returns a uniform random uint64_t from 0 to UINT64_MAX. | |
| uint32_t | u32 () |
| Returns a uniform random uint32_t from 0 to UINT32_MAX. | |
| float | uniform () |
| Returns a uniform random float in the interval [0.0, 1.0). | |
| float | normal () |
| Returns a normal random number with mean 0 and standard deviation 1. | |
| void | buffer (uint8_t *out, size_t len) |
| Fills an array with random bytes. | |
| std::vector< uint8_t > | vector (size_t len) |
| Creates a vector of random bytes. | |
Random number generation.
| void rack::random::init | ( | ) |
| Xoroshiro128Plus & rack::random::local | ( | ) |
Returns the generator.
Named "local" because the generator was thread-local in previous versions.
| T rack::random::get | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns a uniform random uint64_t from 0 to UINT64_MAX.
|
inline |
Returns a uniform random uint32_t from 0 to UINT32_MAX.
|
inline |
Returns a uniform random float in the interval [0.0, 1.0).
|
inline |
Returns a normal random number with mean 0 and standard deviation 1.
|
inline |
Fills an array with random bytes.
|
inline |
Creates a vector of random bytes.