# Max

## Time interval and rate

This patch provides examples that compare linear rate changes to exponential rate changes. As with pitch and loudness, our sense of change in the rate of events is based on the ratio of tempos rather than the (subtractive) difference between tempos. In these examples, the rate changes by a factor of 16, from 1 event per second to 16 events per second, or vice versa.

## Automated countermelody improviser

This patch provides an example of simple interactive improvising program that plays a melody influenced by the notes played by a live performer. Based on the most recently received MIDI note, the program chooses a scale to use for its melody, and moves melodically in a straight line toward the pitch and velocity most recently received. The program has only one use of randomness, to make a probabilistic decision. It has a small musical knowledgebase of three scales, and a set of probabilities determining which scale is more appropriate for use at any time.

Other Attachments:

## Choose from among multiple processes

For this example to work properly you'll first need to download two other patches.

## Motivic "improviser"

This patch enacts a particular type of improvisational behavior, playing a partial statement of a stored motivic phrase. The phrase is stored in a coll (collection) object, as an ordered array of lists, with each list containing three numbers: pitch, velocity, and duration for a MIDI note message. Each time a message comes in the inlet, the patch chooses a transposition of the motive at random, chooses a number of notes to play, and starts a metro to begin counting through the numbered items in the coll.

## Random semitone trills

A trill can be thought of as a fast back-and-forth alternation between two pitches—or more generally as fast back-and-forth alternation between any two things or states. A back-and-forth or on-off switch can be implemented in any programming language by setting a boolean variable (a variable that's capable of having only one of two states) to its opposite state, with an expression in the form of "If it's 'X', set it to 'NOT X', otherwise, set it to 'X'."

## Automated blues "improviser"

This patch shows an idea for an automated improvising algorithm. At regular intervals of time, which one might think of as the length of a musical phrase (every 1.6 seconds in this example), the metro object chooses a new random number from 0 to 35. That number will be considered a target number toward which the line object should go.

## Look up chords in an array

The coll object allows one to store an indexed collection of messages of any type. In this example, each stored message is a list of five numbers that will be used as pitches of a chord. (Double-click on the coll to view its contents.) The chords are chosen at random, but they have been composed such that they all have a valid function in C minor, and because they are all five-note jazz chords voiced in a similar manner and range, stylistically any one of the twelve chords sounds reasonable following any other.

## Random voicings of a pitch class set

A chord can be described as a pitch class set. For example, a C dominant ninth chord is the pitch class set {0,2,4,7,10}. Depending on the octave transposition of each of those five pitch classes, many voicings of the chord are possible. This patch take applies a transposition of four, five, six, or seven octaves to each of the five pitch classes to create a random voicing of the chord.

## Sequential or random access of a lookup table

One of the nice features of an array is that you can store data in a particular order, then recall it in that order simply by incrementing an index counter. Or you can access the data randomly, which still restricts your outcome to members of that data set but ignores the original order.

## Refer to a lookup table remotely

You can temporarily change the name and contents of a table object with the refer message, referring to the contents of another named table. In this patch we use a toggle to switch between a major scale and a minor scale, triggering the necessary refer messages.

Other Attachments: