/usr/share/SuperCollider/HelpSource/Classes/PhidKey.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 | class:: PhidKey
summary:: pattern that polls values from a human device interface, based on a named slot
related:: Classes/Phid, Classes/PhidSlot, Classes/GeneralHID
categories:: Streams-Patterns-Events>Patterns>User Input
ClassMethods::
method::new
argument::key
key defined in the link::Classes/Spec:: of the device, pointing to a slot like a button or an axis.
argument::device
a link::Classes/GeneralHIDDevice::, or an element from the code::GeneralHID.deviceList::, which will then be opened by the pattern.
argument::repeats
number of values to return.
Examples::
code::
// build the device list and start the event loop:
GeneralHID.buildDeviceList;
GeneralHID.startEventLoop;
// find an Impact game device and open it:
a = GeneralHID.open( GeneralHID.findBy( 1973 ) );
// define a spec:
(
a.add( \lx, [3,0]); // left x
a.add( \ly, [3,1]); // left y
a.add( \rx, [3,2]); // right x
a.add( \ry, [3,5]); // right y
);
// or find a spec defined previously for this device:
c = a.findSpec;
// set it:
a.setSpec( c[0] );
// inspect the spec
a.spec.map
a.caps;
// boot the server
s.boot;
// simple example:
(
p = Pbind(
\degree, ( PhidKey( \lx, a, inf )*12 ).round(1),
\dur, 0.25
).play;
)
p.stop;
// more complex example, showing multichannel expansion and sequences of slots:
(
p = Pbind(
\degree, ( PhidKey( Pseq([[\lx,\ly],\rx,\ry],inf), a, inf )*12 ).round(1),
\dur, 0.25
).play;
)
p.stop;
// clean up: close the device and stop the eventloop
a.close;
GeneralHID.stopEventLoop;
::
|