Well, this is for the phase vocoder patch, which is based on miller&#39;s I07 example.<div><br></div><div>There&#39;s a counter that reads over the table, and I expanded the thing allowing it to loop and other convenient sampling controls.</div>
<div><br></div><div>I never needed a perfect loop, cause I never loaded real perfectly looped files in it, so I just check when the counter grows bigger than the table size and restart it. As for recording on the tables, I do fade-in and fade-out, because it would click anyway.</div>
<div><br></div><div>Now, for the ring buffer, it needs to be in perfect sync, so I can have tables that are multiples of the block size and use [bang~], it&#39;s not that much of a big restrain at all. You won&#39;t be able to specify an exact table size, but the resolution is 64 samples, and that is like 1.45 miliseconds (about nothing). So I got over it, did it, and it works!!!</div>
<div><br></div><div>I can adapt the thing for loaded samples, and have it the table size rounded up to multiples of the block + 1. This is not a perfect loop, but they weren&#39;t perfect before anyhow...</div><div><br></div>
<div>But why stop there? How to make it loop perfectly? This is the issue now. <u>Checking Miller&#39;s Phase Vocoder example. If you load a sample, how to make it loop perfectly?</u></div><div><br></div><div>I know one could use phasor~ and other stuff to read the table. But for the Phase Vocoder patch, we need that structure with the counter and everything.</div>
<div><br></div><div>Well, I&#39;ll keep thinking.</div><div><br></div><div>Thanks</div><div><br></div><div><br><div class="gmail_quote">2012/1/8 Charles Henry <span dir="ltr">&lt;<a href="mailto:czhenry@gmail.com" target="_blank">czhenry@gmail.com</a>&gt;</span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 1/8/12, Alexandre Torres Porres &lt;<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>&gt; wrote:<br>



&gt; Hi folks, I&#39;m trying to implement a ring buffer with a table for a sampler<br>
&gt; patch based on an array.<br>
&gt;<br>
&gt; But I&#39;m having the hardest time cause it always &quot;clicks&quot; when I start<br>
&gt; writing back on the beginning of the array.<br>
&gt;<br>
&gt; I made this simple test attached below using metro. But I&#39;m figuring the<br>
&gt; flaw is because is not trivial at all to keep control data in sync with<br>
&gt; audio blocks<br>
&gt;<br>
&gt; any hints or ideas?<br>
<br>
</div>I think you might be better able to keep the data in sync with a<br>
vline~/metro/tabread4~ construction, because it preserves the timing<br>
information in the messages.  Instead of vline~/metro, you could also<br>
use phasor~ which makes the looping implicit.<br>
<br>
To work around clicks, crossfading is what I hear about the most on<br>
list.  I&#39;m not sure how it&#39;s implemented.<br>
<br>
When I think about coding in C, I always want to have N contiguous<br>
samples to avoid having to check against the end of the array.  To do<br>
that, you make the buffer 2*N-1 in length.  Then, on each write, you<br>
write to two locations (0,N), (1,N+1), (2,N+2)...  That ensures there<br>
is always N samples in a row to read from, and you just move the read<br>
pointer by 1 each time you get a vector of N samples long. (my<br>
personal method...nothing more).<br>
</blockquote></div><br>
</div>