Max and Pd provide a large number of objects to support MIDI processing. In this section, we'll learn about objects designed to handle specific MIDI message types. In a subsequent section, we'll learn about objects that support raw MIDI bytes.
"Gates" route messages from a single inlet to one (or none) of many possible outlets.
"Switches" route messages from one of many possible inlets to a single outlet.
gswitch and gswitch2 objects respond to mouse clicks and "g"raphically show routing ... only two inlets or outlets.
The route object is especially useful for sending lists of data. It compares the first item of an incoming message to each of its arguments and, if a match is found, sends the rest of the message out the corresponding outlet. Otherwise, the message is sent out the right-most outlet.