<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>If you know in advance what set of files to choose from, you could start by reading in a text file with all the file paths then make the random selection in chuck. This avoids system calls, which can mess with the timing of your real-time application since the chuck VM misses the time spent doing the system call (i.e. Std.system(“sleep 1”) causes mayhem). But if you want to be able to add files to a directory on the fly I think you have to do the system call. Just be aware of the timing issue - maybe it can be done in a thread.</div><div><br></div><div>-Julian</div><div><br><blockquote type="cite"><span style="color: rgb(127, 127, 127);"><b>From: </b></span>Atte &lt;<a href="mailto:atte@youmail.dk">atte@youmail.dk</a>&gt;<br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Subject: </b></span><span style="font-family:'Helvetica';"><b>[chuck-users] reading random sample</b><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Date: </b></span><span style="font-family:'Helvetica';">January 28, 2015 at 6:32:29 AM GMT-5<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>To: </b></span><span style="font-family:'Helvetica';">ChucK Users Mailing List &lt;<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Reply-To: </b></span><span style="font-family:'Helvetica';">ChucK Users Mailing List &lt;<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a>&gt;<br></span></div><br><br>Hi<br><br>I'm trying to write a function that reads a random samples from a<br>directory into a SndBuf. I'm not aware of the the necessary<br>functionality being available in chuck, so I wrote a bash script that<br>picks a random file from a directory and writes the name with full path<br>to /tmp/random_file. When I call Std.system() I get a warning that I<br>should use --caution-to-the-wind. This works well in chuck, but in fact<br>I'm in miniAudicle, how do I call miniAudicle with that option? Just doing<br><br>$ miniAudicle --caution-to-the-wind<br><br>makes miniAudicle think I want to start with a blank file called<br>"--caution-to-the-wind"...<br><br>-- <br>Atte<br><br><a href="http://atte.dk">http://atte.dk</a> &nbsp;&nbsp;<a href="http://a773.dk">http://a773.dk</a><br><br><br><br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>From: </b></span><span style="font-family:'Helvetica';">Atte &lt;<a href="mailto:atte@youmail.dk">atte@youmail.dk</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Subject: </b></span><span style="font-family:'Helvetica';"><b>Re: [chuck-users] reading random sample</b><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Date: </b></span><span style="font-family:'Helvetica';">January 29, 2015 at 6:25:08 AM GMT-5<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>To: </b></span><span style="font-family:'Helvetica';"><a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Reply-To: </b></span><span style="font-family:'Helvetica';">ChucK Users Mailing List &lt;<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a>&gt;<br></span></div><br><br>On 01/28/2015 12:32 PM, Atte wrote:<br><blockquote type="cite">how do I call miniAudicle with that option?<br></blockquote><br>Nevermind, I'm back to chuck, seems much more stable...<br><br>-- <br>Atte<br><br><a href="http://atte.dk">http://atte.dk</a> &nbsp;&nbsp;<a href="http://a773.dk">http://a773.dk</a><br><br></blockquote></div><br></body></html>