This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/IndexInBetween.schelp is in supercollider-common 1:3.8.0~repack-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
class:: IndexInBetween
summary:: Finds the (lowest) point in the Buffer at which the input signal lies in-between the two values
categories:: UGens>Buffer
related:: Classes/Index, Classes/IndexL, Classes/SequenceableCollection#indexInBetween

description::
Finds the (lowest) point in the link::Classes/Buffer:: at which the input signal lies in-between the two values, and returns the index. The fractional part of the index is suitable for linearly interpolating between the buffer slot values.

For example, if the Buffer contains [3, 21, 25, 26] and the input has the value 22, then the output will be 1.25, because the value 22 is in-between the values stored in indices 1 and 2 and in fact is one-quarter of the way along the interval between them.

IndexInBetween is the complement of link::Classes/IndexL::.

classmethods::

method:: ar, kr
argument:: bufnum
index of the buffer.
argument:: in
the input signal.

examples::
code::
(
// autotune.
{
	var index, in, autotuned, f0, fdiff;
	var scale = ([0, 1, 3, 4, 7, 11, 12] + 70).midicps;
	var buffer = scale.as(LocalBuf);
	in = Pulse.ar(MouseX.kr(scale.minItem, scale.maxItem)) * 0.1;
	f0 = Pitch.kr(in).at(0);
	index = IndexInBetween.kr(buffer, f0);
	fdiff = index.frac * (Index.kr(buffer, index + 1) - Index.kr(buffer, index));
	autotuned = PitchShift.ar(in, 0.1, 1 - (fdiff / f0), 0.01, 0.01);
	RLPF.ar(autotuned, [2000, 5000], 0.3)
}.play;
)

b.free;


// basic test.
(
{
	var index, f0, f1, f3;
	var buffer = [ 200, 210, 400, 430, 600, 800 ].as(LocalBuf);
	f0 = MouseX.kr(200, 900);
	index = IndexInBetween.kr(buffer, f0);
	f1 = IndexL.kr(buffer, index);
	SinOsc.ar([f0, f1]) * 0.1

}.play;
)



// One way to map across from an arbitrary piecewise curve, onto another:
// We use IndexInBetween to "unmap" your input into integer slots,
// and then use IndexL to do the reverse, to "map" onto your other distribution.
// This example maps a sort-of-exponential curve onto a sort-of-sinusoidal curve:

~from = [1, 2, 4, 8, 16];
~to = [0, 1, 0, -1, 0];
(
x = {
	IndexL.kr(~to.as(LocalBuf), IndexInBetween.kr(~from.as(LocalBuf),MouseX.kr(~from.first, ~from.last).poll).poll).poll
}.play
)
::