File: Max.schelp

package info (click to toggle)
supercollider-sc3-plugins 3.7.1~repack-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,332 kB
  • ctags: 11,704
  • sloc: cpp: 140,180; lisp: 14,746; ansic: 2,133; xml: 86; makefile: 82; haskell: 21; sh: 8
file content (54 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class:: Max			
summary:: maximum within last x samples
categories:: UGens>Analysis
//SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html
keyword:: SLUGens


Description::
Will output the maximum value of over the last numsamp samples, calculated efficiently by storing a local maximum for every control period. The numsamp argument will be rounded to a multiple of control period lengths. The output is the held maximum at control rate. 

classmethods::

method::ar


argument::in
input to sample (.ar rate)
argument::numsamp
take the maximum over this number of samples into the past (will be rounded to control periods)

Examples::

code::
(
SynthDef("help-Max",{Out.ar(0,Pan2.ar(
SinOsc.ar(Max.kr(SinOsc.ar(2,0,300,400).abs,6400),0,0.1) 
,0.0))
}).play
)

//compare
(
SynthDef("help-Max",{Out.ar(0,Pan2.ar(
SinOsc.ar(SinOsc.ar(2,0,300,400),0,0.1) 
,0.0))
}).play
)

(
SynthDef("help-Max",{Out.ar(0,Pan2.ar(
SinOsc.ar(Max.kr(LFNoise0.ar(20,300,400),3200),0,0.1) 
,0.0))
}).play
)

//compare
(
SynthDef("help-Max",{Out.ar(0,Pan2.ar(
SinOsc.ar(LFNoise0.ar(20,300,400),0,0.1) 
,0.0))
}).play
)

::