Csound Csound-dev Csound-tekno Search About

[Csnd] Using "Seed" for Reproducibility is Yielding Unexpected Results

Date2021-01-06 20:54
Fromjdm771
Subject[Csnd] Using "Seed" for Reproducibility is Yielding Unexpected Results
Hi,

I have been trying to use "seed" for reproducibility. Examples 1, 2, and 3 below all provide different results from each other. That is what I would expect.

However, Examples 4 and 5 yield the same results as Example 2. That is not what I expect. I would expect Examples 4 and 5 to also each be different.

I would be grateful is someone would assist me on understanding this.

Thank you,

John
 



-odac



sr = 48000
ksmps = 1
nchnls = 1
0dbfs = 1

seed 3348880584 ; <-- Replace this with the examples below. 
; Example 1: 854106567
; Example 2: 4080063411
; Example 3: 1308476648
; Example 4: 3591223209 <-- Same as Example 2!
; Example 5: 3348880584 <-- Same as Example 2!

instr 10
	itimes = 20
	icnt = 0
	loop:
		inum random 0, 1000
		print inum
	loop_lt icnt, 1, itimes, loop
endin

schedule(10, 0, 10)




f0 10




Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2021-01-06 21:13
Frommskala@ANSUZ.SOOKE.BC.CA
SubjectRe: [Csnd] Using "Seed" for Reproducibility is Yielding Unexpected Results
On Wed, 6 Jan 2021, jdm771 wrote:
> I have been trying to use "seed" for reproducibility. Examples 1, 2, and
> 3 below all provide different results from each other. That is what I
> would expect.
>
> However, Examples 4 and 5 yield the same results as Example 2. That is
> not what I expect. I would expect Examples 4 and 5 to also each be
> different.

Your examples 2, 3, and 4 are exactly those of your seed values that
exceed the range of a 32-bit signed integer.  The documentation *says* the
seed can be any number between 0 and 2^32 (suggesting it's using an
unsigned integer and should be able to handle these values), but if there
is something that clips the seed value or throws out values outside the
signed-int range, that could explain the effect you're seeing.

-- 
Matthew Skala
mskala@ansuz.sooke.bc.ca                 People before tribes.
https://ansuz.sooke.bc.ca/

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2021-01-06 21:18
Frommskala@ANSUZ.SOOKE.BC.CA
SubjectRe: [Csnd] Using "Seed" for Reproducibility is Yielding Unexpected Results
On Wed, 6 Jan 2021, mskala@ansuz.sooke.bc.ca wrote:
> Your examples 2, 3, and 4 are exactly those of your seed values that

Sorry, I mean examples 2, 4, and 5, of course.  The point being that seed
values greater than 2147483647 will be a problem if it's using signed
32-bit integers.

-- 
Matthew Skala
mskala@ansuz.sooke.bc.ca                 People before tribes.
https://ansuz.sooke.bc.ca/

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2021-01-07 15:18
FromJohn ff
SubjectRe: [Csnd] Using "Seed" for Reproducibility is Yielding Unexpected Results
Perhaps one should note that values in csound are floating not integers.  If needed for an integer use it is fixed so accuracy is less certain.

⁣Sent from TypeApp ​

On Jan 6, 2021, 20:55, at 20:55, jdm771  wrote:
>Hi,
>
>I have been trying to use "seed" for reproducibility. Examples 1, 2,
>and 3 below all provide different results from each other. That is what
>I would expect.
>
>However, Examples 4 and 5 yield the same results as Example 2. That is
>not what I expect. I would expect Examples 4 and 5 to also each be
>different.
>
>I would be grateful is someone would assist me on understanding this.
>
>Thank you,
>
>John
> 
>
>
>
>-odac
>
>
>
>sr = 48000
>ksmps = 1
>nchnls = 1
>0dbfs = 1
>
>seed 3348880584 ; <-- Replace this with the examples below. 
>; Example 1: 854106567
>; Example 2: 4080063411
>; Example 3: 1308476648
>; Example 4: 3591223209 <-- Same as Example 2!
>; Example 5: 3348880584 <-- Same as Example 2!
>
>instr 10
>	itimes = 20
>	icnt = 0
>	loop:
>		inum random 0, 1000
>		print inum
>	loop_lt icnt, 1, itimes, loop
>endin
>
>schedule(10, 0, 10)
>
>
>
>
>f0 10
>
>
>
>
>Csound mailing list
>Csound@listserv.heanet.ie
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here