<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Upon a quick check it appears that Math.random is fine.  </div><div>I guess I just need to retro-fit my older ChucK files.</div><div><br></div><div>david</div><div><br></div><div><blockquote type="cite"><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">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
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">jvalbert at loyno.edu</a>
<a href="http://www.loyno.edu/~jvalbert">http://www.loyno.edu/~jvalbert</a>


On Oct 9, 2013, at 4:40 PM, David Code <<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">d.loberg.code at wmich.edu</a>> wrote:

><i> Apparently, the non-random bug does not happen after declaration of all STK instruments, just some of them:
</i>><i> BlowBotl, BlowHole, Clarinet, Flute, Saxofony, StifKarp, VoicForm
</i>><i> 
</i>><i> And the problem occurs with both Std.rand2 and Std.rand2f
</i>><i> (I haven't conducted any more tests yet to see under what other conditions it might happen.)
</i>><i> 
</i>><i> 
</i>><i> david
</i>><i> </i></pre></blockquote><div><br></div></div><br><div><div>On Oct 9, 2013, at 5:40 PM, David Code wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Apparently, the non-random bug does not happen after declaration of all STK instruments, just some of them:</div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 13px; ">BlowBotl, BlowHole, Clarinet, Flute, Saxofony, StifKarp, VoicForm</span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 13px; ">And the problem occurs with both Std.rand2 and Std.rand2f</span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 13px; ">(I haven't conducted any more tests yet to see under what other conditions it might happen.)</span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 13px; ">david</span></div><div><br></div><div><br></div><div><blockquote type="cite"><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">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
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">code at wmich.edu</a>
</pre></blockquote></div><div><br></div></div></blockquote></div><br></body></html>