transitioning between waveforms

Nov 16, 2013 at 9:10am

transitioning between waveforms

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

#271383
Nov 16, 2013 at 10:45am

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

#271391
Nov 17, 2013 at 12:04pm

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

#271470
Nov 18, 2013 at 3:03am

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.

#271515
Nov 18, 2013 at 5:05am

What Peter said:

<code>

– Pasted Max Patch, click to expand. –

</code>

we use this a lot

#271525
Nov 18, 2013 at 6:10am

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.

#271530
Nov 18, 2013 at 1:40pm

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:

<code>

– Pasted Max Patch, click to expand. –

</code>

Brendan

ps
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?

#271610
Nov 18, 2013 at 2:47pm

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. ;)

#271621
Nov 19, 2013 at 1:43am

See also here: http://cycling74.com/forums/topic/morphing-between-waveforms/

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,
Cheers
Roger

#271643
Nov 19, 2013 at 7:37am

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~.

#271673

You must be logged in to reply to this topic.