clean up indentation and spacing
[supercollider.git] / HelpSource / Classes / Formlet.schelp
blob90415b04a7ef83d1492e878fdca2542852ff86e6
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 discussion::
40 Note that if attacktime == decaytime then the signal cancels out and if
41 attacktime > decaytime then the impulse response is inverted.
44 Examples::
46 code::
47 { Formlet.ar(Impulse.ar(20, 0.5), 1000, 0.01, 0.1) }.play;
49 { Formlet.ar(Blip.ar(XLine.kr(10,400,8), 1000, 0.1), 1000, 0.01, 0.1) }.play;
52 // modulating formant frequency
54         var in;
55         in = Blip.ar(SinOsc.kr(5,0,20,300), 1000, 0.1);
56         Formlet.ar(in, XLine.kr(1500,700,8), 0.005, 0.04);
57 }.play;
61 // mouse control of frequency and decay time.
63         var in;
64         in = Blip.ar(SinOsc.kr(5,0,20,300), 1000, 0.1);
65         Formlet.ar(in,
66                 MouseY.kr(700,2000,1),
67                 0.005, MouseX.kr(0.01,0.2,1));
68 }.play;
72 // mouse control of frequency and decay time.
74         var freq;
75         freq = Formlet.kr(
76                 Dust.kr(10 ! 2),
77                 MouseY.kr(7,200,1),
78                 0.005, MouseX.kr(0.1,2,1)
79         );
80         SinOsc.ar(freq * 200 + [500, 600] - 100) * 0.2
81 }.play;