File: BufMin.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 (36 lines) | stat: -rw-r--r-- 817 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
CLASS:: BufMin
summary:: detect the largest value (and its position) in an array of UGens
categories:: UGens>Multichannel, UGens>Analysis
related:: Classes/ArrayMin, Classes/BufMax

DESCRIPTION::

Finds the smallest value in a Buffer, and outputs the value and the index.


(Note: doesn't currently handle multichannel buffers in any clever way, treats them as if they were single-channel.)

CLASSMETHODS::

METHOD:: kr
argument:: bufnum
argument:: gate
You don't need to make use of the gate control: if you do use it, the calculation is only performed when gate>0.
returns:: # val, index


EXAMPLES::

code::
s.boot;

b = Buffer.alloc(s, 100);
b.zero;
b.set(33, -1.034);
// This should detect the 33rd value as the highest...
x = {BufMin.kr(b).poll}.play;

// ...until we set a new winner...
b.set(74, -1.038);
::