Similar to the last example, we will create a triangle wave. This time we store one period in a table.
The name of the table is triangle and we have a view of the table in the middle of canvas. It is of size 512, and the message of sinesum creates a wave composed of fundamental (f) , and partial 3f, and partial 5f. There are only odd frequencies in a triangle wave. We used these amplitudes: 0.5,-0.5/9 and 0.5/25 for the three sinusoids.
We use tabosc4~ to play the wave over and over with 4-point interpolation. A wave at a frequency of 440-Hz, can fit exactly 440 such waves in one second. One second corresponds to 44100 samples. Thus each period is 44100/440 samples, or about 100. The program pd will figure out the exact math and do any interpolations, since it is not exactly 100, but 100.227.