## Morphing between waveforms...

Mar 03 2009 | 2:20 am
HI list,
I am looking for a system to make interpolations between waveforms.
I want avoid too use a switch but find a way to morph progressively a square to a sawtooth for example. Like some analogic oscillators do .
Someone could help me??
Max

• Mar 03 2009 | 2:41 am
Was trying to figure something like this out myself a few weeks ago. Tips from those who know, please!
• Mar 03 2009 | 3:01 am
if you have one wave~ object with a sine wave and one wave~ object with a square wave, drive them from the same phasor~ and then crossfade between the outputs. if they're on the same phasor the output will be synced and the result will be a "morph" between the two waveforms. it is totally not cheating! you can check it with the scope~ object.
(equally you could use a cycle~ object and rect~ object and drive their phase inlet with the same phasor~. but wave~ lets you use any waveform...)
• Mar 03 2009 | 4:20 am
maxd wrote on Mon, 02 March 2009 20:20HI list,
I am looking for a system to make interpolations between waveforms.
I want avoid too use a switch but find a way to morph progressively a square to a sawtooth for example. Like some analogic oscillators do .
The phasor method will work well and be very simple to implement, plus using all kinds of waveforms are possible. With a bit more work you can combine multislider and peek~, whereby you draw in the multislider and its list value (512 samples, say) gets stored in the buffer~ for playback. With some math you can fill the multislider with sine, sawtooth, etc., or simply draw whatever waves you want. Then use [pattr] on the multislider at your interpolation endpoints, and use a [line] to move smoothly between them. It also looks very cool
The drawback is that this is considerably more processing. It still is fairly smooth but the phasor~ route will take a much smaller hit. However you'll have a GUI for absolutely any waveform you want, plus you can load wave samples into the multislider using peek~ (reading from it instead of writing to it), save those in your pattr, then morph between them (snare hit to violin, speaking "ahh" to "ooh", etc...) You can reduce the processor hit by hiding the multislider, or much more so, speedlimiting how often its list goes out and is written to the buffer~ using peek~. Of course then you'll get "steps" in your interpolation that will be more noticeable than a smooth crossfade with the phasor~.
• Mar 03 2009 | 4:41 am
Simple crossfading does work great, as long as the relative phases of the waveforms are correct. This can be a little tricky to get right with rect~ and saw~ because one can't rely on them to start up with consistent phases relative to cycle~. Sending sync from another cycle~ offset in phase, as in this patch, makes it work consistently.
Fading between arbitrary waveforms indexed with a phasor~ can work, but you will have to oversample the **** out of it unless you don't mind aliasing.
-Randy
• Mar 03 2009 | 8:35 am
With 2d.wave~ it is possible to morph between subsequent waveforms on audio rate in a clean way. Fill a buffer with subsequent cycles and have a look at the help file of 2d.wave.
_ johan
• Mar 03 2009 | 11:28 am
maxd wrote on Tue, 03 March 2009 03:20I am looking for a system to make interpolations between waveforms.
An alternative to 2d.waveform is the lp.frim~/lp.tim~ group of objects in Litter Power. They implement Larry Polansky's 'mutation' algorithms.
The objects are extremely powerful but not easy to use. To some extent they presume familiarity with the Mutation function in SoundHack (or any of the other implementations of mutation out there in the world). I've gotten great sounds out of the objects.
Lp.tim~ is part of the free Litter Starter Pack. For lp.frim~ (the big brother;-) people need to pony up for Litter Pro. As my mother always said, you get what you pay for.
• Mar 03 2009 | 1:33 pm
Thanks for all yours answers guys....
but Someone could send me the beginning of a patch or an exemple?? Because I use Max a lot but I never made synthesis and it's really complicated to understand your language.
Thanks a lot
Max
• Mar 03 2009 | 2:38 pm
[2d.wave~] is a powerful beast, but may be difficult to use for a beginner. Another option is to write both "source" waveforms in two jitter matrices, and to interpolate (for instance with jit.xfade) into a jit.buffer~, from which the sound is played back. If you have never made synthesis, you can start in Max/MSP, of course! MSP tutorial 3 seems linked to your question. Do you find it useful? Jean-François.
• Mar 03 2009 | 3:16 pm
Here's an example using 2dwave~ that someone posted to the list some time ago, cheers Roger
• Mar 03 2009 | 3:32 pm
Thanks a lot
but how I can to open this code in Max5 please??
• Mar 03 2009 | 4:29 pm
See "Sharing Patches With Others" in Max Help.
Quote:Thanks a lot
but how I can to open this code in Max5 please??
• Mar 03 2009 | 4:55 pm
I'm sorry but I don't see that in the documentation.
I know only the form
Max V2 etc... etc......
copy and use the fonction "new from clipboard"
but how I could open this?
thanks a lot
• Mar 03 2009 | 5:58 pm
can someone post it for max 4..still not m5 here.. thanks
• Mar 03 2009 | 8:41 pm
maxd wrote on Tue, 03 March 2009 10:55
This blows my mind a bit... O_o How... How does one go about learning how to do this? I mean, I'm pretty good with math and trig, and feel like I'm starting to get a good handle on at least the theory of synthesis... but this is just too cool. I'm sure most of you are going "no, this is actually quite passé" but it's new to me.
• Mar 04 2009 | 12:23 am
ok I understand now!
thanks a lot!
Max
• Mar 04 2009 | 12:31 am
hey maxd, you've answered your own question! select the whole code, from ---begin_max5_patcher--- to ---end_max5_patcher---, press copy, open max5 and do "new from clipboard". boom. if you only have max4 you can't use this code, but you said you have max5 so you should be fine.
• Mar 04 2009 | 12:34 am
ok thanks
I saw this!
thanks everybody for you help!
Have a good evening
M
• Mar 04 2009 | 5:25 am
seejayjames wrote on Mon, 02 March 2009 23:20 plus you can load wave samples into the multislider using peek~ (reading from it instead of writing to it), save those in your pattr, then morph between them (snare hit to violin, speaking "ahh" to "ooh", etc...)
what an idea! going to try this out...
• Mar 04 2009 | 8:34 pm
Here's the Max 4 version, cheers Roger
• Mar 05 2009 | 11:16 pm
thank you!
• Mar 07 2009 | 3:53 am
ericrobert wrote on Tue, 03 March 2009 13:41maxd wrote on Tue, 03 March 2009 10:55
This blows my mind a bit... O_o How... How does one go about learning how to do this? I mean, I'm pretty good with math and trig, and feel like I'm starting to get a good handle on at least the theory of synthesis... but this is just too cool. I'm sure most of you are going "no, this is actually quite passé" but it's new to me.
I think its just a matter of simple calculation of wavetables, I assume you checked out the p fill? Its all expr doing 1 512 space long wavetable per waveform, and then the 2d wave just basically crossfades between those.
I was never happy with that one simply because it sounds fine when you use it like this, but try FMing it, etc.. it gets kinda wanky.
I actually instegated the other thread that this is pulled from, and the solution that I was most impressed with was the one involving kink~, Ill find it and post it.
• Mar 07 2009 | 4:31 am
this one is pretty cool
• Mar 07 2009 | 4:52 am
heres another sortof interesting one. Also something I found pretty great was the ejies list interpolator (they have a demo with 3d list interpolation, you can figure out a way to use it with audio, it wont be audio rate but it will do cool stuff)
• Mar 16 2009 | 11:39 am
Peter Castine wrote on Tue, 03 March 2009 04:28maxd wrote on Tue, 03 March 2009 03:20I am looking for a system to make interpolations between waveforms.
Lp.tim~ is part of the free Litter Starter Pack. For lp.frim~ (the big brother;-) people need to pony up for Litter Pro.
Looking at the lp.frim~ help file would make me think it should work also within a pfft~, and the reason for creating "buzzy" sounds in the help patch is due to the lack of windowing? (The help file doesn't sound like somthing I'd call "mutation" between two sine waves...)
Just curious (never played too long with these objects as the term "great sounds" is heavily bound to personal taste...
Stefan