<div dir="ltr"><div>I understand this, I understand how cubic interpolation works, to some extent. What I don't understand is in what way is this different to the way [tabosc4~] deals with tables.<br></div>If I want to feed a table with values from a mathematical function, should I copy the last element to index(0) and the first two elements to index(length - 2) and index(length - 1), if I'm gonna use [tabread4~]? What I understand is that this is necessary, whether I use [tabosc4~] or [tabread4~], right?<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 6, 2013 at 4:26 PM, Miller Puckette <span dir="ltr"><<a href="mailto:msp@ucsd.edu" target="_blank">msp@ucsd.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The read points actually rangee from 1 to 9 (or 8.99999 - something) - and if,<br>
for nstance, you want to read teh value at 8.5, you need the points<br>
7, 8, 9, and 10. So teh sze is 11 (indices 0-10 nclusve).<br>
<br>
It's confusing, I know....<br>
<br>
cheers<br>
<span class="HOEnZb"><font color="#888888">Miller<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, Sep 06, 2013 at 01:53:54PM +0300, Alexandros Drymonitis wrote:<br>
> Ok, but why don't you need the guard points at the end of the array when<br>
> you're using [tabread4~], and only the first guard point? In the audio<br>
> examples of Pd's browser, the patch B04.tabread4.interpolation.pd<br>
> demonstrates the use of the object where it reads an array of 11 elements,<br>
> from index 1 up to (and including) index 8. Why is there an index 9 and 10<br>
> if those values are not needed? What's the difference between [tabosc4~]'s<br>
> interpolation and [tabread4~]'s interpolation?<br>
><br>
> ---------- Forwarded message ----------<br>
> From: Miller Puckette <<a href="mailto:msp@ucsd.edu">msp@ucsd.edu</a>><br>
> Date: Thu, Sep 5, 2013 at 4:35 PM<br>
> Subject: Re: [PD] Sinesum, cosinesum and cubic interpolation's guard points<br>
> To: Alexandros Drymonitis <<a href="mailto:adrcki@gmail.com">adrcki@gmail.com</a>><br>
><br>
><br>
> It's only necessary if you want to smoothly wrap around from the "last"<br>
> index to 0 (as you do in most uses of tabosc~, but not, for example, if<br>
> you're using tabread4~ as a sampler.)<br>
><br>
> I should fix Pd to uniformly use PI from math.h - "3.14159" was a bit<br>
> slapdash in retrospect :)<br>
><br>
> cheers<br>
> Miller<br>
><br>
> On Thu, Sep 05, 2013 at 04:26:20PM +0300, Alexandros Drymonitis wrote:<br>
> > OK, that's clear, thanks. Still when using [tabread4~] or [tabosc4~] you<br>
> > still need a copy of the last element in the first index and copies of the<br>
> > first two elements in the last two indices, right? Even if you're not<br>
> using<br>
> > sinesum or cosinesum but some other mathematical function..<br>
> ><br>
> ><br>
> > On Thu, Sep 5, 2013 at 1:56 PM, IOhannes m zmoelnig <<a href="mailto:zmoelnig@iem.at">zmoelnig@iem.at</a>><br>
> wrote:<br>
> ><br>
> > > -----BEGIN PGP SIGNED MESSAGE-----<br>
> > > Hash: SHA1<br>
> > ><br>
> > > On 2013-09-05 09:45, Alexandros Drymonitis wrote:<br>
> > > > OK, index 0 is the negative of index 2,<br>
> > ><br>
> > > no not really, they just happen to be the same.<br>
> > ><br>
> > > > which can again make sense as it's a sine (supposing that index 0<br>
> > > > is a copy of the table's last element), but index 512 doesn't have<br>
> > > > that value, why? And why do indices 1 and 513 have different values<br>
> > > > too?<br>
> > ><br>
> > > do they?<br>
> > ><br>
> > > when it comes to floating point, "equality" becomes a little bit fuzzy.<br>
> > > e.g. "0.1" is really the 'same' as "0.100000001490116119384765625" [1].<br>
> > ><br>
> > > comparing the values, you can see that they are not *very* wrong:<br>
> > ><br>
> > > array[512]-array[0] = -5.30668e-6 = -0.0000053<br>
> > > array[513]-array[1] = -5.30718e-6 = -0.0000053<br>
> > > array[514]-array[2] = -5.30668e-6 = -0.0000053<br>
> > ><br>
> > > so the errors are really rather small, and hopefully don't matter so<br>
> > > much in the interpolation (which is another approximation anyhow).<br>
> > ><br>
> > > the reason why the error is not smaller, is that Pd internally<br>
> > > (src/g_array.c:896) deals with a PI value of 3.14159, which is a<br>
> > > rather rough estimate and is the reason why the cycle is not exactly<br>
> > > 512 points long.<br>
> > ><br>
> > ><br>
> > > fgamsdr<br>
> > > IOhannes<br>
> > ><br>
> > > [1]<br>
> > ><br>
> > ><br>
> <a href="http://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conversion_and_rounding" target="_blank">http://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conversion_and_rounding</a><br>
> > > -----BEGIN PGP SIGNATURE-----<br>
> > > Version: GnuPG v1.4.14 (GNU/Linux)<br>
> > > Comment: Using GnuPG with Icedove - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
> > ><br>
> > > iEYEARECAAYFAlIoY3UACgkQkX2Xpv6ydvTY1wCcDCyH8kY50snbVOv5AxwspIAB<br>
> > > jwQAoLJOrVoESvzyqrZyvWKky0ec1eUT<br>
> > > =YqkS<br>
> > > -----END PGP SIGNATURE-----<br>
> > ><br>
> > > _______________________________________________<br>
> > > <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
> > > UNSUBSCRIBE and account-management -><br>
> > > <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
> > ><br>
><br>
> > _______________________________________________<br>
> > <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
> > UNSUBSCRIBE and account-management -><br>
> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
> _______________________________________________<br>
> <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
</div></div></blockquote></div><br></div>