Waveform tables
-
- KVRAF
- Topic Starter
- 3404 posts since 15 Sep, 2002
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.
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.
-
Christian Schüler Christian Schüler https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=48996
- KVRist
- 266 posts since 23 Nov, 2004 from Hamburg, Germany
Um, switching tables IS bad because it will click and pop, since table001[x] != table002[x].
-
- KVRAF
- Topic Starter
- 3404 posts since 15 Sep, 2002
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.
-
- KVRian
- 1153 posts since 10 Dec, 2003
Not necessarily. If..Christian Schüler wrote:Um, switching tables IS bad because it will click and pop, since table001[x] != table002[x].
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
-
- KVRian
- 1153 posts since 10 Dec, 2003
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
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
-
- KVRian
- 1153 posts since 10 Dec, 2003
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.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.
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
-
- KVRAF
- Topic Starter
- 3404 posts since 15 Sep, 2002
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.
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.
-
- KVRAF
- Topic Starter
- 3404 posts since 15 Sep, 2002
>>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.
Right. I may as well leave in my crossfading code to handle arbitrarily long pitch bend or glides.
-
- KVRAF
- 2460 posts since 3 Oct, 2002 from SF CA USA NA Earth
-
Alex@ProgressAudio Alex@ProgressAudio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=58042
- KVRist
- 338 posts since 15 Feb, 2005 from London, UK
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)
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)
-
- KVRAF
- Topic Starter
- 3404 posts since 15 Sep, 2002
That sounds good to me.
- KVRian
- 513 posts since 6 Jul, 2005 from Berlin
I heard it very easily, even at lower volumes.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
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!
-
Christian Schüler Christian Schüler https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=48996
- KVRist
- 266 posts since 23 Nov, 2004 from Hamburg, Germany
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.
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.
-
- KVRAF
- Topic Starter
- 3404 posts since 15 Sep, 2002
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.
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.

