2 summary:: Test for infinity, not-a-number, and denormals
3 categories:: UGens>Info
6 This link::Classes/UGen:: tests for infinity, NaN (not a number), and denormals. If one of these is found, it posts a warning. Its output is as follows: 0 = a normal float, 1 = NaN, 2 = infinity, and 3 = a denormal.
12 the link::Classes/UGen:: whose output is to be tested.
14 an id number to identify this link::Classes/UGen::. The default is 0.
16 One of three post modes:
20 ## 1 = post a line for every bad value;
21 ## 2 = post a line only when the floating-point classification changes (e.g., normal -> NaN and vice versa)
24 The default post mode is 2. Post mode 1 is retained for backward compatibility; be aware that it generates a large amount of output.
28 { CheckBadValues.kr(SinOsc.ar); 0}.play // nothing wrong here
30 { CheckBadValues.kr(1 / 0, 1).poll; 0 }.play // check infinity
32 x = { arg test = -1; CheckBadValues.kr(test); 0 }.play // check NaN
33 x.set(\test, -1.sqrt);
35 // don't post, but do something with the output
39 good = BinaryOpUGen('==', CheckBadValues.kr(freq, 0, 0), 0);
40 SinOsc.ar(freq, 0, 0.1) * good // silence the output if freq is bad
43 x.set(\freq, -1.sqrt);
45 // the UGen method checkBadValues passes through the input for quick testing
46 { SinOsc.ar(440, 0, 0.1).checkBadValues }.play