Csound Csound-dev Csound-tekno Search About

[Csnd] Question re: FLOSS ex. 01D13

Date2022-08-19 22:59
FromScott Daughtrey
Subject[Csnd] Question re: FLOSS ex. 01D13
simple_algorithmic_note_generator.csd

I get that the Notes table is using GEN17. Line 24 reads:
iNotetablernd(1),giNotes,1  ;read a random value from the function table

However, it appears that the first instance of i2 in the score always starts on the same note, the second instamce on another note etc. but alwaus in the same order. If I comment out the first instance of i2 the second line of the score now starts on the same note as the first line previously did, just at a different time.

So the notes don't really appear to occur randomly but in a specific pattern. Is this because GEN17 is described as a step function?

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

Date2022-08-19 23:43
FromDave Seidel
SubjectRe: [Csnd] Question re: FLOSS ex. 01D13
Try adding "seed 0", which seeds the random number generator based on the system clock, and should give a different sequence every time. Most random number generators on a computer are really "pseudo-random", meaning that you will always get the same results given identical starting conditions. 

On Fri, Aug 19, 2022, 6:00 PM Scott Daughtrey <stunes6556@gmail.com> wrote:
simple_algorithmic_note_generator.csd

I get that the Notes table is using GEN17. Line 24 reads:
iNotetablernd(1),giNotes,1  ;read a random value from the function table

However, it appears that the first instance of i2 in the score always starts on the same note, the second instamce on another note etc. but alwaus in the same order. If I comment out the first instance of i2 the second line of the score now starts on the same note as the first line previously did, just at a different time.

So the notes don't really appear to occur randomly but in a specific pattern. Is this because GEN17 is described as a step function?

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