Is wavetable interpolation different from crossfading

Post your patches here! Put the format(s) in the subject.

Moderators: Kent, Joe., luketeaford, lisa

Post Reply
User avatar
ipassenger
Veteran Wiggler
Posts: 726
Joined: Fri Jun 10, 2011 3:19 am

Is wavetable interpolation different from crossfading

Post by ipassenger » Mon Nov 09, 2020 2:33 pm

Hi All,

I am puzzled by something, is the interpolation of a waveform from one point in a wavetable to another (assuming the two waves are adjacent) any different from a cross fade between those two waves (assuming they are in sync/generated by the same osc etc)?

If so, how?

I have imagined that the difference between each sample in single cycle a and b are compared and averaged based on the position of the interpolation between the two waves but that also sounds like the effect of crossfading.

Cheers

User avatar
starthief
Super Deluxe Wiggler
Posts: 4816
Joined: Tue Oct 04, 2016 10:39 am
Location: St Louis, MO
Contact:

Re: Is wavetable interpolation different from crossfading

Post by starthief » Mon Nov 09, 2020 7:27 pm

Interpolating between cycles is probably linear on most hardware. Just like crossfading.

Xfer Serum's wavetable editor has a few different methods to interpolate between two cycles in a bank, generating more cycles between them, but that's not real-time stuff.

Phase interpolation between samples in a cycle might be a spline (based on more than two points) or some other technique and not just linear.

User avatar
Navs
Super Deluxe Wiggler
Posts: 4230
Joined: Fri Sep 18, 2009 3:49 am
Location: Berlin, Germany

Re: Is wavetable interpolation different from crossfading

Post by Navs » Tue Nov 10, 2020 2:29 am

Yes, I think it depends, is different from synth to synth.

The PPG and early Microwaves just scan from wave to wave so any 'morphing' has to be done beforehand:

https://www.gearslutz.com/board/electro ... ycles.html

https://www.soundonsound.com/techniques ... ave-synths

The SOS article and iirc Serum manual go into 'spectral' morphing, but as starthief writes, the 'joining of the dots' is done beforehand or, e.g. on the Microwave, as the WT is loaded.

That said, I'd be interested to read how it's done on the Synth Tech or Harvestman modules, where the synth can't 'prepare' in advance.

User avatar
ipassenger
Veteran Wiggler
Posts: 726
Joined: Fri Jun 10, 2011 3:19 am

Re: Is wavetable interpolation different from crossfading

Post by ipassenger » Tue Nov 10, 2020 4:23 am

Great stuff, thanks and yeah would be good to hear about the tech on those modules, I have the E370 and it definitely has steps between adjacent waves.

Reason I ask; I have been having a go at writing a python script that takes all the sample values between of a single cycle wave and all of the sample values of another, and then produces X number of new waves as points in between, basically via liner interpolation of the sample values, averaging the difference of the samples and then splitting that up into X steps. All done non realtime, I have only really just started experimenting. It then occurred to me that this must be effectively the same as a cross fade if done in real time but had a sneaking suspicion I was missing something.

I appreciate there are tools out there that can do this for me, have thought many times to buy serum pretty much just for its awesome wavetable creation and editing tools but thought I should have a go at coding something. I found an offline cmd prompt routine too that does a good job with two single cycle waves.

User avatar
ipassenger
Veteran Wiggler
Posts: 726
Joined: Fri Jun 10, 2011 3:19 am

Re: Is wavetable interpolation different from crossfading

Post by ipassenger » Tue Nov 10, 2020 4:27 am

starthief wrote:
Mon Nov 09, 2020 7:27 pm
Phase interpolation between samples in a cycle might be a spline (based on more than two points) or some other technique and not just linear.
Any idea on what the maths of that might look like? Do you mean several points are considered ahead of the averaging kind of thing?

User avatar
starthief
Super Deluxe Wiggler
Posts: 4816
Joined: Tue Oct 04, 2016 10:39 am
Location: St Louis, MO
Contact:

Re: Is wavetable interpolation different from crossfading

Post by starthief » Tue Nov 10, 2020 4:55 am

This page and the next look like a good intro: https://codeplea.com/simple-interpolation

When I was a game developer I used Catmull-Rom a lot for things like animation smoothing from a limited number of path points.

I suspect something similar is used for "true peak" digital limiters. Just a tiny bit of lookahead should be enough.

User avatar
ipassenger
Veteran Wiggler
Posts: 726
Joined: Fri Jun 10, 2011 3:19 am

Re: Is wavetable interpolation different from crossfading

Post by ipassenger » Tue Nov 10, 2020 5:10 am

So it's just smoothing the the transition at the end points, to prevent larger steps at them? Sorry, the maths is at the edge my skills!

User avatar
fac
wig MUffler
Posts: 3653
Joined: Wed Aug 04, 2010 11:33 am
Location: Mexico

Re: Is wavetable interpolation different from crossfading

Post by fac » Tue Nov 10, 2020 9:20 am

AFAIK, the main difference between "wavetable synths" like the Waldorfs and "crossfading synths" like the Wavestations/Wavestate lies not in the interpolation scheme, but on the idea than on a wavetable synth, the samples are always single-cycles of the same length, and therefore you are always interpolating between phase-locked samples, while in the wavestations both samples can be arbitrarily off-phase, and even of different lengths.

The interpolating scheme does have an effect on the "character" of the synth, though. Specifically, a "cheap" scheme such as no interpolation will produce more artifacts (aliasing) than a more expensive scheme like linear or spline interpolation.

There is some good info and math on Miller Puckette's book "The Theory and Technique of Electronic Music":

http://msp.ucsd.edu/techniques/latest/b ... ode26.html
Last edited by fac on Mon Nov 23, 2020 8:40 am, edited 1 time in total.

User avatar
fac
wig MUffler
Posts: 3653
Joined: Wed Aug 04, 2010 11:33 am
Location: Mexico

Re: Is wavetable interpolation different from crossfading

Post by fac » Tue Nov 10, 2020 9:26 am

BTW.- I don't think they're using spline interpolation to interpolate between wavetables. I'm almost sure it should be linear. Because not only you have to interpolate between wavetables; you also have to interpolate between consecutive samples of the interpolated wavetable; so using spline interpolation would be computationally very expensive.

User avatar
starthief
Super Deluxe Wiggler
Posts: 4816
Joined: Tue Oct 04, 2016 10:39 am
Location: St Louis, MO
Contact:

Re: Is wavetable interpolation different from crossfading

Post by starthief » Tue Nov 10, 2020 9:54 am

ipassenger wrote:
Tue Nov 10, 2020 5:10 am
So it's just smoothing the the transition at the end points, to prevent larger steps at them? Sorry, the maths is at the edge my skills!
The math isn't that intuitive to me either, but the basic idea:

-- Linear interpolation takes a moving average between two points, and the result is a straight line.
-- A spline is like taking a moving average between two slopes (by using four points) and the result is a curve.

There's some code for Catmull-Rom in two dimensions here.

Simpler cubic Hermite spline for one-dimensional data (e.g. wavetables) at here. The simple C++ code example needs some fixes but the general gist of it is solid.

Again though, this would only be for phase interpolation. As in, the table has 64 samples per cycle, but the current phase accumulator (in terms of samples) is at 19.4839287173. It's unlikely this is used to interpolate between different cycles, because it's not as necessary or meaningful.

User avatar
ipassenger
Veteran Wiggler
Posts: 726
Joined: Fri Jun 10, 2011 3:19 am

Re: Is wavetable interpolation different from crossfading

Post by ipassenger » Tue Nov 10, 2020 11:06 am

Got ya. Its more the playback engine smoothing than the interpolation of discrete steps between wavetable steps.

Xomrys
Common Wiggler
Posts: 104
Joined: Wed Feb 26, 2020 12:54 am

Re: Is wavetable interpolation different from crossfading

Post by Xomrys » Fri Nov 13, 2020 9:52 pm

Linear should work if there's a guarantee all waveforms will be exactly in phase. This should be the case with wavetable, but the waves also need to be stored that way.

But if out of phase -- then a 50/50 mix will have a decreased amplitude. If the phases are in random relationships then the amplitude will generally be 1/sqrt(2) of what you want it to be. Which is why you need "equal power crossfade", with '71/71' at the center position. The Serge UAP and related modules implement this.

As for the Wavestation, if parts of the wavesequence are coming in at arbitrary points, you definitely want the equal power crossfade. But here also, the waves usually have different amplitudes or loudnesses anyway which makes the problem moot....

Unfortunately, the issue of spline interpolation is separate, and it seems helpful only in the context of audio rate modulations, a slow or envelope-driven fade should sound just fine with linear crossfade.

User avatar
3hands
Super Deluxe Wiggler
Posts: 1635
Joined: Mon Nov 19, 2018 6:36 pm
Location: Ottawa Ontario

Re: Is wavetable interpolation different from crossfading

Post by 3hands » Sun Nov 22, 2020 12:06 pm

What an absolutely fascinating thread.
Gum is fun, but not on a cat.

My minds an art gallery.

Post Reply

Return to “Synthesis Techniques”