screensize

Mousestate

In this example, the horizontal location of the mouse in the screen is used to determine whether to send a bang or not. The mouse moving from one side of the screen, passing the mid point to the other side of the screen, causes a bang to be sent to the gswitch2 object. 

Linear mapping of ranges

To translate numbers that occupy a particular range into an equivalent set of numbers in a different range, one common and useful technique is "linear mapping". The term "mapping" refers to making conceptual connections between elements of one domain and elements of another, and "linear" mapping refers to using a mapping function that is a straight line––that is, such that numbers in one domain are mapped to an exactly equivalent position in the new domain. This is a very common and useful operation in media programming.