Csound Csound-dev Csound-tekno Search About

Re: rates

Date1997-12-18 11:57
Fromrasmus ekman
SubjectRe: rates
Mike Berry answered pete moss:
> 
> On Wed, 17 Dec 1997, pete moss wrote:
> 
> > i would also like to add that A and K rates usually seem to be assigned
> > variables that are series (or arrays). 
> >
> > pete
>
>         This is basically wrong. 

Yes. I think the talk of "variables that are series" perhaps springs
from reading the manual on this topic. It says "prefixes k or a denote 
control (scalar) and audio (vector) values..."
It should be added: "respectively" (this will actually become apparent 
from the list that follows, but it's still a sloppy formulation).

Now this is informative for programmers, but perhaps less so for others. 
Internally, Csound will work through its list of active orchestra 
instruments at K(ontrol) rate. At each such pass, audio (a-rate data) 
is generated, k-rate variables are updated (well, generated), the list 
of instruments is maintained, etc.
Audio rate data is generated in small blocks inside each instrument.
Eg inside an oscil, if sr=44100 and kr=4410, then 10 samples will be
generated at each k-rate pass, using the current values of k-rate
variables.
This block of audio data is called a vector, or array.
And if an opcode takes a-rate input, it will use the values from such a 
data block (vector), rather than one single value, to work out its own 
a-rate data.

Hope this could be of help to somebody.

	re

Date1997-12-18 19:36
From"Matt J. Ingalls"
SubjectRe: rates
> 
> Now this is informative for programmers, but perhaps less so for others. 
> Internally, Csound will work through its list of active orchestra 
> instruments at K(ontrol) rate. At each such pass, audio (a-rate data) 

i actually have been meaning to mention this to the list for the past
couple weeks -- but thanks for the post, rasmus.

this does relate to CSound users because sometimes you get weird
"stepping" errors that you wouldnt expect like this:

andx	init	0
aout	tablei	andx,ifunc ;i'm too lazy to look up proper syntax here
andx	=	andx + 1

this would only work if you set sr=kr  (which is not always a bad thing)
since the input to the "=" operator is copied and not changed for each
ksmps buffer lenght of samples.  (to fix substitute the "interp"
operator for the "=")...

-m