Thursday 11 February 2010

Max5 Inputs

ANY INPUT

Max 5 has many inputs available for the software to take in, this is done by using different objects to get the data in, one of these objects is the ctlin which is a midi controller. The following allowed us to find a key's number and a reference number to that key, using keyboards this time, don't worry this will be covered later:


KEYBOARD

The keyboard can also be tracked determining which key you press, the object for this is key and it tells you the ascii number of the key pressed NOT the letter. Here is a complex version of a keyboard tracker:


In the above code when the key 115 is pressed (I think it was P) it activates the toggle button which then turns on or off depending on it's previous state, if on the delay will start repeating at a high rate generating a random number up to 110 by the random object and displayed in the number box, if the button 112 is pressed (can't remember what button that was) the middle circle will light up and if any other key is pressed the right circle will light up.

MOUSE

 Last but not least is the mouse which has 5 parameters:


When the toggle box is active the mousestate objects checks what the mouse is doing, if clicked the toggle box will turn on and off and generate a 1 or a 2 to show if its on or off, the next 2 fields are the X and Y position of the cursor and the last 2 fields are the movement in the X and Y direction, if the user moves the mouse rapidly the numbers will be high compared to slowly where the numbers will be low.

No comments:

Post a Comment