scel: install files to site-lisp/SuperCollider
[supercollider.git] / HelpSource / Classes / Peak.schelp
blobc6dcc663a60f668b5de145a5ad1efdeb79b18647
1 class:: Peak
2 summary:: Track peak signal amplitude.
3 related:: Classes/PeakFollower
4 categories::  UGens>Analysis>Amplitude
7 Description::
9 Outputs the peak amplitude of the signal received at the input. When
10 a trigger occurs at the  code::reset::  input, the maximum
11 output value is reset to the current value.
14 Internally, the absolute value of the signal is used, to prevent
15 underreporting the peak value if there is a negative DC offset. To obtain
16 the minimum and maximum values of the signal as is, use the
17 link::Classes/RunningMin::  and  link::Classes/RunningMax::  UGens.
20 classmethods::
22 method::ar, kr
24 argument::trig
26 The input signal.
29 argument::reset
31 Trigger. Resets the output value to the current input value. A
32 trigger happens when the signal changes from non-positive to
33 positive.
36 Examples::
38 code::
42         SinOsc.ar(
43                         Peak.ar(Dust.ar(20), Impulse.ar(0.4)) * 500 + 200,
44                         0, 0.2
45         )
47 }.play;
50 // follow a sine lfo, reset rate controlled by mouse x
53         SinOsc.ar(
54                         Peak.kr(SinOsc.kr(0.2), Impulse.kr(MouseX.kr(0.01, 2, 1))) * 500 + 200,
55                         0, 0.2
56         )
58 }.play;