RFC: what basic waveform GEN patches for toolbox?
Hi folks
Since I did the same thing at Native Instruments before and after it introduced Core, I'd like to contribute to the patch library here with some basic waveform patches for GEN. Here is a very simple basis for generating sine, square, and ramp waveforms, based on a Reaktor design from 2003 and an MSP design from 2007. Many additions are possible: adding triangle, pwm, ramp modulation, etc, I don't know what'd be most useful, I've already built many of them experimentally, and I'm open to input. I posted this basis some time ago, and no one's suggested anything better....so I'm ready to do it)
I don't seem to be getting anything out of your algorithm…?
Nice start! Here's another possible future (complete with an exciting square wave production algorithm I'm sure you'll be impressed by):
As with my example the waveforms you've posted aren't band limited, so UNLESS you're going to use them for FM (where crunchiness due to aliasing artifacts is a *good* thing) or LFOs, they're not going to sound all that great. There's a reason that software designers make a big deal about having antialiasing waveforms, and it has everything to do with how they sound (have a look at the antialiasing tab in the saw~ Max help file for more on this). The gen~ examples contains a very nice band limited sawtooth oscillator (gen~.band_limited_saw) that's um... a little more complicated than what you and I are making. :-)
I've been a little surprised that oscillators aren't more a subject of inquiry for gen~ folks. Seems like most people have the hots on for ....
A "from scratch" non-band limited sine wave I posted a while back. Based on the block diagram on page 3 of this paper: http://www.icst.net/fileadmin/data/pdf/dsg/Digital_Sound_Generation_1.pdf
I'm still trying to find the time to learn how to implement the various band limiting methods.
That's interesting stringtapper. It worked in my design, which I simplified for the picture, because it derived an initial value for phasor elsewhere. I think, without an initial value, the output never crosses zero, so the phasor doesn't start. I guess there could be some other pragmatic issues. I'll check into it.
Also the mathematical values weren't floating point. Yes they are floating point, and what I do is oversample and sinc filter by putting it in a poly~, which at least removes aliasing with Nyqist. For switching between the outputs without a click, the selector for waveshape output would also need to be sampled and changes set at zero crossings, which is why cos is easier than sin; and the dcblock is only helpful if the frequencies change continuously, but as they do in FM, I included it. Here is it so far: Any other feature requests?
And yes, I agree this is the right way to do it, because the phase signal can apply phase modulation without clicks, while the frequency input sets the fundamental frequency.
So I got to this, with a patch. Rather than a selector, it gates the amp on zero crossovers to stop clicks on wave selection and amplitude change. In Audio setup, I think overdrive may have to be enabled for click-free operation, and it may depend on audio driver, but I don't know.
Did some optimization.With phase modulation for FM, dcblock isn't necessary.
Very well, it is in freeze. Thank you )
It's now available for download here:
very cool. how do i effectively band limit my oscillators?
i did not need band limiting for my application, so these are pure waveforms. I did try out minibleps and so on. I felt the built-in solution which the MSP oscillators provide is still aesthetically better and consumes far less CPU. The MSP osciallators are professionally designed, and I could go into details about why i think they are better, but that is really off topic.