Waveform tables

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Caco,

Thanks. I'll try it on a couple hosts.

nollock,

In that case, I'll just get rid of that particular interpolation. I love cutting code even more than I love writing it in the first place.

Post

Um, switching tables IS bad because it will click and pop, since table001[x] != table002[x].

Post

but this is why we use multidimentional interpolation

Post

Switch between them? Not sure I follow. Do you mean while pitch bending or something? I wasn't talking about switching between them, just whether I needed to ramp up the highest harmonic on the very highest midi notes.

Post

Christian Schüler wrote:Um, switching tables IS bad because it will click and pop, since table001[x] != table002[x].
Not necessarily. If..

1. The tables are spaced close enough so those harmonics comming in and out are high up in the inaudible range, above 18khz.

2. The phase of the harmonics are all zero so there is a zero crossing at the start of the wavetable. (You also have to be careful your interpolation doesn't offset the zero crossing)

3. You only switch tables at the zero crossing.

It's how I have it implemented and i honestly cant hear the switching. I've had it up really loud on my studio monitors.. and I cant hear it at all. Even with the tables spaced every 3 semitones.

I would actually be interested if anyone can hear the table switch in the middle of this wavefile. At least i'd know if my ears are as f**ked as mistertoasts ;-)

www.flak.clara.co.uk/waveSwitch.wav

The top 2 semitones drop out half way through.

cheers,

chris

Post

Just to add to this.

If you are really concerned about the harmonics switching in and out... You can always filter out the top 2 or 3khz where the switching occurs.

That was actually my original design.. until i tested it without the filtering and couldn't hear the switching at all.

chris

Post

mistertoast wrote:Switch between them? Not sure I follow. Do you mean while pitch bending or something? I wasn't talking about switching between them, just whether I needed to ramp up the highest harmonic on the very highest midi notes.
They mean during pitch bend or glide i think. Unless you do that any large glides can end up missing a chunk of harmonics or aliasing a lot.

If you ain't gonna have pitch bend or glide more than a couple of semitones i doubt there's any point xfading or switching.

chris

Post

Well, I sure as hell don't hear it. :->

I don't see why I'd filter out the top 2 or 3KHz when I'm the one deciding whether to stick the top harmonic in or not. :->

All I want to know is this: is it OK for the top harmonic to emerge fully-formed (100% normal strength) when it comes down below Nyquist. Unless someone can convince me it's not, I think it is.

Post

>>If you ain't gonna have pitch bend or glide more than a couple of semitones i doubt there's any point xfading or switching.

Right. I may as well leave in my crossfading code to handle arbitrarily long pitch bend or glides.

Post

mistertoast wrote:All I want to know is this: is it OK for the top harmonic to emerge fully-formed (100% normal strength) when it comes down below Nyquist. Unless someone can convince me it's not, I think it is.
It should be.
Image
Don't do it my way.

Post

I did the same as what nollock is describing.. changing the number of harmonics only when you're at the zero crossing.
So basically when I detect that I've reached the end of the table and need to wrap round, I also check the current pitch and select the appropriate wavetable with the right number of harmonics.
Sounds fine with a pitch bend or modulating pitch.
Of course if you just changed tables while somewhere in the middle of the table, then the extra harmonic could a jump in amplitude and therefore an audible click.
But at the beginning of the wavetable the amplitude is zero independent of the number of harmonics you have (assuming zero phase of course)

Post

That sounds good to me.

Post

nollock wrote:I would actually be interested if anyone can hear the table switch in the middle of this wavefile. At least i'd know if my ears are as f**ked as mistertoasts ;-)
www.flak.clara.co.uk/waveSwitch.wav
I heard it very easily, even at lower volumes.

FYI I'm listening on Alesis M1 Active MkII's.
I'm Kieran, aka dblue, aka illformed | illformed.com | Glitch 2 now available for Windows, Mac and Linux!

Post

You can hear the switch even in cheap headphones.

Here's why:
The worst thing to do is dropping off the highest harmonic at any point in time - it will cause a discontinuity, which has an infinite spectrum falling off at 6db/oct with the center at the harmonic in question (for instance 18kHz).

When switching the harmonics at a zero crossing this is simply a higher order discontinuity, for instance a C1-discontinuty (the wave slope will change instantly). This falls off at 12 dB/oct, but is still an infinite broad spectrum discontinuity.

Essentially a ring modulation of the highest harmonic with a step function. The spectrum of the step function is shifted to where the harmonic is.

A ramp or window function has a much narrower spectrum than a step function, so when multiplied with the harmonic, the harmonic will be broadened but not as much as with an instantaneous step.

Post

If people can hear it, it sounds like I SHOULD be gradually shrinking the top harmonic as it rises toward Nyquist. Damn dogs and teenagers hearing these high notes.

I cannot hear anything up near 22kHz. All my kids can, though. For testing, I'm going to shift this all down into a range I can hear.

Post Reply

Return to “DSP and Plugin Development”