Csound Csound-dev Csound-tekno Search About

A-rate vs K-rate

Date2004-05-25 15:38
From"Stanislav Shevchenko"
SubjectA-rate vs K-rate
Hello everybody,

I'm experimenting with CSound in real-time, trying to achieve optimal performance for my instruments. And I can not decide what's the best setting for the control rate (kr).

Low values of kr (about 1/20 of sr) seem to be unacceptable; I can easily hear the clicks even when amplitude envelope is calculated at k-rate, and if k-rate is used to control the delay time in chorus/flanger, the clicks are even more audible.

But when kr approaches sr, using the a-rate variables becomes inefficient, because the k-rate opcodes tend to be simpler (k-rate variables are simple numbers, while a-rate variables are arrays, so there is a little overhead in every a-rate opcode). So when sr is equal to kr, the a-rate opcodes produce exactly the same output as k-rate, but a bit slower.

I come to a paradoxical decision: the fastest way is to set kr = sr, use k-rate opcodes as much as possible, and convert the results to a-rate only when it is inevitable (to use the "outs" opcode, for example).

Of course, there is an obvious alternative: set kr to be very low, and use a-rate opcodes for the parameters which are usually controlled at k-rate (amplitude, etc). However, there are opcodes that work ONLY at k-rate (like "peak"), so there might be some cases when clicks are inevitable.

So I'd like to know the opinion of community: what control rate is thought to be the best for real-time, and for what reasons.

Thanks in advance,
- Stanislav Shevchenko - 
_______________________________________________
csoundtekno mailing list
csoundtekno-N4abDuUB7xo@public.gmane.org

Subscribe, unsubscribe, change mailing list options: