This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/Phid.schelp is in supercollider-common 1:3.6.3~repack-5.

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
69
70
71
72
73
74
75
76
77
78
79
class:: Phid
summary:: pattern that polls values from an OSX hid device
related:: Classes/PhidKey, Classes/PhidSlot
categories:: Streams-Patterns-Events>Patterns>User Input

description::

note::
This class is OSX specific. Please use the cross platform versions (based on link::Classes/GeneralHID::), link::Classes/PhidKey:: or link::Classes/PhidSlot::, instead.
::

ClassMethods::

method::new

argument::element
one element of the interface of the device, like a button or an axis. Can be an index or, if the devicespec is present, also a symbol.

argument::locID
the index of the device, defaults to 0 (first device).

argument::repeats
number of values to return.

Examples::

code::
// while this is running, test your device
(
a = Phid(0,0);
x = a.asStream;

Routine({ loop({
	x.next.postln;
	0.2.wait;
}) }).play;
)

// using devicespecs:
// for example wingman. for other specs see HIDDeviceService
(
HIDDeviceService.deviceSpecs.put('WingMan Action Pad',
	IdentityDictionary[
		// buttons
		\a -> 0, \b-> 1, \c-> 2,
		\x-> 3, \y-> 4, \z-> 5,
		\l-> 6,			//front left
		\r-> 7,			//front right
		\s-> 8,
		\mode-> 9,
		\xx-> 10,		//analog controller x axis
		\yy-> 11,		//analog controller y axis
		\slider-> 12,
		\hat-> 13
	])
)


// then you can use the named key:
(
a = Phid(\x, 0, inf);
x = a.asStream;

Routine({ loop({
	x.next.postln;
	0.2.wait;
}) }).play;
)


// 'musical' example:
(
	Pbind(
		\freq, Pseq([Phid(\x,0,8),Phid(\y,0,8)],inf) * 500 + 200,
		\dur, Phid(\slider) + 0.02,
		\pan, Phid(\hat) * 2 - 1
	).play;
)
::