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


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,



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
    inum random 0, 1000
    print inum
  loop_lt icnt, 1, itimes, loop

schedule(10, 0, 10)


f0 10


Csound mailing list
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

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.

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.

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 ​