File: rand.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 (68 lines) | stat: -rw-r--r-- 3,129 bytes parent folder | download | duplicates (6)
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
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
   <TITLE>RAND</TITLE>
</HEAD>
<BODY>

<CENTER><A NAME="rand"></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="SIG_GENS.html#">Top of this section</A></B> - <A HREF="fmtbell.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="xnoise.html">Next</A>&nbsp;
<HR></CENTER>

<H2>
rand, randh, randi</H2>

<PRE>&nbsp;&nbsp;&nbsp;&nbsp; kr&nbsp;&nbsp; <B>rand</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xamp[, iseed]
&nbsp;&nbsp;&nbsp;&nbsp; kr&nbsp;&nbsp; <B>randh</B>&nbsp;&nbsp;&nbsp;&nbsp; kamp, kcps[, iseed]
&nbsp;&nbsp;&nbsp;&nbsp; kr&nbsp;&nbsp; <B>randi</B>&nbsp;&nbsp;&nbsp;&nbsp; kamp, kcps[, iseed]
&nbsp;&nbsp;&nbsp;&nbsp; ar&nbsp;&nbsp; <B>rand</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xamp[, iseed]
&nbsp;&nbsp;&nbsp;&nbsp; ar&nbsp;&nbsp; <B>randh</B>&nbsp;&nbsp;&nbsp;&nbsp; xamp, xcps[, iseed]
&nbsp;&nbsp;&nbsp;&nbsp; ar&nbsp;&nbsp; <B>randi</B>&nbsp;&nbsp;&nbsp;&nbsp; xamp, xcps[, iseed]</PRE>

<HR>
<H4>
<U>DESCRIPTION</U></H4>
Output is a controlled random number series between <I>+amp</I> and <I>-amp</I>
<H4>
<U>INITIALIZATION</U></H4>
<I>iseed</I> (optional) - seed value for the recursive psuedo-random formula.
A value between 0 and +1 will produce an initial output of <I>kamp * iseed</I>A
negative value will cause seed re-initialization to be skipped. The default
seed value is .5.
<H4>
<U>PERFORMANCE</U></H4>
The internal psuedo-random formula produces values which are uniformly
distributed over the range <I>kamp</I> to <I>-kamp</I>. <B>rand</B> will
thus generate uniform white noise with an R.M.S value of <I>kamp / root
2</I>.

<P>The remaining units produce band-limited noise: the cps parameters permit
the user to specify that new random numbers are to be generated at a rate
less than the sampling or control frequencies. <B>randh</B> will hold each
new number for the period of the specified cycle; <B>randi</B> will produce
straightline interpolation between each new number and the next.
<H4>
<U>EXAMPLE:</U></H4>

<PRE>&nbsp;&nbsp; i1&nbsp;&nbsp; <B>=</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; octpch(p5) ; center pitch, to be modified
&nbsp;&nbsp; k1&nbsp;&nbsp; <B>randh</B>&nbsp; 1,10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;10 time/sec by random displacements up to 1 octave
&nbsp;&nbsp; a1&nbsp;&nbsp; <B>oscil</B>&nbsp; 5000, cpsoct(i1+k1), 1</PRE>

<CENTER><P>
<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="SIG_GENS.html#">Top of this section</A></B> - <A HREF="fmtbell.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="xnoise.html">Next</A>&nbsp;
<HR></CENTER>


<P><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>&nbsp;
</CENTER>
</HTML>