You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
461B

  1. #pragma once
  2. #include "common.hpp"
  3. #include <cstdint>
  4. namespace rack {
  5. namespace random {
  6. /** Seeds the RNG with the current time */
  7. void init();
  8. /** Returns a uniform random uint32_t from 0 to UINT32_MAX */
  9. uint32_t u32();
  10. uint64_t u64();
  11. /** Returns a uniform random float in the interval [0.0, 1.0) */
  12. float uniform();
  13. /** Returns a normal random number with mean 0 and standard deviation 1 */
  14. float normal();
  15. } // namespace random
  16. } // namespace rack