<div dir="ltr">Thanks Stephen. Here&#39;s a simplified version of what I&#39;m doing. <div><br></div><div>This works:<div><br></div><div><span class="" style="white-space:pre">        </span>stk::BlitSaw oscArray[10];<br><div><br>
</div><div><div><span class="" style="white-space:pre">        </span>for( int i=0; i &lt; 10; i++ )</div><div><span class="" style="white-space:pre">        </span>{</div><div><span class="" style="white-space:pre">                </span>stk::BlitSaw saw;</div>
<div><span class="" style="white-space:pre">                </span>saw.setHarmonics(0);</div><div><span class="" style="white-space:pre">                </span>saw.setFrequency(220);</div><div><span class="" style="white-space:pre">                </span>oscArray[i] = saw;</div>
<div><span class="" style="white-space:pre">        </span>}</div></div><div><br></div><div style>This breaks:</div><div style><br></div><div style>std::vector&lt;stk::BlitSaw&gt; oscs;<br></div><div style><br></div><div style><div>
<span class="" style="white-space:pre">        </span>for( int i=0; i &lt; 10; i++ )</div><div><span class="" style="white-space:pre">        </span>{</div><div><span class="" style="white-space:pre">                </span>stk::BlitSaw saw;</div><div>
<span class="" style="white-space:pre">                </span>saw.setHarmonics(0);</div><div><span class="" style="white-space:pre">                </span>saw.setFrequency(220);</div><div><span class="" style="white-space:pre">                </span>oscs.push_back(saw);</div>
<div><span class="" style="white-space:pre">        </span>}</div><div><br></div><div style>the second example causes an unhandled exception/access violation reading from a location. As mentioned this appears to happen after StkFrames::resize() is called (I don&#39;t fully understand why this would be called).</div>
<div style><br></div><div style>thanks, n</div><div><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 19, 2013 at 8:41 AM, Stephen Sinclair <span dir="ltr">&lt;<a href="mailto:sinclair@music.mcgill.ca" target="_blank">sinclair@music.mcgill.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Jun 19, 2013 at 2:36 PM, Nick Dika &lt;<a href="mailto:nhdika@gmail.com">nhdika@gmail.com</a>&gt; wrote:<br>

&gt; Hi All,<br>
&gt;<br>
&gt; Advance apologies for amateurish questions, I&#39;m new to all of this :)<br>
&gt;<br>
&gt; I am attempting to use STK&#39;s BlitSaw oscillator within a Juce project. I am<br>
&gt; currently not using any of STK&#39;s frames functionality, I&#39;m just filling<br>
&gt; Juce&#39;s own audio buffer with ticks from the BlitSaw. It&#39;s my understanding<br>
&gt; that using StkFrames would be redundant here, so i&#39;ve just not used it.<br>
&gt;<br>
&gt; I am working with some stacked oscillators that I&#39;m summing together, pretty<br>
&gt; basic stuff. Currently if I create an array of BlitSaws, that appears to<br>
&gt; work just fine. It would be more convenient to use a std::vector.<br>
&gt; Unfortunately trying to use the vector container causes unhandled exceptions<br>
&gt; for me. From looking back through the call stack, it looks like at some<br>
&gt; point STKFrames::resize() gets called then things blow up.<br>
&gt;<br>
&gt; Can anyone suggest what I might do to fix this? Must I (or should I) be<br>
&gt; using StkFrames somehow in this scenario? Thanks!<br>
<br>
</div></div>There is little reason why an std::vector would behave differently<br>
than a regular C++ array.  Can you post some minimal example code that<br>
causes the exception?  What&#39;s the exception, anyway?<br>
<br>
Steve<br>
<br>
_______________________________________________<br>
Stk mailing list<br>
<a href="mailto:Stk@ccrma.stanford.edu">Stk@ccrma.stanford.edu</a><br>
<a href="http://ccrma-mail.stanford.edu/mailman/listinfo/stk" target="_blank">http://ccrma-mail.stanford.edu/mailman/listinfo/stk</a><br>
</blockquote></div><br></div>