[yoshimi] Re: More Random thoughts

  • From: "Jonathan E. Brickman" <jeb@xxxxxxxxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Wed, 28 Nov 2018 17:55:33 -0600

That is marvellous!!!

J.E.B.

On 11/28/18 5:42 PM, Will Godfrey wrote:

For some time now I've been unhappy with the way we handle random numbers. The
whole thing was a dogs breakfast of adjustments and patches - well rather less
so now :)

By using the Linux random_r() function, we lost portability and the patch for
BSD created a potential problem for multiple instances, so I started a search
for one that was truly portable and able to be built into Yoshimi. It doesn't
seem that anyone else tried to do this, as I quite quickly found the Bob Jenkins
"A Small Noncryptographic PRNG" which he apparently publicised in 2007.

If you want to know more, and how well respected this is look here:
http://www.pcg-random.org/posts/bob-jenkins-small-prng-passes-practrand.html

So apart from portability, what do we get?

Well for a start, even unoptimised it's faster than the Linux built-in one.

It's really rather small.

You can pull 128 *TERABYTES* of numbers from it before it repeats. Even in my
test routine (with nothing else happening) that would take over an hour, so I
felt justified in significantly reducing the number of times it was re-seeded.
This in itself seems to have made a very tiny reduction in note-on time.

It's in the latest build :)

--

Jonathan E. Brickman jeb@xxxxxxxxxxxxxxxx <mailto:jeb@xxxxxxxxxxxxxxxx>    (785)233-9977
Hear us at ponderworthy.com <http://ponderworthy.com/> -- CDs and MP3 available! <http://ponderworthy.com/ad-astra/ad-astra.html>
Music of compassion; fire, and life!!!

Other related posts: