07a_Select.zip

Download

Description

The next three tutorial patchers are related:

  • 07a Select
  • 07b Send and Receive
  • 07c Weighted Random Rhythm

In these patchers, we'll use using Max's select object to create three very simple examples of generative music. Generative music refers to music generated by a system or process that typically uses random procedures or algorithms. The term was coined by the electronic music pioneer Brian Eno in the late 1970s to describe his use of systems to create ever-changing music.

There are many other ways to create generative music. Two keep things simple, we will generate a constant pulse and selectively trigger musical events based on that pulse.


For example, we use this general approach in the next three patchers:

  • A metro object generates the constant pulse by producing bangs at a constant rate (here the rate is 4 bangs per second).
  • The bangs from metro object are sent to a random object to produce a stream of random numbers (here the range is 0-4, inclusive).
  • The random numbers are used as control data for a select object. Be sure to note that this object may be abbreviated as sel to save screen real estate.
  • In computer programming parlance, we are using sel here to create a conditional if-then-else statement whose logic is:
    • If the random result is 0, a bang is sent out the 1st outlet of sel.
    • If the result is 1, a bang is sent out the 2nd outlet.
    • If the result is 2, a bang is sent out the 3rd outlet.
    • If the result is 3, a bang is sent out the 4th outlet.
      If the result is 4, a bang is sent out the 5th outlet.
  • The 5 buttons below sel were added so the user can see each button light up as a selection occurs – another example of self-commenting code.
  • The first 4 buttons are mapped to MIDI pitch numbers. The 5th button is NOT mapped to a MIDI pitch number to create a rest. This is one way to create random melodic phrase lengths.
  • Each of the 5 outcomes has 20% chance of occurring, so it is easy to calculate out the probability of a particular pitch or rest event occurring.

Although the pitch selections are random, the pitch mappings has been strategically selected to guarantee a certain probabilistic musical logic. The four pitch messages (60, 62, 64, and 65) are the first four notes of a major scale on C4. By using a very limited range of pitches, we guarantee proximity between the melody’s pitches and thus a sense of smooth voice leading. By using the lower tetrachord of a C major scale, we guarantee the melody that the melody's implied harmony will be freely diatonic.

New Object

  • select (sel) - Output bangs based on input matching

Objects

Updated: 9/23/25