[chuck-users] non-ramdom

Perry Cook prc at CS.Princeton.EDU
Wed Oct 9 19:11:12 EDT 2013


All of those instruments contain noise.  Likely a Noise object.  Wonder if Noise itself does a seed?  I'll check.

Sent from my iPhone

On Oct 9, 2013, at 3:37 PM, chuck-users-request at lists.cs.princeton.edu wrote:

> Send chuck-users mailing list submissions to
>    chuck-users at lists.cs.princeton.edu
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>    https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> or, via email, send a message with subject or body 'help' to
>    chuck-users-request at lists.cs.princeton.edu
> 
> You can reach the person managing the list at
>    chuck-users-owner at lists.cs.princeton.edu
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of chuck-users digest..."
> 
> 
> Today's Topics:
> 
>   1. Non-random random number (David Loberg Code)
>   2. Re: Non-random random number (David Code)
>   3. Re: Non-random random number (Jeffrey Albert)
>   4. Re: Non-random random number (David Code)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 09 Oct 2013 12:59:51 -0400
> From: David Loberg Code <d.loberg.code at wmich.edu>
> To: chuck-users at lists.cs.princeton.edu
> Subject: [chuck-users] Non-random random number
> Message-ID: <6A36C46C-A7CE-465A-8A61-7203AC280266 at wmich.edu>
> Content-Type: text/plain; charset="us-ascii"
> 
> Forgive me if this was already discussed on the list before.  I am puzzled about a non-random random number.
> When the random number is calculated right after an STK instrument is declared, the result is not random.  It is the same number every time.
> However, if the same code occurs without an STK declaration before it, the result is random.
> 
> 
> while (true)
> {
> StifKarp stu => dac;
> int randy;
> Std.rand2(0,10) => randy;
> <<<"here are three random numbers",
> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
> "and NON-random Randy", randy >>>;
> 
> Std.rand2(0,10) => randy;
> <<<"here are three more random numbers",
> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
> "and random Randy", randy >>>;
> 1000::ms => now;
> }
> 
> 
> david
> 
> David Loberg Code
> School of Music
> Western Michigan University
> 1903 W Michigan Ave
> Kalamazoo, MI 49008-5434
> code at wmich.edu
> 
> 
> 
> 
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20131009/a94e4b42/attachment.htm>
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 09 Oct 2013 17:40:16 -0400
> From: David Code <d.loberg.code at wmich.edu>
> To: chuck-users at lists.cs.princeton.edu
> Subject: Re: [chuck-users] Non-random random number
> Message-ID: <F6D618FA-623D-4BA2-91FF-A725D73F185A at wmich.edu>
> Content-Type: text/plain; charset="us-ascii"
> 
> Apparently, the non-random bug does not happen after declaration of all STK instruments, just some of them:
> BlowBotl, BlowHole, Clarinet, Flute, Saxofony, StifKarp, VoicForm
> 
> And the problem occurs with both Std.rand2 and Std.rand2f
> (I haven't conducted any more tests yet to see under what other conditions it might happen.)
> 
> 
> david
> 
> 
>> Forgive me if this was already discussed on the list before.  I am puzzled about a non-random random number.
>> When the random number is calculated right after an STK instrument is declared, the result is not random.  It is the same number every time.
>> However, if the same code occurs without an STK declaration before it, the result is random.
>> 
>> 
>> while (true)
>> {
>> StifKarp stu => dac;
>> int randy;
>> Std.rand2(0,10) => randy;
>> <<<"here are three random numbers",
>> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
>> "and NON-random Randy", randy >>>;
>> 
>> Std.rand2(0,10) => randy;
>> <<<"here are three more random numbers",
>> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
>> "and random Randy", randy >>>;
>> 1000::ms => now;
>> }
>> 
>> 
>> david
>> 
>> David Loberg Code
>> School of Music
>> Western Michigan University
>> 1903 W Michigan Ave
>> Kalamazoo, MI 49008-5434
>> code at wmich.edu
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20131009/ef8278bc/attachment.html>
> 
> ------------------------------
> 
> Message: 3
> Date: Wed, 9 Oct 2013 16:48:08 -0500
> From: Jeffrey Albert <jvalbert at loyno.edu>
> To: ChucK Users Mailing List <chuck-users at lists.cs.princeton.edu>
> Subject: Re: [chuck-users] Non-random random number
> Message-ID: <CF9C3DC4-FC71-4FF9-8B85-99DACD7CFADB at loyno.edu>
> Content-Type: text/plain; charset="us-ascii"
> 
> Does it do it with Math.random too?
> 
> -Jeff
> 
> 
> --
> Jeffrey Albert, Ph.D.
> Assistant Professor of Music Industry Technology
> Loyola University New Orleans
> College of Music and Fine Arts
> 6363 St. Charles Ave.
> Campus Box 8
> New Orleans, LA 70118
> 
> Office: Communications/Music Complex 428P
> Office Phone: (504) 865-2606
> Voice & Text: (504) 315-5167
> jvalbert at loyno.edu
> http://www.loyno.edu/~jvalbert
> 
> 
> On Oct 9, 2013, at 4:40 PM, David Code <d.loberg.code at wmich.edu> wrote:
> 
>> Apparently, the non-random bug does not happen after declaration of all STK instruments, just some of them:
>> BlowBotl, BlowHole, Clarinet, Flute, Saxofony, StifKarp, VoicForm
>> 
>> And the problem occurs with both Std.rand2 and Std.rand2f
>> (I haven't conducted any more tests yet to see under what other conditions it might happen.)
>> 
>> 
>> david
>> 
>> 
>>> Forgive me if this was already discussed on the list before.  I am puzzled about a non-random random number.
>>> When the random number is calculated right after an STK instrument is declared, the result is not random.  It is the same number every time.
>>> However, if the same code occurs without an STK declaration before it, the result is random.
>>> 
>>> 
>>> while (true)
>>> {
>>> StifKarp stu => dac;
>>> int randy;
>>> Std.rand2(0,10) => randy;
>>> <<<"here are three random numbers",
>>> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
>>> "and NON-random Randy", randy >>>;
>>> 
>>> Std.rand2(0,10) => randy;
>>> <<<"here are three more random numbers",
>>> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
>>> "and random Randy", randy >>>;
>>> 1000::ms => now;
>>> }
>>> 
>>> 
>>> david
>>> 
>>> David Loberg Code
>>> School of Music
>>> Western Michigan University
>>> 1903 W Michigan Ave
>>> Kalamazoo, MI 49008-5434
>>> code at wmich.edu
>> 
>> 
>> _______________________________________________
>> chuck-users mailing list
>> chuck-users at lists.cs.princeton.edu
>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20131009/26eb6058/attachment-0001.html>
> 
> ------------------------------
> 
> Message: 4
> Date: Wed, 09 Oct 2013 18:37:13 -0400
> From: David Code <d.loberg.code at wmich.edu>
> To: chuck-users at lists.cs.princeton.edu
> Subject: Re: [chuck-users] Non-random random number
> Message-ID: <C3BC1014-D104-45CB-B12D-F14EF4B68672 at wmich.edu>
> Content-Type: text/plain; charset="us-ascii"
> 
> Upon a quick check it appears that Math.random is fine.  
> I guess I just need to retro-fit my older ChucK files.
> 
> david
> 
>> Does it do it with Math.random too?
>> 
>> -Jeff
>> 
>> 
>> --
>> Jeffrey Albert, Ph.D.
>> Assistant Professor of Music Industry Technology
>> Loyola University New Orleans
>> College of Music and Fine Arts
>> 6363 St. Charles Ave.
>> Campus Box 8
>> New Orleans, LA 70118
>> 
>> Office: Communications/Music Complex 428P
>> Office Phone: (504) 865-2606
>> Voice & Text: (504) 315-5167
>> jvalbert at loyno.edu
>> http://www.loyno.edu/~jvalbert
>> 
>> 
>> On Oct 9, 2013, at 4:40 PM, David Code <d.loberg.code at wmich.edu> wrote:
>> 
>>> Apparently, the non-random bug does not happen after declaration of all STK instruments, just some of them:
>>> BlowBotl, BlowHole, Clarinet, Flute, Saxofony, StifKarp, VoicForm
>>> 
>>> And the problem occurs with both Std.rand2 and Std.rand2f
>>> (I haven't conducted any more tests yet to see under what other conditions it might happen.)
>>> 
>>> 
>>> david
> 
> 
> On Oct 9, 2013, at 5:40 PM, David Code wrote:
> 
>> Apparently, the non-random bug does not happen after declaration of all STK instruments, just some of them:
>> BlowBotl, BlowHole, Clarinet, Flute, Saxofony, StifKarp, VoicForm
>> 
>> And the problem occurs with both Std.rand2 and Std.rand2f
>> (I haven't conducted any more tests yet to see under what other conditions it might happen.)
>> 
>> 
>> david
>> 
>> 
>>> Forgive me if this was already discussed on the list before.  I am puzzled about a non-random random number.
>>> When the random number is calculated right after an STK instrument is declared, the result is not random.  It is the same number every time.
>>> However, if the same code occurs without an STK declaration before it, the result is random.
>>> 
>>> 
>>> while (true)
>>> {
>>> StifKarp stu => dac;
>>> int randy;
>>> Std.rand2(0,10) => randy;
>>> <<<"here are three random numbers",
>>> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
>>> "and NON-random Randy", randy >>>;
>>> 
>>> Std.rand2(0,10) => randy;
>>> <<<"here are three more random numbers",
>>> Std.rand2(0,10), Std.rand2(0,10),Std.rand2(0,10),
>>> "and random Randy", randy >>>;
>>> 1000::ms => now;
>>> }
>>> 
>>> 
>>> david
>>> 
>>> David Loberg Code
>>> School of Music
>>> Western Michigan University
>>> 1903 W Michigan Ave
>>> Kalamazoo, MI 49008-5434
>>> code at wmich.edu
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20131009/d6e16a89/attachment.html>
> 
> ------------------------------
> 
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> 
> 
> End of chuck-users Digest, Vol 99, Issue 8
> ******************************************


More information about the chuck-users mailing list