Closed joekingTheThird3 closed 3 years ago
https://soul-lang.github.io/SOUL/docs/soul_library.html#mod_soul_random
P.S. please don't be someone who encourages the use of rand() or srand(), even in C code! It's an ancient, poorly-designed function and would have disappeared years ago if it wasn't for legacy support in the C library. There are far better alternatives in every language now.
Thanks. I am getting lost in the documentation. Didn't see it there. Random repeats after a cycle or with the same seed. I wonder if sound of a long cycle of notes is actually easier to deduce than a visual rendering of a cycle of integers. I am not very familiar with C++. I know in js
var array = new Uint32Array(1);
window.crypto.getRandomValues(array);
is more secure.
Sorry, but I don't really understand your question... Obviously any pseudo-random RNG will repeat eventually, but this one will take billions of iterations to do so.
Like the docs very clearly say, this isn't in any way intended to be a secure crypto-level RNG, it's a simple, fast one that's designed for audio purposes. If you need something secure, then you'd need to write that yourself.
Can I have it please? rand(). If we have rand then we need srand() - srand (time(NULL)); Thank you.