Page 1 of 2
Morphing
Posted: Mon Nov 10, 2014 7:45 pm
by tulamide
My question might seem stupid at first, but I was really asking it myself after a few code sessions: What exactly is the difference between morphing and cross-mixing (the technique is different, yes, but that's not my concern)?
For example, I have two waveforms, a sine and a saw. I now morph between them over 1 second, so that at start it's a sine and after 1 second it is a saw.
Now instead I cross-mix both (e.g stream_a * 0.4 + stream_b * 0.6), again over 1 second, so that at start it's a sine and at the end it's a saw.
I don't hear any difference.
Thoughts?
Re: Morphing
Posted: Mon Nov 10, 2014 8:28 pm
by KG_is_back
In cross-mixing means that the wave=x*wave1+(1-x)*wave2;
Morphing means changing shape from wave1 to wave2 but not necessarily by mixing the two waves - morphing is wider term.
Image below shows mixing product 50/50 of the waves and a morphing product calculates as beginning and end of waveform= square and middle = saw. This is just one way to morph between waves.
Re: Morphing
Posted: Mon Nov 10, 2014 9:07 pm
by tester
Usually, morphing means that spectra shifts (and splits) smoothly from initial positions to final positions, while mixing means that spectral content just goes up or down.
Another approach is to imitate (sonically) one sound with another one in between. Like boiling water that transforms into speech. In between the speech would be made of boiling expression (so to speak) or vice versa.
Re: Morphing
Posted: Tue Nov 11, 2014 12:54 am
by Xtinct
Sometimes cross-mixing and morphing can sound almost identical, but cross-mixing a pulse with a square wave will never sound like PWM, one of my favourites is the sine/saw osc where the duty cycle is changed and the first half of the sine becomes shorter and the second longer until it becomes a saw (or near as damn it), this when modulated with the right envelope gives a very realistic brass sound with no need for filters. I'm not sure how your morphing your sine/saw but done this way sounds nothing like cross-mixing.
Re: Morphing
Posted: Tue Nov 11, 2014 5:58 am
by tulamide
Guys, thank you very much! I now see my fallacy. There's of course a difference between time domain and frequency domain, which I totally ignored.
KG_is_back wrote:In cross-mixing means that the wave=x*wave1+(1-x)*wave2;
Yes, the math is also known as "linear interpolation"
KG_is_back wrote:Morphing means changing shape from wave1 to wave2 but not necessarily by mixing the two waves - morphing is wider term.
Image below shows mixing product 50/50 of the waves and a morphing product calculates as beginning and end of waveform= square and middle = saw. This is just one way to morph between waves.
That was very helpful! I'm a visual guy. Thanks

tester wrote:Usually, morphing means that spectra shifts (and splits) smoothly from initial positions to final positions, while mixing means that spectral content just goes up or down.
Another approach is to imitate (sonically) one sound with another one in between. Like boiling water that transforms into speech. In between the speech would be made of boiling expression (so to speak) or vice versa.
And that made it perfectly clear. Here we have no time domain, but the data of the waveform itself is transformed. Of course that can't be realized by mixing. Thank you!
Xtinct wrote:Sometimes cross-mixing and morphing can sound almost identical, but cross-mixing a pulse with a square wave will never sound like PWM, one of my favourites is the sine/saw osc where the duty cycle is changed and the first half of the sine becomes shorter and the second longer until it becomes a saw (or near as damn it), this when modulated with the right envelope gives a very realistic brass sound with no need for filters. I'm not sure how your morphing your sine/saw but done this way sounds nothing like cross-mixing.
You're right. I made tables of pre-calculated waveforms that changed linear from sine to saw. Or in other words: I now know that I just mimicked a mixing. Pretty useless
I think I understood. Hopefully...

Re: Morphing
Posted: Tue Nov 11, 2014 12:15 pm
by Xtinct
Here's an osc that goes from ramp to tri to saw
Code: Select all
streamin freq; // 0 to 1
streamin trisaw; // Ramp = -1 Tri = 0 Saw = 1
streamout out;
float dutyC;
float phase;
dutyC = (trisaw*-1+1)*0.5;
phase = phase + (freq*0.5);
phase = phase - (phase >= 1 & 1);
out = 2*((phase<=dutyC)&(phase/dutyC)+(phase>dutyC)&(1-(phase-dutyC)/(1-dutyC)))-1;
And a visual

- Saw Tri Ramp.gif (95.2 KiB) Viewed 37572 times
It aliases like hell but makes for an interesting LFO.
Re: Morphing
Posted: Tue Nov 11, 2014 2:53 pm
by Xtinct
And another one where the sine phase modulates itself
Code: Select all
streamin frequency; //0 to 1
streamin shape; //0 to 1
streamout out;
float a,b;
a = a + frequency;
a = a - (a > 1) & 2;
b = (shape*0.18)*out;
out = sin1(a+b);

- Sine Saw.gif (28.95 KiB) Viewed 37563 times
Re: Morphing
Posted: Tue Nov 11, 2014 5:54 pm
by tulamide
Nice! I will play around with this and anything I can come up with

Re: Morphing
Posted: Wed Nov 12, 2014 7:55 am
by Perfect Human Interface
Morphing could be literally any path to transition gradually between two things. The things posted here so far are examples, but not all that might encompass "morphing." I like to think of it in terms of a synthesizer plugin that has automatable knobs. If you want to "morph" between two presets, you might automate the knobs to transition from one setting to the next. Any or all of those smoothly transitioning parameters could be considered elements of "morphing."
The issue of course when it comes to specifically synth plugins, as well as with other things, is that often not all parameters can smoothly transition between settings. Or maybe you can smoothly transition between things but not in a way that gives the effect you may be after (such as with cross-fading or mixing). Because "morphing" is a broad term, there's a broad space for interpretation and just finding ways to create transitions that may be useful or sonically pleasing. It's like asking the question "how do you turn a circle into a square?" There's no single answer, and perhaps endless possible answers.
Edit: as an extension of what I just said, another element to the tricky space of "morphing" is that you need to define some sort of abstract "pivot points" to create transitions. With the synth example above, there are physical knobs already defined and easy to understand. But if for example you want to "morph" between two incoming (unrelated and perhaps entirely different) audio streams as an effect, the concept becomes trickier. The one surefire method in this case is again the cross-fading, but that can be boring. If you want to create an effect that's more interesting, you don't have any "pivot points" to work with, so you'd have to define some yourself. This would likely involve some kind of interpretation of the input audio, and you can see how quickly this becomes complicated, especially if you want to end up with something that sounds good or useful. Much more simple is going back to the root of synthesis and geometrically transforming the shapes of oscillator cycles like others have demonstrated in previous posts.
Re: Morphing
Posted: Wed Nov 12, 2014 11:05 am
by martinvicanek
An example of morphing as opposed to cross-fading is the gradual transition between different vowels, as in
this thread.