st.lib");

//----------------------------------------------------------------------
// partial(f,n);
// f = frequency in Hz
// n = partial number starting at 1
partial(n,f) = os.osc(f*n) * hslider("partial %n", 0.25, 0, 1, 0.01);

process = sum(i, 4, partial(i+1, hslider("freq", 440, 20, 8000, 0.001)));

--></faust-editor>
<br>
</div>
<!-- /faust-run -->
<p>Note the use of the <code>sum(i, n, foo(i))</code> construction which is equivalent to <code>foo(0)+foo(1)+...+foo(n-1)</code>.</p>
<h3 id="example-6-ap