<div dir="ltr">Yeah the problem is probably in removeSeq. <div><br></div><div><div>        for(int i; i &lt; s.size(); i++) {</div><div>            if(i != num) {</div><div>                sequences[i] @=&gt; s[i];</div><div>            } else {</div><div>                sequences[i + 1] @=&gt; s[i];</div><div>            }</div><div>        }</div></div><div><br></div><div>Here you only hit the i+1 case when you find the seq you are removing (&quot;num&quot;). In the next loop around, you go back to copying sequences[i] to s[i]; sequences[i] at this stage is the same as sequences[i+1] in the previous loop around, so overall you&#39;ve copied sequences[num+1] twice. </div><div><br></div><div>For simplicity I would refactor this into two loops, one to copy everything before num (sequences[i] @=&gt; s[i];) and one to copy everything after (sequences[i+1] @=&gt; s[i];), but there are a few different ways you could structure it. If ChucK had a list class this would be a lot easier, but so it goes. </div><div><br></div><div>spencer</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 21, 2016 at 4:50 AM, dude <span dir="ltr">&lt;<a href="mailto:prosvirnin.arseniy@gmail.com" target="_blank">prosvirnin.arseniy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, Chuck users!<br>
<br>
I work on chuck program for live performance.<br>
Main goal of program is play and delete sequences,<br>
made from pre-made text file.<br>
<br>
All sequences are separate shreds which running and<br>
stoping by SequenceController class; each<br>
sequence is instance of Sequence class.<br>
<br>
So my problem is:<br>
<br>
For example I have three sequences running.<br>
If I delete sequences in inverse order,<br>
all works fine; other way one of all sequences can not<br>
be deleted and lookup() function shows all<br>
sequences name as name of undeletable sequence.<br>
<br>
Here is a link on PasteBin - <a href="http://pastebin.com/5Kk8xVKV" rel="noreferrer" target="_blank">http://pastebin.com/5Kk8xVKV</a><br>
<br>
I guess problem is in removeSeq function on line 82.<br>
<br>
I&#39;ve got number for sequence from midi controller<br>
and it is an 0 indexed integer.<br>
<br>
Thanks for yours assistance.<br>
<br>
Phlox.s<br>
<br>
______________________________<wbr>_________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.<wbr>princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.<wbr>edu/mailman/listinfo/chuck-<wbr>users</a><br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><div>Spencer Salazar<br></div><div>Doctoral Candidate</div><div>Center for Computer Research in Music and Acoustics</div><div>Stanford University</div><div><br></div><div><a href="mailto:spencer@ccrma.stanford.edu" target="_blank">spencer@ccrma.stanford.edu</a></div><div></div><div>+1 831.277.4654<br></div><div><a href="https://ccrma.stanford.edu/~spencer/" style="color:rgb(17,85,204)" target="_blank">https://ccrma.stanford.edu/~spencer/</a><br></div><div><br></div></div></div></div></div></div></div></div></div></div>
</div>