Mouse click kslider
In this example, you can play notes by pressing the mouse on the kslider object, and when you release the mouse, the notes will be turned off. When the mouse button is released, that fact is reported by a 0 from the left outlet of the mousestate object.