A UGen that tests if two signals lie both within a given ranges. The two input signals can be understood as horizontal and vertical coordinates, therefore the test become one that determines whether the input is within a given "rectangle".
If x >= left
and x <= right
and y > top
and y <= bottom
, outputs 1.0,
otherwise outputs 0.0.
===Examples===
// detect whether mouse is in specific horizontal and vertical range
play {
val x = MouseX.kr; val y = MouseY.kr(1, 0)
val in = InRect.kr(x = x, y = y, left = 0.4, top = 0.2, right = 0.6, bottom = 0.4)
in * PinkNoise.ar(0.3)
}
- See also
- Companion
- class
Type members
Value members
Concrete methods
- Value Params
- bottom
upper margin of vertical test range (inclusive)
- left
lower margin of horizontal test range (inclusive)
- right
upper margin of horizontal test range (inclusive)
- top
lower margin of vertical test range (inclusive)
- x
"horizontal" signal to test
- y
"vertical" signal to test
- Value Params
- bottom
upper margin of vertical test range (inclusive)
- left
lower margin of horizontal test range (inclusive)
- right
upper margin of horizontal test range (inclusive)
- top
lower margin of vertical test range (inclusive)
- x
"horizontal" signal to test
- y
"vertical" signal to test