so ask yourself a couple of questions:
1. is the musical sound i am synthesizing a "note" or a "tone"? (having "pitch" 
as a tangible property?)
2. is this note or tone bandlimited? �(if the answer is "no", then your hearing 
quite amazing.)
3. does this note or tone have non-harmonic partials (like a bell or tubular 
bells or a tympani or a tom)?
if the note consists of overtones or partials that are only harmonic or nearly 
harmonic (that is the harmonics have frequencies that are an an integer
multiple of fundamental with at most only slight detuning that can be modeled 
as a phase change), and if the number of harmonics is finite (which is what 
"bandlimited" is about), then wavetable synthesis can (and does) capture that 
waveform to a degree that is audibly or visually
indistinguishable from the original tone. �and the code operates exactly the 
same, independently of the waveform shape (sine, saw, square, even PWM, 
saw-sync, square-sync, or the evolving piano strike).
if memory is cheap (like a general purpose CPU), the "active" wavetables can
be quite large in memory, like 2048 or 4096 samples per wavetable. �with the 
finite number of harmonics kept low (like < 64), then the waveform is grossly 
oversampled and linear interpolation between samples is fine. �keeps the code 
notes or tones morph from one to another
by use of crossfading of synchronous waveforms. �a simple example is with a 
sawtooth (or something rich in harmonics) going up higher in the keyboard, one 
would crossfade from a sawtooth with more harmonics to another saw with fewer 
harmonics. �but the two wavetables are exactly the same
size and all of the harmonics that the higher-pitched saw shares with the 
lower-pitched saw are exactly the same amplitude and same phase. �this means 
that the result of crossfading is that the higher harmonics (that don't exist 
for the higher pitch because the might alias) are fading to zero.
and once the crossfade to the second wavetable is complete, one can begin 
crossfading to another wavetable for even higher pitches.
i have determined that, if your sample rate is at least 48 kHz and you don't 
mind a brickwall filter at 19.88 kHz (so any harmonics above 19.88 kHz can be
ignored, whether they fold over or not), you can get away with two wavetables 
per octave for the entire range of the keyboard. �(the math isn't particularly 
hard.) 5 octaves means 11 wavetables for that particular bandlimited waveform.
for each "dimension" of parameter that can
morph or vary (like look at page 91 of 
 ), you need to be able to crossfade to wavetables along that dimension. �for 
each independent dimension added, that doubles the computational cost of 
synthesis. �i
haven't coded more than 3 dimensions for that reason (and i have separate, less 
costly, code for interpolating in 2 dimensions or 1 dimension). �memory costs 
can add up. �consider 3 dimensions and, say, 4 wavetable "points" along each 
axis. �that means 4^3 = 64 wavetables.
�say they are 2048 samples per wavetable and your samples are 4-byte floats. 
�that's 1/2 meg of memory for that instrument (with 3 degrees of freedom to 
you can even detune harmonics slightly from their exact harmonic value by 
crossfading to waveforms with those harmonics
shifted in phase. �changing phase means a frequency shift. �but you cannot have 
wildly inharmonic overtones with a single wavetable oscillator. �you might be 
able to group non-harmonic overtones into harmonic groups and use a separate 
wavetable oscillator for each group. �this is
called "Group Additive Synthesis".
with wavetable synthesis you're not writing special code to deal with 
particular glitches or discontinuities. �it doesn't matter what the waveshape 
is or the tone timbre is as long as the 3 criteria above are met.
waveforms can be stored
or archived (say in flash) with fewer samples per wavetable as long as they are 
properly interpolated and expanded when they are loaded and made "active" (like 
at program change time). �for storing a wavetable the number of samples must 
exceed twice the highest harmonic number to make
Nyquist happy.
i offered this before (and also on Stack Exchange), but send me a note and i 
will send to anyone a very simple C file that demonstrates how simply and 
cheaply the synthesis can be done. �(it assumes you already have defined your 
again, **any** note that
has less than an infinite number of overtones, and with all overtones at very 
nearly their harmonic frequency, that note can be synthesized precisely with 
wavetable synthesis. �and the synth code doesn't give a rat's ass what the 
particular waveform is. �nothing is different in the code
whether it's a saw or a square or PWM or hard-sync or a toot from a trumpet or 
a plucked string. �and with enough wavetables per octave (and a decent sample 
rate), aliasing is no problem whatsoever. �and you need not do anything special 
to your code to deal with the nasty discontinuities.
�no real-time FFTs, no post-synthesis DSP needed on a per note basis (like the 
mu-tron sound), no special anything required. �but, especially for a good 
hard-sync library of waveforms, the number of wavetables (and the memory 
requirements) may be very large.
---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] Bandlimited morphable waveform generation

From: "Andrew Simper" <a...@cytomic.com>

Date: Wed, September 21, 2016 10:58 pm

To: "A discussion list for music-related DSP" <music-dsp@music.columbia.edu>



> Don't use wavetables!


> As you have constructed your desired waveform as a continuous function

> all you have to do is work out where any discontinuities in C(n) occur

> and you can band limit those use corrective grains for each C(n)

> discontinuity at fractions of a sample where the discontinuity occurs.

> Adding sync to this is trivial is you just do the same thing, in fact

> you can jump between any two points in your waveform or waveform shape

> instantly if you want to create even more interesting waveforms.


> For example a sawtooth is C(1) continuous all the time, it just has a

> jump in C(0) every now and again, so you just band limit those jumps

> with a C(0) corrective grain - which is an integrated sinc function to

> give you a bandlmited step, then subtract the trivial step from this,

> and add in this corrective grain at a fraction of a sample to

> re-construct your fraction of a sample band limited step.


> Similarly you can bandlimit C(1) and C(2) discontinuities, after that

> the amplitude of the discontinuities is so small that it rarely

> matters if you are running at 88.2 / 96 khz.


> Cheers,


> Andrew


> On 15 September 2016 at 23:49, Andr� Michelle <andre.miche...@gmail.com> 
> wrote:

>> Hi all,



>> many articles have been written about bandlimited waveform generation. But 
>> for various reasons I am not able to implement any solution to my 
>> synthesiser that are feasible. The synth allows blending smoothly between 
>> different shapes
(http://codepen.io/andremichelle/full/8341731a1ff2bdc90be3cb88e6509358/). It 
also provides phase modulation (by LFO), frequency gliding, hard sync and 
parameter automation. The following I already understand: Functions other than 
a sinus have overtones that may overlap the Nyquist-frequency
reflecting back into the audible spectrum. I tried the following to reduce the 
alias: Oversample (32x) and apply multiple BiQuad[4] filter (Cutoff at Nyquist 
or less), Oversample and down-sample with a Finite Impulse Response filter, use 
a Sync function window to be applied to each sample (sinc
Fc/Fs), apply a FFT and sum up sin(x) up to the Nyquist. All those technics 
seem to be either static (FFT) or very costly or are not perfectly reducing the 
alias. The synthesiser runs online inside your browser 
(https://www.audiotool.com/product/device/pulverisateur/). So CPU time is 
crucial. Most
articles are explaining how to create the usual suspects such as Sawtooth, 
Square and Triangle. The other articles are filled with complex math. I am not 
a complete dummy but most articles are really hard to follow and not pointing 
out the key ideas in plain english.

>> A simple question remains:

>> Is it possible to sample an arbitrary dynamic(changing over time) waveform 
>> function f(x) excluding frequencies over Nyquist?


>> Any suggestions are highly appreciated!


>> ~

>> Andr� Michelle

>> https://www.audiotool.com

>> _______________________________________________

>> dupswapdrop: music-dsp mailing list

>> music-dsp@music.columbia.edu

>> https://lists.columbia.edu/mailman/listinfo/music-dsp

> _______________________________________________

> dupswapdrop: music-dsp mailing list

> music-dsp@music.columbia.edu

> https://lists.columbia.edu/mailman/listinfo/music-dsp

r b-j � � � � � � � � �r...@audioimagination.com
"Imagination is more important than knowledge."
dupswapdrop: music-dsp mailing list

Reply via email to