I'm starting to write a soft synthesizer with a peculiar characteristic: The oscillators will have a "continuous waveform" knob that will allow users to select sine, square and saw tooth waves in a continuous fashion. That is, if the knob is all the way to the left, the output will be a sine wave, if it's in the middle it will be a saw tooth wave, if it's all the way to the right it'll be a square wave and then the intermediate positions will output waves that are "interpolated" versions of the classic waves. -- Knob positions and types of waves could be changed but having a continuous way to change wave forms is desired --
I've thought of a couple of ways to implement the oscillator:
Come up with a function that takes the knob position and calculates the spectrum of the actual signal (an array of amplitudes and frequencies) and then use a bunch of sine functions and a sum block to implement the output signal.
Similar to 1. but apply a reverse Fourier transform instead of the sines and sum (OK, at this point I'm not sure if they are actually the same thing.)
Generate a waveform table for each possible knob position and use a wave table synthesis technique to generate the output signal.
Start with 2 saw tooth waves (they contain both even and odd harmonics), invert one and sum them, and control the amplitude of each one of them with the knob. The wave forms would not be
I have a few questions:
A. I've read that technique number 1 is very processor intensive and not really feasible. Does this hold true for ARM processors such as the one on the iPad??
B. Whatever technique I end up choosing, can the problem of aliasing be resolved simply by connecting a low-pass filter to the output of the oscillator?
C. Any other suggestion on how to implement such an oscillator?
D. Any suggestions on which C++ toolkit to use? I've been looking at the STK from CCRMA but I don't know if there are other more suitable libraries.
Wish me luck! ;)
Edit: Someone pointed me to din last night. Bezier curves are another option to consider.