scide: implement selectionLength for openDocument
[supercollider.git] / HelpSource / Classes / Schmidt.schelp
blobe435da7b19589f947a60737dddd76aa6cfc437fd
1 class:: Schmidt
2 summary:: Schmidt trigger.
3 related:: Classes/InRange, Classes/InRect
4 categories::  UGens>Maths
7 Description::
9 When  code::in::  crosses to greater than
10 code::hi:: , output 1, then when signal crosses lower
11 than  code::lo::  output 0. Uses the formula:
13 code::
15 if (out == 1, { if (in < lo, { out = 0.0 }) }, { if (in > hi, { out = 1.0 }) }).
19 Output is initially zero.
22 classmethods::
24 method::ar, kr
26 argument::in
28 Signal to be tested.
31 argument::lo
33 Low threshold.
36 argument::hi
38 High threshold.
41 Examples::
43 code::
45 Server.internal.boot;
47 { Schmidt.kr(SinOsc.kr(1, 0, 0.2), -0.15, 0.15)}.scope; // see the trigger
49 { Schmidt.kr(MouseX.kr(0, 1), 0.2, 0.8)}.scope; // try it with the cursor
51 // threshold octave jumps
54         var in = LFNoise1.kr(3);
55         var octave = Schmidt.kr(in, -0.15, 0.15) + 1;
56         SinOsc.ar(in * 200 + 500 * octave, 0, 0.1)
57 }.scope;