Csound Csound-dev Csound-tekno Search About

Buzz & C code

Date1998-04-19 13:53
FromJosep M Comajuncosas
SubjectBuzz & C code
This is a question a friend of mine sent to me the other day... he´s
trying to implement a bandlimited pulse generator (like buzz) in C but
allowing smooth transitions of the parameter controling the upper
frequency, without hearing pops when the harmonics appear...
Maybe anyone os you have a good idea...?
Tnx

Josep M Comajuncosas

The message is (please answer with a C.C. to the list... it could be
interesting)

I am coding a real time buzz generator (a.k.a. band limited impulse
train), that integrates the buzz signal to generate the
classical analog synth waveforms: sawtooth, square and triangular.

The thing is that when continuously modulating the fundamental
frequency, for example in a vibrato, the number of harmonics,
which has to be an integer, variates too. Then, when the Nth harmonic
appears, a clear click is heard. This is an unwanted
artifact that I have to eliminate. Which is the best solution?

I have tried the following thing without success: I calculate N-1
harmonics with the buzz formula, then I determine a weight
factor between 0 and 1 for the Nth harmonic, depending on how close it
is to the band limit. Then I add it manually:

out = out + weight*cos(N*2*PI*Freq*t)/N

This should work, shouldn't it? I'll try to check my code, but, is it a
good idea to do that? I can send my C++ source code if
you are interested in it.

Any help will be welcome. Does this artifact appear with CSound too?

Please answer to lcrespo@ergos.es.