scide: implement selectionLength for openDocument
[supercollider.git] / HelpSource / Classes / Pluck.schelp
blob7e83eab88270f14cb30c9c1303b6d8759b0bb756
1 class:: Pluck
2 summary:: A Karplus-Strong UGen
3 categories:: UGens>Delays
5 description::
6 A Karplus-Strong UGen
8 classmethods::
9 method:: ar
11 argument:: in
12 an excitation signal.
13 argument:: trig
14 upon a negative to positive transition, the excitation signal will be fed into the delay line.
15 argument:: maxdelaytime
16 the max delay time in seconds (initializes the internal delay buffer).
17 argument:: delaytime
18 delay time in seconds.
19 argument:: decaytime
20 time for the echoes to decay by 60 decibels. Negative times emphasize odd partials.
21 argument:: coef
22 the coef of the internal OnePole filter. Values should be between -1 and +1 (larger values will be unstable... so be careful!).
23 argument:: mul
24 argument:: add
26 examples::
27 code::
28 s.boot;
30 // excitation signal is WhiteNoise, triggered twice a second with varying OnePole coef
32         {Pluck.ar(WhiteNoise.ar(0.1), Impulse.kr(2), 440.reciprocal, 440.reciprocal, 10,
33                 coef:MouseX.kr(-0.999, 0.999))
34         }.play(s)
36 s.quit;
37 // a group of angry fretless mandolin players
39         {
40                 var freq, numparts;
41                 numparts = 50;
42                 freq = SinOsc.kr(Array.fill(numparts, {Rand(0.05, 0.2)}),
43                         Array.fill(numparts, {Rand(0, 1.0)})).range(1000, 3000);
44                 LeakDC.ar(
45                         Pan2.ar(
46                                 Pluck.ar(
47                                         WhiteNoise.ar(0.1).dup(numparts),
48                                         Impulse.kr(Array.fill(numparts, {Rand(10, 12)})),
49                                         100.reciprocal, freq.reciprocal, 2, Rand(0.01, 0.2), mul: 1),
50                                 Array.fill(numparts, {Rand.new(-1.0, 1.0)}))
51                         .sum
52                         );
53                 }.play(s);