Forums > MaxMSP

transitioning between waveforms

Nov 16 2013 | 9:10 am

currently using menu to switch between waveforms for a frequency, obviously there is an audible click each time i select a new waveform and this is something I’m trying to fix.

i’ve attempted to multiply the output of cycle~ into a clip~ object which results in something much like a square wave or rect~ but its not completely similar as much as i would like it to be.

what i’m trying to achieve is something much like the moog voyager where you have a knob that gently crossfades between various waveforms without audible clicks.

any help is greatly appreciated

Nov 16 2013 | 10:45 am

you could let them run both and simply crossfade using *~

Nov 17 2013 | 12:04 pm

I would recommend scanning a wave table. Cross fading between sources will create an audible dip in volume when you are transitioning between oscillators.

Nov 18 2013 | 3:03 am

The main cause of a "dip" in crossfading is using a linear crossfade (and, if you do that, then you sort of deserve the results you get:-)

Using a quarter-cosine mapping is the standard approach to maintain equal power over a crossfade. Exactly how well that works will depend on your source material, but it generally does a good job.

Nov 18 2013 | 5:05 am

What Peter said:

-- Pasted Max Patch, click to expand. --


we use this a lot

Nov 18 2013 | 6:10 am

thanks for all the replies. i was hoping to get a little more elaboration on n00b_meisters patch… very interesting but i’m lacking the understanding as to how I could create that crossfade between waveforms smoothly, while interpolating the various points between each waveform.

Nov 18 2013 | 1:40 pm

As Peter says, the success of the non-linear crossfade is dependent upon source material, and with simple waveforms in the -1. +1. range you will get some cases where they exceed (=clipping) this range, so a linear crossfade might be better; for example:

-- Pasted Max Patch, click to expand. --



Incidentally, there’s a great patch from Gregory Taylor somewhere on the forum with a catalogue of waveform shapes built in gen, if you have that add-on. Might be of interest?

Nov 18 2013 | 2:47 pm

it seems to be easier to do *~ 0.5 when the range really is a problem. which it shouldnt be as long as we are inside the actual synth patcher.

not crossfading linear – and the use of interpolation – is a given. ;)

Nov 19 2013 | 1:43 am

See also here:

Note that the 2d.wave~ patch that I posted (not mine) will alias at higher frequencies so you wont be able to do fun things like FM with it, so implementing a decent cross-fade is probably a better solution (it’s just not as much fun ;-)

Axiom-crux’s kink~ solution is pretty neat too, but again, you’ll need to put it in an up-sampled poly~ to reduce aliasing,

Nov 19 2013 | 7:37 am

Instead of clip~ with cycle~ to make a square wave, use tanh~. It will generate odd partials but can be band limited. There’s a CMJ article (Lazzarini, IIRC, is one of the authors) on distortion synthesis that presents a simple formula for calculating the multiplier. It works well.

Also, if you go the cross-fade route, you’ll notice that there’s a difference in average volume between cycle~ and rect~.

Viewing 10 posts - 1 through 10 (of 10 total)

Forums > MaxMSP