RFC: what basic waveform GEN patches for toolbox?

    Mar 22 2013 | 6:08 pm
    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)

    • Mar 22 2013 | 7:08 pm
      I don't seem to be getting anything out of your algorithm…?
    • Mar 22 2013 | 10:02 pm
      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 ....
    • Mar 23 2013 | 4:18 am
      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.
    • Mar 25 2013 | 6:55 pm
      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.
    • Mar 25 2013 | 7:20 pm
      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?
    • Mar 25 2013 | 7:22 pm
      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.
    • Mar 25 2013 | 11:52 pm
      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.
    • Mar 26 2013 | 6:59 pm
      Did some optimization.With phase modulation for FM, dcblock isn't necessary.
    • Apr 01 2013 | 3:29 pm
      Very well, it is in freeze. Thank you )
    • Nov 07 2013 | 4:07 am
    • Feb 12 2014 | 5:50 am
      very cool. how do i effectively band limit my oscillators?
    • Feb 12 2014 | 6:04 am
      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.