QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 

VALUE CONVERTERS

          int(x)         (init- or control-rate args only)
          frac(x)        (init- or control-rate args only)
          dbamp(x)       (init- or control-rate args only)
          i(x)           (control-rate args only)
          abs(x)         (no rate restriction)
          exp(x)         (no rate restriction)
          atan(x)        (no rate restriction)
          tanh(x)        (no rate restriction)
          log(x)         (no rate restriction)
          sqrt(x)        (no rate restriction)
          sin(x)         (no rate restriction)
          cos(x)         (no rate restriction)
          ampdb(x)       (no rate restriction)

DESCRIPTION

where the argument within the parentheses may be an expression.

Value converters perform arithmetic translation from units of one kind to units of another. The result can then be a term in a further expression.
 

int(x)      returns the integer part of x.
frac(x)     returns the fractional part of x.
dbamp(x)    returns the decibel equivalent of the raw amplitude x.
i(x)        returns an Init-type equivalent of the argument (k-rate)
abs(x)      returns the absolute value of x.
exp(x)      returns e raised to the xth power.
atan(x)     returns the arctangent of x
tanh(x)     returns the tangent of x
log(x)      returns the natural log of x (x positive only).

sqrt(x)     returns the square root of x (x non-negative).
sin(x)      returns the sine of x (x in radians).
cos(x)      returns the cosine of x (x in radians).
ampdb(x)    returns the amplitude equivalent of the decibel value x. Thus
                 60 db gives 1000,
                 66 db gives 2000,
                 72 db gives 4000,
                 78 db gives 8000,
                 84 db gives 16000 and
                 90 db gives 32000.

Note that for log, sqrt, and ftlen the argument value is restricted. Note also that ftlen will always return a power-of-2 value, i.e. the function table guard point (see F statement) is not included.


QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 
HTML Csound Manual - © Jean Piché & Peter J. Nix, 1994-97