<div dir="ltr">Thanks Stephen. Here's a simplified version of what I'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 < 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<stk::BlitSaw> oscs;<br></div><div style><br></div><div style><div>
<span class="" style="white-space:pre">        </span>for( int i=0; i < 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'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"><<a href="mailto:sinclair@music.mcgill.ca" target="_blank">sinclair@music.mcgill.ca</a>></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 <<a href="mailto:nhdika@gmail.com">nhdika@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> Advance apologies for amateurish questions, I'm new to all of this :)<br>
><br>
> I am attempting to use STK's BlitSaw oscillator within a Juce project. I am<br>
> currently not using any of STK's frames functionality, I'm just filling<br>
> Juce's own audio buffer with ticks from the BlitSaw. It's my understanding<br>
> that using StkFrames would be redundant here, so i've just not used it.<br>
><br>
> I am working with some stacked oscillators that I'm summing together, pretty<br>
> basic stuff. Currently if I create an array of BlitSaws, that appears to<br>
> work just fine. It would be more convenient to use a std::vector.<br>
> Unfortunately trying to use the vector container causes unhandled exceptions<br>
> for me. From looking back through the call stack, it looks like at some<br>
> point STKFrames::resize() gets called then things blow up.<br>
><br>
> Can anyone suggest what I might do to fix this? Must I (or should I) be<br>
> 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'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>