Assignment for February 3, 2015

Read the following articles, and study the Max examples they contain.

Randomness
Randomness and noise
Moving range of random choices
A simple probabilistic decision
Probability distribution

Read this chapter from the book Xenakis Matters.

Realtime Stochastic Decision Making for Music Composition and Improvisation

The following Max examples will help you use randomness in your own programs.

Some objects for generating numbers
Random note choices
Random voicings of a pitch class set
Look up chords in an array
Sequential or random access of a lookup table
Basic linear mapping
Controlling the range of a set of numbers
Generate random numbers within a specified range

Write a program that uses randomness—objects such as random, urn, drunk, (bang message to) table, noise~ (possibly with sah~), and rand~—to control the generation of notes or sounds. Rather than simply generating randomly-chosen events, however, constrain the random choices in a useful way to get an intentional musical effect. You might dynamically control the range of random numbers, or weight the random choices such that some events are more likely to occur than others, or make random choices from an established set of non-randomly selected possibilities, or make small random perturbations to an otherwise predictable process. The random numbers might control pitch choices, or loudnesses (velocities) or choices of soundfile cues, or rhythmic timings, or any measurable parameter of a music-making (or sound-making) procedure.

Place your completed program in the EEE DropBox called “Randomness4”.

Assignment for January 29, 2015

Attend the Gassmann Electronic Music Series lecture “Interactive Improvisation – Percussion and Computer” by percussionist Aiyun Huang at the usual class time, 11:00 am on Thursday January 29 in the Realtime Experimental Audio Laboratory (REALab), Room 216 of the Music and Media Building.

Attend the Gassmann Electronic Music Series concert Wired Percussion by Aiyun Huang at 8:00 pm on Friday January 30 in Winifred Smith Hall.

Both events are free.

Timepoints

A timepoint is a point in musical time.

When you’re using tempo-relative timing in Max, the timepoint object will automatically report when a specific moment in musical time has been reached by the transport.

many timepoints stored in a coll

You can use as many timepoint objects as you’d like. This example, however, shows a way that you can save many timepoints in a coll object, use the output of the coll to set a timepoint, and use the output of the timepoint object to signal when that timepoint has been reached and also to read the next timepoint from the coll and set up the timepoint object itself for the next timepoint it should report.

Using the metro object controlled by the transport

Whenever the time interval of a metro object is specified using tempo-relative time units such as note values, the operation of that metro will be governed by the transport. The metro will only operate when the transport is turned on.

 

different metro behaviors

There are several ways to control the behavior of the metro via its attributes when it’s governed by the transport. Read in the manual about the @interval, @quantize, @active, @autostart, and @autostarttime attributes of metro.

The when object reports the current time of the transport. The timepoint object automatically reports when a specific moment in time has been reached.

The patcher object encapsulates a subpatch

In programming, it’s often useful to divide a task into parts, and consider the overall program as a combination of small tasks. Each small task can be considered a subset of the overall program, to be called upon when needed. In programming lingo, that’s often called a “subroutine” or a “function”.

In Max, you can encapsulate a patch consisting of several objects inside a single Max patcher object. The contents of that patcher object can be thought of as a “subroutine” of the main patcher. Inside the patcher object, you can create inlet and outlet objects, which will appear as inlets and outlets of the patcher object in the main patch.

p is a synonym for patcher

You can view and edit the contents of a patcher object by double-clicking on it in the locked patcher window.

A patcher object could potentially even include other nested patcher objects. Dividing your overall task into separate tasks (subroutines) and encapsulating each one as an object is a good way to organize your program.

Interference between sound waves

When sound waves are mixed together, be it mathematically within the computer or physically in the air, they “interfere” with each other.

beating due to interference

Depending on the relationship of the frequencies involved, the interference will at times be constructive (when the waves are in phase with each other they combine to reinforce their amplitudes) or destructive (when the waves are fully out of phase they tend to cancel each other).

Stack overflow

Recursion, feedback loops, and unlimited untimed (as fast as possible) loops are not feasible in Max. In effect, you’d be asking Max to do an unlimited number of things all at the same time. Its scheduler (its internal “to-do” list) would get filled and it would be unable to do anything more. In computer lingo, its “stack” (its inbox of tasks to do) would overflow.

 

scheduling many events

To avoid stack overflow, make sure that you explicitly schedule repeated events to have a specific time, either with a timing object such as metro, or with the special object uzi, which can perform a (finite!) number of things as fast as possible and manages the scheduling for you.

Assignment for January 27, 2015

Learn all you can about how the Max transport object works, the different forms of time value syntax, the timing objects that can rely on the transport timing mechanism, and the ways you can access tempo-relative timing information.

Start by reading this article on Tempo-relative timing by Christopher Dobrian.

Read about the different ways to express timing in Max in the documentation of Time Value Syntax.

Check out Examples 42-48 (from the 2010 class) on the Max transport. (Example 46 uses some objects we haven’t discussed in class yet, but you can still try to understand the concept of what it’s demonstrating.)

Additional possibly-useful examples include “Convert between musical time and clock time“, “Tempo-relative timing with the transport object“, and “Delay with tempo-relative timing“.

Some primary things you’ll want to understand are:

1) The relationship between “clock time” (a.k.a. absolute time) and “musical time” (a.k.a. tempo-relative time). Clock time is measured in hours:minutes:seconds in everyday life, in milliseconds in Max, in hours:minutes:seconds:frames in filmmaking and video, in samples in digital audio, and sometimes in other units by programmers, such as QuickTime time units, or 1/60 second “ticks” in some other environments. Musical time is measured in bars:beats:divisions by humans, bars:beats:units in MIDI sequencers, (units are often called “ticks” and are 1/480 of a beat in most environments), or simply in ticks.

2) The difference between an interval of time and a position in time. We can designate any event as occurring at a point in time, and give a numerical value to that timepoint. We can specify the position of that timepoint either in musical time (such as 5:3:240, meaning “the and of three in measure 5”) or in reference to an arbitrarily chosen “zero” point in absolute time (such as 1384567988.962, meaning 1,384,567,988.962 milliseconds since the program started to run). An interval is the difference between two timepoints. So, for example, the start of a piece would be described in bars:beats:units as 1:1:0. That’s a timepoint, a position in time. After an interval of 4:3:240, the position in time would be 5:3:240. After another interval of 3:1:120, the position in time would be 8:4:360. That timepoint, 8:4:360, is an interval of 7:3:360 from the beginning of the piece. (Quick quiz: In 4/4 time, how many ticks is the interval 7:3:360?)

3) A metro behaves differently when it has an absolute time as its argument versus when it has a tempo-relative time unit as its argument. What exactly do the active, interval, quantize, autostart, and autostarttime attributes of metro mean?

4) Many other Max objects deal directly with time and thus can use tempo-relative time units. Check out how they can be used in delay, pipe, and makenote, for example.

5) Some MSP objects can deal with tempo-relative time directly, such as delay~, phasor~, line~, and snapshot~.

6) Any time you need to convert from musical time to clock time, you’ll want to know about the translate object.

7) For making things happen at a specific moment in musical time, you’ll want to know about the timepoint object.

For your weekly assignment:

Your goal is to produce a sequence of MIDI events (mostly notes) that you find musically interesting and that are synchronized by the transport. Use the transport object to control the progress of musical time, such as setting the beat tempo, starting, stopping, etc. Use timing objects such as metro and timepoint to produce triggers at desired moments in musical time. You might use makenote to control the durations of notes. You might want to look up messages or particular bits of information in a coll or a table. You might want to use a metro (probably a quantized one) to bang the transport object itself to get reports of what time it is, and then use that information to trigger events. Your resulting music might be completely deterministic (the same every time), or it might include some degree of variability, by clever use of the random and urn objects, for example. The resulting music can be of any duration you’re able to accomplish well. The user interface doesn’t have to be beautiful, but try to make it simple, clear, and efficient.

Place your completed assignment in the EEE DropBox called “RhythmicMIDI3”.

As always, take notes as you work, ask (and answer) lots of questions on the Q&A site, and contribute to the Wiki when you think you understand and can explain a key concept.

Very low frequency modulation for gradual change

This example combines seven pre-recorded saxophone sounds, slowly modulating several aspects of their playback to create an ever-changing mix.

N.B. In order for this example to work properly, you will need to download the seven relatively short sound files provided here, and save them in the same folder as you save this example patch.

seven saxes singing

The patch demonstrates the use of the patcher object to encapsulate each particular task of the program. This makes for a tidier program overall, in which you can easily see how each process is working.

The patch also demonstrates the use of extremely low frequency oscillators (cycle~ objects) to very gradually modulate aspects of the sound. The oscillators are used to modulate playback speed, amplitude, and stereo panning of each of the seven sounds being played simultaneously. The low-frequency oscillators (LFOs) are tuned to very low frequencies ranging from 1/4 Hz to 1/187 Hz. The oscillator rates were chosen based on inversions of the mutually prime numbers 2, 3, 5, 7, 11, 13, and 17, so that the overall sound almost never repeats, giving a constantly-changing variety of composite sound. This sort of extremely low-frequency change can be thought of as a way to shape sonic and musical form over any period of time, even over several minutes.

I won’t try to explain all the details of the way the whole program works, but you can learn about its construction by switching out of Presentation Mode and double-clicking on patcher objects to see their contents.

Assignment for January 22, 2015

Read about MIDI, and experiment with some Max patches that use MIDI, with the goal of understanding what MIDI messages do, and how they can be managed (received, modified, and transmitted) in Max.

Read “MIDI“, an explanatory essay by Christopher Dobrian.

I’ve done my best to find other readable writings on MIDI. Take a look at these Links for reading about MIDI and see which ones are at a level that is useful to you.

Try working through the MIDI Tutorials that are included in the Max Documentation. You can find them online, but you’ll want to open the tutorial patches while reading.

I’ve made a patch that shows all the MIDI objects in Max.

This example about linear mapping uses MIDI for its example, so it might be somewhat instructive. (None of the number boxes are initialized to good starting values, so you’ll need to drag them yourself. You can use the numbers in the example picture as a guide.)

This example shows random voicing of a five-note chord (by randomly transposing each pitch class some number of octaves).

There are quite a few other examples on that same page of examples from the 2013 class that deal with MIDI: notably examples 13-19.

Try generating a pattern of MIDI notes yourself using some of the objects you know such as metro, counter, random, line, and coll.