Well, this is for the phase vocoder patch, which is based on miller's I07 example.<div><br></div><div>There'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's not that much of a big restrain at all. You won'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'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'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'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"><<a href="mailto:czhenry@gmail.com" target="_blank">czhenry@gmail.com</a>></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 <<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>> wrote:<br>
> Hi folks, I'm trying to implement a ring buffer with a table for a sampler<br>
> patch based on an array.<br>
><br>
> But I'm having the hardest time cause it always "clicks" when I start<br>
> writing back on the beginning of the array.<br>
><br>
> I made this simple test attached below using metro. But I'm figuring the<br>
> flaw is because is not trivial at all to keep control data in sync with<br>
> audio blocks<br>
><br>
> 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'm not sure how it'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>