<div dir="ltr">you can also find more info here: <a href="https://en.flossmanuals.net/chuck/_full/#arrays">https://en.flossmanuals.net/chuck/_full/#arrays</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 10 Jan 2020 at 12:28, Matthew.Noone &lt;<a href="mailto:Matthew.Noone@ul.ie">Matthew.Noone@ul.ie</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
Hi all,</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
I&#39;m trying to figure out the easiest way to setup an array of the same SndBuf playing at different rates.</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<br>
</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
I&#39;m using a Gong sample.  Playing that back at different rates to make basic melodic patterns.</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<br>
</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
I can make a random function but I don&#39;t know who I can set an array of rates which I can then randomise.</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<br>
</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
Any ideas?</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<br>
</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
Here is my existing code with random function. (I tried writing an array at the start but not sure how to call that?)</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<br>
</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
Sorry for such an easy question...</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
MJ</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<br>
</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<p style="margin:0px;font:13px Monaco;color:rgb(114,158,18)">//Sndbuf</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;color:rgb(114,158,18)">//4 =&gt; int gongs;</p>
<p style="margin:0px;font:13px Monaco;color:rgb(114,158,18)">//[.25, 0.5, 1.0, .25] @=&gt; float rates[];//array of possible rates (changing will change harmony)</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;color:rgb(114,158,18)">//program</p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span style="color:rgb(180,54,240)">SndBuf</span><span>
</span>mySound<span> </span>=&gt;<span> </span><span style="color:rgb(180,54,240)">Delay</span><span>
</span>d<span> </span>=&gt;<span> </span><span style="color:rgb(180,54,240)">JCRev</span><span>
</span>rev<span> </span>=&gt;<span> </span><span style="color:rgb(180,54,240)">Gain</span><span>
</span>g<span> </span>=&gt;<span> </span><span style="color:rgb(4,51,255)">dac</span>;</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span style="color:rgb(222,146,16)">0</span>.<span style="color:rgb(222,146,16)">8</span><span>
</span>=&gt;<span> </span>rev.mix;</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;color:rgb(114,158,18)">//delay and rev setup</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)">d<span>
</span>=&gt;<span> </span><span style="color:rgb(180,54,240)">Gain</span><span> </span>feedback<span>
</span>=&gt;<span> </span>d;</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<br>
</p>
<p style="margin:0px;font:13px Monaco;color:rgb(4,51,255)">while<span style="color:rgb(0,0,0)"> (</span>true<span style="color:rgb(0,0,0)">)</span></p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)">{</p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span><span>   
</span></span>.<span style="color:rgb(222,146,16)">02</span><span> </span>=&gt;<span> </span>
g.gain;</p>
<p style="margin:0px;font:13px Monaco;color:rgb(81,81,81)"><span style="color:rgb(0,0,0)"><span>   
</span></span><span style="color:rgb(4,51,255)">me</span><span style="color:rgb(0,0,0)">.dir()+</span>&quot;Samples/MotherGong.wav&quot;<span style="color:rgb(0,0,0)"> =&gt;mySound.read;</span></p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span><span>   
</span></span><span style="color:rgb(222,146,16)">0</span><span> </span>=&gt;mySound.pos;</p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span><span>   
</span></span><span style="color:rgb(148,19,46)">Math</span>.random2f<span> </span>(<span>
</span><span style="color:rgb(222,146,16)">20</span>.<span style="color:rgb(222,146,16)">1</span>,<span>
</span><span style="color:rgb(222,146,16)">22</span>.<span style="color:rgb(222,146,16)">01</span><span>
</span>)<span> </span>=&gt;<span> </span>mySound.rate;<span> <span> </span></span></p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span><span>   
</span></span><span style="color:rgb(148,19,46)">Math</span>.random2f(<span> </span><span style="color:rgb(222,146,16)">0</span>.<span style="color:rgb(222,146,16)">3</span>,<span>
</span><span style="color:rgb(222,146,16)">0</span>.<span style="color:rgb(222,146,16)">5</span>)<span>
</span>::<span style="color:rgb(4,51,255)">second</span><span> </span>=&gt;<span> </span>
d.max;</p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span><span>   
</span></span><span style="color:rgb(148,19,46)">Math</span>.random2(<span> </span><span style="color:rgb(222,146,16)">30</span>,<span>
</span><span style="color:rgb(222,146,16)">70</span>)<span> </span>::<span style="color:rgb(4,51,255)">ms</span><span>
</span>=&gt;d.delay;</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)"><span><span>   
</span></span><span style="color:rgb(148,19,46)">Math</span>.random2f(<span> </span><span style="color:rgb(222,146,16)">0</span>.<span style="color:rgb(222,146,16)">3</span>,<span>
</span>.<span style="color:rgb(222,146,16)">8</span>)<span> </span>=&gt;<span> </span>feedback.gain;</p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;color:rgb(4,51,255)"><span style="color:rgb(0,0,0)"><span>   
</span></span><span style="color:rgb(222,146,16)">0</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(222,146,16)">50</span><span style="color:rgb(0,0,0)"> ::</span>second<span style="color:rgb(0,0,0)"> =&gt;
</span>now<span style="color:rgb(0,0,0)">;</span></p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;min-height:17px">
<span>    </span></p>
<p style="margin:0px;font:13px Monaco;color:rgb(0,0,0)">}</p>
<br>
</div>
<div style="font-family:&quot;Times New Roman&quot;,Times,serif;font-size:14pt;color:rgb(0,0,255)">
<br>
</div>
<div id="gmail-m_-6005385994094304559Signature">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div><font size="3" face="Times New Roman">Dr. Matthew James Noone</font><br>
<div style="font-family:Tahoma;font-size:13px"><font size="3" face="Times New Roman"><i>Sarode Artist &amp; Irish Research Council Postdoctoral Fellow</i></font></div>
<div style="font-family:Tahoma;font-size:13px"><i style="font-family:&quot;Times New Roman&quot;;font-size:medium">Irish World Academy of Music and Dance</i></div>
<div style="font-family:Tahoma;font-size:13px"><i style="font-family:&quot;Times New Roman&quot;;font-size:medium">University of Limerick</i></div>
<div style="font-family:Tahoma;font-size:13px"><font size="3" face="Times New Roman"><br>
</font></div>
</div>
</div>
</div>
</div>
</div>

_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div>