Anybody know how to use the Oscillator class to generate a band limited square wave?

I’m using the following function?

```
auto squareFunc = [&] (float in) -> float
{
if (bandLimited)
{
double sum = 0;
for (int i = 1; i < 10; i++)
sum += sin ((2 * i - 1) * in) / ((2 * i - 1));
return 4.0f / float_Pi * sum;
}
return in < 0 ? -1 : 1;
};
```

But how do I know how many terms are safe to sum before I start generating frequencies higher than sample rate / 2?