<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">RE: expanding array sizes and null references. </span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
I hope this helps...</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)">//start out with an generic UGen array (named myArray) with size 2</p>
<p style="font-family:Helvetica;font-size:12.8px;margin:0px">UGen myArray[<span style="color:rgb(222,146,16)">2</span>];</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px"><<< myArray.size() >>>;</p>
<p style="font-family:Helvetica;font-size:12.8px;margin:0px;min-height:16px"><br></p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;min-height:16px"><br></p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)">
//change size of myArray to 3, using interger object </p><p style="font-family:Helvetica;font-size:12.8px;margin:0px"><span style="color:rgb(222,146,16)">3</span><span style="color:rgb(114,158,18)"> </span>=><span style="color:rgb(114,158,18)"> </span><span style="color:rgb(4,51,255)">int</span><span style="color:rgb(114,158,18)"> </span>newSize;</p>
<p style="font-family:Helvetica;font-size:12.8px;margin:0px">myArray.size(newSize);</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px"><<< myArray.size(newSize) >>>;</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;min-height:16px">
<br></p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)">//Since (I believe) expanded arrays do not actually have the classed object in the new index, you have put a "new" reference in. </p>
<p style="font-family:Helvetica;font-size:12.8px;margin:0px"><span style="color:rgb(4,51,255)">for</span> (<span style="color:rgb(222,146,16)">0</span> => <span style="color:rgb(4,51,255)">int</span> i; i < newSize; i++) {</p>
<p style="font-family:Helvetica;font-size:12.8px;margin:0px">    <span style="color:rgb(4,51,255)">new</span> UGen @=> myArray[i];</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px">    SinOsc s;</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px">
    s => myArray[i];</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px">}</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;min-height:16px"><br></p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)">
// This works as long as you have a uniform array of primitive UGens, as you are declaring NEW versions of that UGen (also filling in the new NULL array referneces).</p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)">
// This may be troublesome, as you would have to re-update previous the UGen parameters, since they replaced with NEW ones. </p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)"><span style="color:rgb(34,34,34)"><br>
</span></p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)"><span style="color:rgb(34,34,34)"><br></span></p><p style="font-family:Helvetica;font-size:12.8px;margin:0px;color:rgb(114,158,18)">
<span style="color:rgb(34,34,34)">Nick Hwang</span><br></p></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 11:18 AM, George Locke <span dir="ltr"><<a href="mailto:george.locke.maxmsp@gmail.com" target="_blank">george.locke.maxmsp@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">no dice.  <div><br></div><div><div>1 => int choosePulse;</div><div class="im"><div><br></div><div>BlitSquare pls[10];</div>
<div>BlitSaw saw[10];</div></div><div>BLT osc[10];</div><div>if (choosePulse) {</div><div>pls @=> osc;</div>
<div>} else {</div><div>saw @=> osc;</div><div>}</div></div><div><br></div><div>produces a compile error at the "pls @=> osc" line:</div><div><p style="margin:0px">[untitled]:line(7): cannot assign '@=>' on types 'BlitSquare[]' @=> 'BLT[]'...</p>


<p style="margin:0px">[untitled]:line(7): ...(reason: --- incompatible types for assignment)</p><p style="margin:0px"><br></p><p style="margin:0px">Perry's workaround is good enough, though.</p><span class="HOEnZb"><font color="#888888"><p style="margin:0px">

<br></p><p style="margin:0px"> - George</p></font></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sun, Feb 2, 2014 at 10:37 PM, Zacko Belsch <span dir="ltr"><<a href="mailto:zackobelsch@gmail.com" target="_blank">zackobelsch@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div style="text-align:-webkit-auto;font-size:medium;font-family:Helvetica">
I'm not sure whether the following is relevant or not.</div>
<div style="text-align:-webkit-auto;font-size:medium;font-family:Helvetica">
<br></div><div style="text-align:-webkit-auto;font-size:medium;font-family:Helvetica">Looking at the chuck source code (in <font color="#000000" face="Helvetica" size="3">ugen_stk.h)</font>, it appears the common superclass of BlitSaw and BlitSquare is BLT, not Blit.  Would what you tried work if you used BLT for your common array instead of Blit?</div>


<div style="text-align:-webkit-auto;font-size:medium;font-family:Helvetica"><br></div><div style="text-align:-webkit-auto;font-size:medium;font-family:Helvetica"><span style="text-align:-webkit-auto">Bob H</span><br>
</div><div style="text-align:-webkit-auto;font-size:medium;font-family:Helvetica"><br></div><div><br></div></div>
<br></div></div><div class="im">_______________________________________________<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" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br></div>