ae00d40ccb0d3ee7fb29bf155890b327c59e6a67
[Faustine.git] / interpretor / faust-0.9.47mr3 / documentation / faust-quick-reference-src / images / noise.dsp
1 declare name "Noise";
2 declare version "1.1";
3 declare author "Grame";
4 declare license "BSD";
5 declare copyright "(c)GRAME 2009";
6
7
8 //-----------------------------------------------------------------
9 // Noise generator and demo file for the Faust math documentation
10 //-----------------------------------------------------------------
11
12
13 <mdoc>
14 \section{Presentation of the "noise.dsp" Faust program}
15 This program describes a white noise generator with an interactive volume, using a random function.
16
17 \subsection{The random function}
18 The \texttt{random} function describes a generator of random numbers, which equation follows. You should notice hereby the use of an integer arithmetic on 32 bits, relying on integer wrapping for big numbers.
19 <equation>random</equation>
20
21 \subsection{The noise function}
22 The white noise then corresponds to:
23 <equation>noise</equation>
24 </mdoc>
25
26 random = +(12345)~*(1103515245);
27 noise = random/2147483647.0;
28
29 <mdoc>
30 \subsection{Just add a user interface element to play volume!}
31 Endly, the sound level of this program is controlled by a user slider, which gives the following equation:
32 <equation>process</equation>
33 </mdoc>
34
35 <mdoc>
36 \section{Block-diagram schema of process}
37 This process is illustrated on figure 1.
38 <diagram>process</diagram>
39 </mdoc>
40
41 process = noise * vslider("Volume[style:knob]", 0, 0, 1, 0.1);
42
43 <mdoc>
44 \section{Notice of this documentation}
45 You might be careful of certain information and naming conventions used in this documentation:
46 <notice>
47
48 \section{Listing of the input code}
49 The following listing shows the input Faust code, parsed to compile this mathematical documentation.
50 <listing>
51 </mdoc>