The problem is that if you sample a mathematical waveform such as a sawtooth wave, it contains infinitely high frequencies, so the act of sampling creates aliasing.
There are a lot of solutions to this in the literature, such as wavetables that are band-limited, but for simple virtual analog synthesizers, there's a technique that is close to magic in its simplicity and quality: PolyBLEP. Check it out.
There are a lot of solutions to this in the literature, such as wavetables that are band-limited, but for simple virtual analog synthesizers, there's a technique that is close to magic in its simplicity and quality: PolyBLEP. Check it out.