/usr/share/SuperCollider/HelpSource/Classes/Poll.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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | class:: Poll
categories:: UGens>Info
summary:: Print the current output value of a UGen
related:: Classes/SendTrig, Classes/OSCFunc
description::
Print the current output value of a UGen, useful for debugging SynthDefs.
WARNING:: Printing values from the Server in intensive for the CPU. Poll should be used for debugging purposes.::
classmethods::
private:: categories, new, new1
method:: ar, kr
argument::trig
a non-positive to positive transition telling Poll to return a value
argument::in
the signal you want to poll
argument::label
a string or symbol to be printed with the polled value
argument::trigid
if greater then 0, a '/tr' message is sent back to the client (similar to SendTrig)
returns:: its in signal (and is therefore transparent).
instancemethods::
private:: checkInputs, init
examples::
code::
s.boot;
{ Poll.kr(Impulse.kr(10), Line.kr(0, 1, 1), \test) }.play(s);
// multichannel expansion:
{ Poll.kr(Impulse.kr([10, 5]), Line.kr(0, [1, 5], [1, 2]), [\test, \test2]) }.play(s);
// using the poll message:
{ SinOsc.ar(375, 0, 1).poll(Impulse.ar(20), \test2) }.play(s);
// if no arguments are given, the poll is done every 0.1 sec.
{ Line.kr(0, 1, 1).poll }.play(s);
// send a '/tr' message back to the client. This can be useful if the server runs on another
// computer than the client, i.e. the post messages by the server cannot be read locally.
o = OSCFunc({arg msg; msg.postln;}, '/tr', s.addr);
{Poll.ar(Impulse.ar(5), Line.ar(0, 1, 1), \test2, 1234)}.play(s);
{SinOsc.ar(220, 0, 1).poll(Impulse.ar(15), "test", 1234)}.play(s);
o.free;
s.quit;
// This example will kill the server (by outputting NaN).
// Poll.ar will help us spot why it's happening.
// Warning: You may need to reboot your server after running this.
(
{
var cutoff, son;
cutoff = LFPar.kr(0.2, 0, 500, 500);
son = LPF.ar(WhiteNoise.ar, cutoff);
// Using Poll to debug by spitting out a value if the output hits NaN
Poll.ar(if((son<=0)||(son>=0), 0, 1), cutoff, "Cutoff value which causes NaN:");
son;
}.play(s);
)
// This example polls when someone hits the trigger
(
x = {|t_poll=0|
var minfreq, maxfreq, son;
minfreq = LFNoise2.ar(0.25, 100, 110);
maxfreq = LFNoise2.ar(0.25, 200, 220);
son = Gendy1.ar(minfreq: minfreq, maxfreq: maxfreq, mul: 0.1);
Poll.kr(t_poll, [minfreq, maxfreq], ["minfreq", "maxfreq"]);
son;
}.play(s);
)
x.set(\t_poll, 1); // Hit this whenever you want to know what the parameters are
::
|