Bipolar (alternates 1.0 and -1.0) band limited impulse generator based on B-Spline interpolation of order 3, integrated to create a square waveform.
You start to hear aliasing over 4000 Hz or so, otherwise perceptually indistinguishable from an analogue waveform. Max frequency is half the sampling rate, but you'll hear aliasing well before that. Note that frequency can only be changed at the close of each period, so for very low frequencies, there will be a delay changing pitch. Audio rates for fundamental frequencies in the range of standard acoustic instrument pitches, ie piano keyboard or so, work best.
leaky coefficient for integration. 0 would give back the impulses, higher numbers (up to near 1.0) fill out the inter-impulse space, integrating the waveform.