[LAD] random curiosity

Arnold Krille arnold at arnoldarts.de
Tue Jan 26 08:12:21 UTC 2010


On Tuesday 26 January 2010 00:01:50 Gabriel M. Beddingfield wrote:
> On Tue, 26 Jan 2010, cal wrote:
> >> That is to say, if you need a reproduceable string of "random" numbers
> >> on each thread (e.g. for unit testing), then random_r() is your man.
> >> Otherwise, it sounds like more trouble than it's worth.
> >
> > As I understand it, zyn wants a reproducible sequence for mainstream,
> > plus a reproducible per note sequence seeded according to the current
> > point in the mainstream sequence. Interrupting and resuming the
> > mainstream sequence was the issue I was looking to simplify. If you step
> > over srandom_r(), it's really not any great trouble.
> 
> Kind of like where the random number generator is part of
> the envelope, huh?  That makes sense... in which case
> random_r() would be a good use for that.

I don't (yet) get the reason for doing this. If the global seed is initiated 
with time() it is the same as if each notes seed is initiated with time(), the 
numbers are still random beginning from that seed. The only problems I can see 
is when the random numbers are correlated resulting with per-note correlation 
of for example always the a of the adsr being to short. A problem that is 
easily solved when multiple notes get their numbers from the same seed 
effectively randomizing the access to that seed and thus overcoming the 
correlation...

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20100126/7e929b7f/attachment.pgp>


More information about the Linux-audio-dev mailing list