scide: implement selectionLength for openDocument
[supercollider.git] / HelpSource / Classes / Formlet.schelp
blobfbf29b50efc402c2b278988781eb98cc1d0b7559
1 class:: Formlet
2 summary:: FOF-like filter.
3 related:: Classes/RHPF, Classes/RLPF, Classes/Resonz, Classes/Ringz
4 categories::  UGens>Filters>Linear
7 Description::
9 This is a resonant filter whose impulse response is like that of a sine
10 wave with a  link::Classes/Decay2::  envelope over it. It is possible to
11 control the attacktime and decaytime.
13 Formlet is equivalent to:
14 code::
15 Ringz(in, freq, decaytime) - Ringz(in, freq, attacktime)
18 The great advantage to this filter over FOF is that there is no limit to
19 the number of overlapping grains since the grain is just the impulse
20 response of the filter.
23 classmethods::
25 method::ar, kr
27 argument::in
28 The input signal.
30 argument::freq
31 Resonant frequency in Hertz.
33 argument::attacktime
34 60 dB attack time in seconds.
36 argument::decaytime
37 60 dB decay time in seconds.
39 argument::mul
41 argument::add
43 discussion::
44 Note that if attacktime == decaytime then the signal cancels out and if
45 attacktime > decaytime then the impulse response is inverted.
48 Examples::
50 code::
51 { Formlet.ar(Impulse.ar(20, 0.5), 1000, 0.01, 0.1) }.play;
53 { Formlet.ar(Blip.ar(XLine.kr(10,400,8), 1000, 0.1), 1000, 0.01, 0.1) }.play;
56 // modulating formant frequency
58         var in;
59         in = Blip.ar(SinOsc.kr(5,0,20,300), 1000, 0.1);
60         Formlet.ar(in, XLine.kr(1500,700,8), 0.005, 0.04);
61 }.play;
65 // mouse control of frequency and decay time.
67         var in;
68         in = Blip.ar(SinOsc.kr(5,0,20,300), 1000, 0.1);
69         Formlet.ar(in,
70                 MouseY.kr(700,2000,1),
71                 0.005, MouseX.kr(0.01,0.2,1));
72 }.play;
76 // mouse control of frequency and decay time.
78         var freq;
79         freq = Formlet.kr(
80                 Dust.kr(10 ! 2),
81                 MouseY.kr(7,200,1),
82                 0.005, MouseX.kr(0.1,2,1)
83         );
84         SinOsc.ar(freq * 200 + [500, 600] - 100) * 0.2
85 }.play;