Csound Csound-dev Csound-tekno Search About

Re: Higher numerical preciSion in Csound

Date1999-06-07 09:26
FromJosep M Comajuncosas
SubjectRe: Higher numerical preciSion in Csound
Thanks all the programmers for enlighting me in this topic. I enjoy seeing how passionate can be a
discussion beetween Csounders with a DSP, a programmers or a composers point of view.
When it comes to develop new DSP algorithms, I am rather devoted to Csound because I am used to it.
Using Matlab would be more powerful but my ultimate goal is to make some music of all that.
Anyway my ask for higher precision was not a matter of snobism but motivated for some real needs. It´s
not a question of how it sounds only ... sometimes it may even not work. Say exploring the sound
potential of a chaotic system by zooming. The more precision in the numbers the more zoom precision you
will get. Of course not only in this or that opcode, but in *all* the internal computations needed.
I use filter2 rather often. Some folks wanted to remove it because it was not immediately useful for
musicians (musicians only need lowpass resonant filters?). I mean, Csound is thought to be a serious
tool for timbral research, as well as a funny sot synth for realtime synthesis. I think higher precision
is enough reasonably necessary sometimes to be implemented in the canonical versions.
It is funny by the other hand to work with 16 bit floats (or they are 32 bit?). I remember writing a
compander which, taking advantage of that, could easily degrade a signal in interesting ways. Finaly I
got square waves ;-)

My suggestion would be to make high precision optional as a command flag. I also suggest an opcode to
truncate the precision to an arbitrary bit size, it must be quite easy.
Speed? you can always make quick tests with floats and the final rendering at 64bit floats.



Sean Costello wrote:

> What filter types? reson, 1st order, 2nd order? What sorts of coefficients are needed - calculated
> at i-time, k-time, or a-rate?

Specifically, I´m trying to implement a TIIR filter (truncater IIR) which involves the use of onepole
unstable filters to get growing exponentials. They are used by Smith to model flaring ends in wind
instruments. Those filters are extremely sensitive to the numerical precission of course. This is why I
started the topic.

> I wonder if higher numerical precision is absolutely essential for physical modelling.

No it is not of course. But it turns to be necessary for a number of specific computations. I developed
a doublereed model and I was quite dissapointed with the results in Csound, because as the reed closes
the dynamic system to be integrated must perform divisions by *very* small numbers and I though higher
precision could help things to sound (yes ... sound) better!

> the rounding off helped the unstable
> filter design to achieve a steady state.

We talked months ago about the artistic benefits of pseudorandom generators with a short cycle. This
seems to be a similar topic. But at least as an option high precission seems to me already necessary.

> P.S. You had mentioned buzz in your email; it is worth noting that the quadrature oscillator I
> describe could be used to implement buzz without using table lookup. I will actually try converting
> the relevant floats to double, just to see what happens.

Hey that sounds cool, keep on working on it!

--
Josep M Comajuncosas
C/ Circumval.lacio 75  08790 Gelida - Penedes
Catalunya - SPAIN
home phone : 93 7792243 / 00 34 3 7792243

Csound page at http://members.tripod.com/csound/