key

Autostart

The object loadbang sends a bang when a patcher is opened. This object is very useful if you want to automate the start of some objects or messages in your patch. In this example, the movie starts automatically by sending loadbang to read the movie file and the toggle when the patch is loaded. 

ASCII key

The key object tracks and outputs the ASCII values of the keys you press on the computer keyboard. You can then use those ASCII values to trigger other objects as shown in the example above. In the example, the 'c' key is used to trigger the note middle C (MIDI key number 60), and the 'r' key is used to turn on a stream of randomly-chosen notes C across the entire MIDI range (every multiple of 12 from 0 to 120) at a rate of ten notes per second.

A/B audio crossfade

This patch shows how to crossfade between two sounds. Initially, two different sound files are loaded into two different sfplay~ objects. When you click the toggle marked "start/stop", both sound files will play, but you'll only hear the one on the left because its amplitude is being multiplied by a constant signal value of 1 from the sig~ 1 object, while the one on the right is being multiplied by a signal value of 0 from the line~ object.

A/B audio switch

This patch shows how the selector~ object may be used to choose just one of two (or more) different audio signals. A number in the left inlet specifies which of selector~'s signal inlets should be passed to its outlet.

Change number box with key

This example shows how you can increase or decrease the number in a number box each time the up or down arrow keys are pressed. The incdec object is made to be connected to the integer number box in the manner shown here. The messages inc and dec to incdec will increment and decrement the attached number box.