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.

32 lines
672B

  1. #pragma once
  2. #include <stdint.h>
  3. #include <string>
  4. #include "math.hpp"
  5. namespace rack {
  6. ////////////////////
  7. // RNG
  8. ////////////////////
  9. uint32_t randomu32();
  10. /** Returns a uniform random float in the interval [0.0, 1.0) */
  11. float randomf();
  12. /** Returns a normal random number with mean 0 and std dev 1 */
  13. float randomNormal();
  14. ////////////////////
  15. // Helper functions
  16. ////////////////////
  17. /** Converts a printf format string and optional arguments into a std::string */
  18. std::string stringf(const char *format, ...);
  19. /** Truncates and adds "..." to a string, not exceeding `len` characters */
  20. std::string ellipsize(std::string s, size_t len);
  21. } // namespace rack