<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks for looking into it so quickly. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
all the best,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Peiman</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><br></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="comic sans ms, sans-serif"><b><a href="http://www.peimankhosravi.co.uk" target="_blank">www.peimankhosravi.co.uk</a> || <a href="http://peimankhosravi.co.uk/miscposts.rss" target="_blank">RSS Feed</a> || <a href="http://spectralkimia.wordpress.com/" target="_blank">Concert News</a></b></font></div>
</div></div>
<br><br><div class="gmail_quote">On 22 November 2013 16:11, Miller Puckette <span dir="ltr">&lt;<a href="mailto:msp@ucsd.edu" target="_blank">msp@ucsd.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Aha and bngo!  In effect - array random is only looking at the lower 1/2<br>
of the distribution.  I made a stupid C data type fumble in the code.<br>
<br>
I recently tripped over a bug, too, in &quot;text set&quot; - will attempt to fix them<br>
both and issue an updated pd-0.45 in the next day or 2.<br>
<br>
Thanks for flagging this!<br>
<span class="HOEnZb"><font color="#888888"><br>
Miller<br>
</font></span><div class="im HOEnZb"><br>
On Fri, Nov 22, 2013 at 03:56:54PM +0000, peiman khosravi wrote:<br>
&gt; Thanks. In this case I think something isn&#39;t right with [array random].<br>
&gt; Using the same array, I get very different patterns with the two methods<br>
&gt; (see attached patch). The difference is obvious with a gaussian<br>
&gt; distribution, which looks skewed when generated with [array random].<br>
&gt;<br>
&gt; Best,<br>
&gt; Peiman<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div><div class="HOEnZb"><div class="h5">&gt; *<a href="http://www.peimankhosravi.co.uk" target="_blank">www.peimankhosravi.co.uk</a> &lt;<a href="http://www.peimankhosravi.co.uk" target="_blank">http://www.peimankhosravi.co.uk</a>&gt; || RSS Feed<br>

&gt; &lt;<a href="http://peimankhosravi.co.uk/miscposts.rss" target="_blank">http://peimankhosravi.co.uk/miscposts.rss</a>&gt; || Concert News<br>
&gt; &lt;<a href="http://spectralkimia.wordpress.com/" target="_blank">http://spectralkimia.wordpress.com/</a>&gt;*<br>
&gt;<br>
&gt;<br>
&gt; On 22 November 2013 15:48, Miller Puckette &lt;<a href="mailto:msp@ucsd.edu">msp@ucsd.edu</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; There could be something wrong.  But array_random_bang() (in x_array.c)<br>
&gt; &gt; cooks up a pseudorandom number from 0 to 1 (I believe) and then calls<br>
&gt; &gt; array_quantile_float() with it.  That&#39;s exactly what connecting random()<br>
&gt; &gt; to array_quantile in a patch should be doing.<br>
&gt; &gt;<br>
&gt; &gt; cheers<br>
&gt; &gt; Miller<br>
&gt; &gt;<br>
&gt; &gt; On Fri, Nov 22, 2013 at 09:38:59AM +0000, peiman khosravi wrote:<br>
&gt; &gt; &gt; Thank you very much. That does the trick.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Though, [array random] doesn&#39;t seem to be working as I expected. Am I<br>
&gt; &gt; right<br>
&gt; &gt; &gt; to think that it should produce the same result as [array quantile] fed<br>
&gt; &gt; &gt; with uniformly distributed random values? If so I&#39;m getting very<br>
&gt; &gt; different<br>
&gt; &gt; &gt; results here.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks<br>
&gt; &gt; &gt; Peiman<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; *<a href="http://www.peimankhosravi.co.uk" target="_blank">www.peimankhosravi.co.uk</a> &lt;<a href="http://www.peimankhosravi.co.uk" target="_blank">http://www.peimankhosravi.co.uk</a>&gt; || RSS Feed<br>

&gt; &gt; &gt; &lt;<a href="http://peimankhosravi.co.uk/miscposts.rss" target="_blank">http://peimankhosravi.co.uk/miscposts.rss</a>&gt; || Concert News<br>
&gt; &gt; &gt; &lt;<a href="http://spectralkimia.wordpress.com/" target="_blank">http://spectralkimia.wordpress.com/</a>&gt;*<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On 22 November 2013 04:16, Miller Puckette &lt;<a href="mailto:msp@ucsd.edu">msp@ucsd.edu</a>&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I think the patch is occasionally (once every 512 times on average)<br>
&gt; &gt; sending<br>
&gt; &gt; &gt; &gt; zero to &quot;array quantile&quot; which then outputs the index of the first<br>
&gt; &gt; nonzero<br>
&gt; &gt; &gt; &gt; number in the table -- in this case a point with probability about<br>
&gt; &gt; 1e-45.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Maybe try random 1e8 (or so) and divide by 1e8 to get a more<br>
&gt; &gt; continuous,<br>
&gt; &gt; &gt; &gt; less grainy random sample out of the array.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; cheers<br>
&gt; &gt; &gt; &gt; Miller<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Fri, Nov 22, 2013 at 01:51:19AM +0000, peiman khosravi wrote:<br>
&gt; &gt; &gt; &gt; &gt; Hello,<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Has anyone got any experience with [array quantile]?<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; I&#39;m getting some strange results and I&#39;ve done everything I can<br>
&gt; &gt; think of.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; I&#39;ve attached a patch that should clarify the problem. Basically,<br>
&gt; &gt; &gt; &gt; &gt; sometimes, not always, [array quantile] returns some weird numbers<br>
&gt; &gt; that I<br>
&gt; &gt; &gt; &gt; &gt; can&#39;t explain.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; And a related issue: array random doesn&#39;t seem to be doing what it<br>
&gt; &gt; should<br>
&gt; &gt; &gt; &gt; &gt; be doing. It returns very different values, compared with quantile<br>
&gt; &gt; fed<br>
&gt; &gt; &gt; &gt; with<br>
&gt; &gt; &gt; &gt; &gt; random values between 0 and 1. Again, there is an example of what I<br>
&gt; &gt; mean<br>
&gt; &gt; &gt; &gt; in<br>
&gt; &gt; &gt; &gt; &gt; the attached patch.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Thanks<br>
&gt; &gt; &gt; &gt; &gt; Peiman<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; *<a href="http://www.peimankhosravi.co.uk" target="_blank">www.peimankhosravi.co.uk</a> &lt;<a href="http://www.peimankhosravi.co.uk" target="_blank">http://www.peimankhosravi.co.uk</a>&gt; || RSS<br>

&gt; &gt; Feed<br>
&gt; &gt; &gt; &gt; &gt; &lt;<a href="http://peimankhosravi.co.uk/miscposts.rss" target="_blank">http://peimankhosravi.co.uk/miscposts.rss</a>&gt; || Concert News<br>
&gt; &gt; &gt; &gt; &gt; &lt;<a href="http://spectralkimia.wordpress.com/" target="_blank">http://spectralkimia.wordpress.com/</a>&gt;*<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; &gt; &gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt; &gt; &gt; &gt; &gt; UNSUBSCRIBE and account-management -&gt;<br>
&gt; &gt; &gt; &gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt; &gt; &gt; UNSUBSCRIBE and account-management -&gt;<br>
&gt; &gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
<br>
<br>
</div></div></blockquote></div><br></div>