[music-dsp] Bandlimited.pdf questions
Paul Chana
pav_101 at hotmail.com
Wed Nov 26 09:22:01 EST 2003
hi there,
I've been studying Joe Wright's paper "Synthesising band limited waveforms
using wavetables" (bandlimited.pdf on musicdsp.com),
and i have a couple of questions:
firstly, to generate the out out of phase sawtooth, can i simply change this
code:
for(b = 0; b < 4096; b++)
datap[b] += m * sinetable[(b * partial) % 4096];
to
for(b = 0; b < 4096; b++)
data[b] += m * sineTable[((b * partial) + PI) % 4096];
or have i oversimplified and missed something? Or does the offset get added
during interpolation? Can anyone show write some code to show me this????
Next to generate the square wave, i use the formula
sinx + 1/3sin3x + 1/5sin5x...
The way i was looking at the code, i would suggest that i can do
for(a = 0; a < partials; a++) // sum together the partials for this note.
{
// CHANGED THIS PART HERE from partial = a+ 1
partial = a + 3;
m = cos((float)a * HALFPI / (float)partials); //gibbs
m *= m; //gibbs
// reduce the level of the upper partials.
m /=( float)partial;
// here we are actually generating the wave table for this frequency
for(b = 0; b < 4096; b++)
datap[b] += m * sinetable[(b * partial) % 4096];
}
Third, just to clarify this, what is refered to in the code as a partial is
the same as the number of harmonics?
Little confused about this because the terminology changes, but i think
thats right?
Lastly, in the implementation at the end of paper, reference is made to two
variables :
slide and fm.
Neither of these is defined or commented.
rate*=slide; //slide coeffecient if required
temprate=rate*fm; //frequency modulation if required
My question is what sort of values i should be putting in to these? For
example does slide go from 0 - 1?
Thanks for the help
Paul
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger
More information about the music-dsp
mailing list