Csound Csound-dev Csound-tekno Search About

[Csnd] randi question

Date2026-09-12 00:27
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] randi question
ChatGPT doesn't know whether the following sequences of code yield the same results or not. It suggests that only a look at the source code could definitively answer the question.

kj1a    randi    kjamp, 2000, 2
kj1b    randi    kjamp, 2000, 3

and

kj1a    randi    kjamp, 2000, 2
kj1b    randi    kjamp, 2000, 2

(Csound 6.15 Windows, if that is relevant.)

Any definitive answer?

Art H.

abhunkin@uncg.edu
http://www.arthunkins.com

Date2026-09-12 02:46
FromMichael Gogins
SubjectRe: [Csnd] randi question
Not the same result. Either 2 or 3 is added to the randomly generated result. Leaving off the 2 and 3 would mean nothing is added. In the first block, kj1a and kj1b both have an offset of 2. In the second block, kj1a has an offset of 2 and kj1b has an offset of 3.


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com

On Fri, Sep 11, 2026, 19:27 Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
ChatGPT doesn't know whether the following sequences of code yield the same results or not. It suggests that only a look at the source code could definitively answer the question.

kj1a    randi    kjamp, 2000, 2
kj1b    randi    kjamp, 2000, 3

and

kj1a    randi    kjamp, 2000, 2
kj1b    randi    kjamp, 2000, 2

(Csound 6.15 Windows, if that is relevant.)

Any definitive answer?

Art H.

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