sclang: ServerShmInterface - try to avoid multiple destructor calls
[supercollider.git] / HelpSource / Classes / Ramp.schelp
blobb7fdc07a03b285a330ec22440751098f18c23c60
1 class:: Ramp
2 summary:: Break a continuous signal into line segments
3 related:: Classes/Lag, Classes/VarLag, Classes/Slew
4 categories::  UGens>Filters>Linear
7 Description::
9 Break a continuous signal into linearly interpolated segments with specific durations.
11 Feeding Ramp with noise is similar to link::Classes/LFNoise1::
12 code::
13 Ramp.kr(WhiteNoise.kr(1),0.5)
15 is equal to:
16 code::
17 LFNoise1.kr(1 / 0.5)
20 For smoothing out control signals, take a look at link::Classes/Lag:: and link::Classes/VarLag::
22 classmethods::
24 method::ar, kr
26 argument::in
28 The input signal.
31 argument::lagTime
33 segment duration in seconds.
36 argument::mul
38 Output will be multiplied by this value.
41 argument::add
43 This value will be added to the output.
46 Examples::
48 code::
49 Server.internal.boot;
51 // used to lag pitch
53         SinOsc.ar(              // sine wave
54                 Ramp.kr(                        // lag the modulator
55                         LFPulse.kr(4, 0, 0.5, 50, 400), // frequency modulator
56                         Line.kr(0, 1, 15)                               // modulate lag time
57                 ),
58                 0,      // phase
59                 0.3     // sine amplitude
60         )
61 }.scope;
64 // Compare
66 var pulse;
68         pulse = LFPulse.kr(8.772);
69         Out.kr(0,[Ramp.kr(pulse, 0.025), Lag.kr(pulse, 0.025), pulse]);
70 }.play(Server.internal);
71 Server.internal.scope(3, bufsize: 44100, rate: \control, zoom: 40);