You can use a MIDI "program change" message to tell a synthesizer to change to a different sound. The Max object for that is pgmout.
These patches use timed counting—in both cases using a metro object and a counter—to step through a series of MIDI notes.
Every MIDI note-on message must be turned off at some time by a subsequent corresponding note-off message for the same pitch (or note-on message with velocity 0). This patch shows two ways to ensure that. One is a very simple way that's illustrative but not ideal; the second way is much more versatile and is the preferred way.
In the MIDI specification, and in most DAW software, and in Max, the smallest unit of metric timing is expressed in "ticks", which is to say, partial units of a beat. Commonly the number of ticks used is 480 or 960 parts per quarter note. That number makes sense because it's divisible by 2, 3, 4, or 5 (and multiples of those).
This example plays a 12-note chromatic scale over three octaves with timed triggers.
In Max, the message bang is used as an all-purpose triggering message, to cause some event to happen. Most Max objects understand the message bang to mean "do whatever you do". In other words, the message bang is used to cause some event (such as playback of a sound file) to occur.
This patch shows how to play a loaded movie file in short chunks.
In this example, when you turn on the two metro objects, one of the three movies are chosen randomly by the urm object every three seconds to be read by the jit.qt.movie object. Since the urm generates random numbers without duplicate, it can be used to switch to a new movie at a certain interval while playing.
This example shows a series of events that causes a movie to start playing.
First, when you click on the message read blading.mov or read, the message is sent to the object jit.qt.move, which then reports read <movie_name> 1 from the right outlet if successful.
This patch uses metro, counter, and table to read through MIDI values to create an ascending and descending major scale.