[linux-audio-dev] Re: Csound rates

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Re: Csound rates
From: Paul Barton-Davis (pbd_AT_Op.Net)
Date: ke tammi  26 2000 - 08:39:59 EST


>Variables that start with "i" are updated at i-time;
>variables that start with "k" are updated with a frequency of kr;
>therefore variables that start with "a" are updated with a frequency
>of ...
>sr of course!
>This is not exactly consistent.

And in fact, its not actually correct, though its certainly how the
Csound community likes to talk.

The update rate of k and a variables in Csound is exactly the
same. However, the width of an a variable is wider than a k variable,
and so when the update takes place, more memory locations are modified
than when a k variable is updated.

Consider the following C code:
         
         int i;
         int a[10];
         int n;
         int m;

         for (n = 0; n < 100; n++) {
             i++;
             for (m = 0; m < 10; m++) {
                 a[m]++;
             }
         }

I don't think we would ever say in C that "a" is updated more
frequently than "i". The point is that its a different data type. If
the above code is run under the assumption that there is no way to
ever look at the contents of "a" while we go around the inner ("m")
loop, then the rate of change of "a" is identical to "i". This
assumption is true of Csound, its true of SAOL, its true of Quasimodo,
its true of every piece of software that works anything like any of
these programs.

This is why I am disappointed that SAOL, which has brilliantly
included the concept of "width" in its specification, has continued to
talk about "rate" as if it really mattered at the language level. It
doesn't.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:27 EST