File: value.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (95 lines) | stat: -rw-r--r-- 5,135 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
   <TITLE>VALUE_CONVERTERS</TITLE>
</HEAD>
<BODY>

<CENTER><A NAME="VALUE_CONVERTERS"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="CONVERTERS.html">Top of this section</A></B> - <A HREF="CONVERTERS.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="ipow.html">Next</A>&nbsp;
<HR></CENTER>

<H2>
VALUE CONVERTERS</H2>

<PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>int</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (init- or control-rate args only)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>frac</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (init- or control-rate args only)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>dbamp</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (init- or control-rate args only)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>i</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (control-rate args only)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>abs</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (no rate restriction)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>exp</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (no rate restriction)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>log</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (no rate restriction)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>sqrt</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (no rate restriction)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>sin</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (no rate restriction)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>cos</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (no rate restriction)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>ampdb</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (no rate restriction)</PRE>

<HR>
<H4>
<U>DESCRIPTION</U></H4>
where the argument within the parentheses may be an expression.

<P>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.&nbsp;<BR>
<BR>
<BR><TT><B>int</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns the integer
part of x.</TT>
<BR><TT><B>frac</B>(x)&nbsp;&nbsp;&nbsp;&nbsp; returns the fractional part
of x.<BR>
<B>dbamp</B>(x)&nbsp;&nbsp;&nbsp; returns the decibel equivalent of the
raw amplitude x.<BR>
<B>i</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns an Init-type
equivalent of the argument (k-rate)<BR>
<B>abs</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns the absolute value
of x.<BR>
<B>exp</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns e raised to the xth
power.</TT>
<BR><TT><B>log</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns the natural
log of x (x positive only).<BR>
<B>sqrt</B>(x)&nbsp;&nbsp;&nbsp;&nbsp; returns the square root of x (x
non-negative).<BR>
<B>sin</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns the sine of x (x in
radians).</TT>
<BR><TT><B>cos</B>(x)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns the cosine
of x (x in radians).</TT>
<BR><TT><B>ampdb</B>(x)&nbsp;&nbsp;&nbsp; returns the amplitude equivalent
of the decibel value x. Thus</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
60 db gives 1000,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
66 db gives 2000,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
72 db gives 4000,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
78 db gives 8000,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
84 db gives 16000 and</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
90 db gives 32000.</TT><BR>
<BR>

<P>Note that for <B>log, sqrt</B>, and <B>ftlen</B> the argument value
is restricted. Note also that <B>ftlen</B> will always return a power-of-2
value, i.e. the function table guard point (<A HREF="../NumScore/f-stat.html">see
F statement</A>) is not included.&nbsp;<BR>
<BR>
<CENTER></CENTER>

<CENTER>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="CONVERTERS.html">Top of this section</A></B> - <A HREF="CONVERTERS.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="ipow.html">Next</A>&nbsp;
<HR></CENTER>

<CENTER></CENTER>

<CENTER><B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B></CENTER>

</BODY>
</HTML>