While working with square and pulse waves, I found that certain frequencies produce a sort of overlapping effect, which I believe happens when the frequency and the precision level of a float don't mix well together. In any case, it can be remedied by adding a slope between value changes.

Much like tabread4~ and tabosc4~, these objects work best with tables whose size is a power of 2, plus three. Linear interpolation really only requires 1 additional point, such that the first and last points are the same value, but for the sake of compatibility, the wave starts at index 1, while index 0 is just ignored. Pd's 4-point interpolation has 1 look-behind point and expects the beginning of the wave to be at index 1. Messages like `sinesum`

and `cosinesum`

generate arrays with this in mind.

The 2nd inlet is a signal inlet and it adjusts the interpolation threshold, which can be thought of as the percentage of each point that should remain as the original value. So if the threshold is 0.9, that means that only the last 10% of the point will be dedicated to interpolation.

The zip comes with help files and Linux/Windows/Mac builds of the externals.

tab2.zip