scide: implement selectionLength for openDocument
[supercollider.git] / HelpSource / Classes / LinCongN.schelp
blob4d094dfdcd3e8bf4f494ba90d6f7e87287d8759b
1 class:: LinCongN
2 summary:: Linear congruential chaotic generator
3 categories:: UGens>Generators>Chaotic
4 related:: Classes/LinCongL, Classes/LinCongC
6 description::
7 A non-interpolating sound generator based on the difference equation:
9 code::
10         x[n+1] = (a * x[n] + c) % m
12 warning:: revise formulae converted to c like code ::
14 The output signal is automatically scaled to a range of [-1, 1].
16 classmethods::
17 method:: ar
18 argument:: freq
19 Iteration frequency in Hertz
20 argument:: a
21 Multiplier amount
22 argument:: c
23 Increment amount
24 argument:: m
25 Modulus amount
26 argument:: xi
27 Initial value of x
28 argument:: mul
29 argument:: add
31 examples::
32 code::
33 // default initial params
34 { LinCongN.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }.play(s);
37 code::
38 // randomly modulate params
40 { LinCongN.ar(
41         LFNoise2.kr(1, 1e4, 1e4),
42         LFNoise2.kr(0.1, 0.5, 1.4),
43         LFNoise2.kr(0.1, 0.1, 0.1),
44         LFNoise2.kr(0.1)
45 ) * 0.2 }.play(s);
49 code::
50 // as frequency control...
53 SinOsc.ar(
54         LinCongN.ar(
55                 40,
56                 LFNoise2.kr(0.1, 0.1, 1),
57                 LFNoise2.kr(0.1, 0.1, 0.1),
58                 LFNoise2.kr(0.1),
59                 0, 500, 600
60         )
61 ) * 0.4 }.play(s);