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>
<HR></CENTER>
<H2>
rand, randh, randi</H2>
<PRE> kr <B>rand</B> xamp[, iseed]
kr <B>randh</B> kamp, kcps[, iseed]
kr <B>randi</B> kamp, kcps[, iseed]
ar <B>rand</B> xamp[, iseed]
ar <B>randh</B> xamp, xcps[, iseed]
ar <B>randi</B> 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> i1 <B>=</B> octpch(p5) ; center pitch, to be modified
k1 <B>randh</B> 1,10 ;10 time/sec by random displacements up to 1 octave
a1 <B>oscil</B> 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>
<HR></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|