Max Tutorial #5: Expanding the Sequencer with Skips and Slides

In this tutorial, we will expand the sequencer we’ve been developing for additional functionality. We’ll start off with a very similar structure, but instead of eight steps, we’ll double it to sixteen steps. This means that both the [counter] and the [multislider] have to be updated as shown. We’ll use the sawtooth oscillator [saw~] again, as in Tutorial #3.

Once this is up and running, we’ll add a second [multislider] object to control a second parameter, as in the previous tutorial. The second [multislider] object will control the volume of each step. The range for each slider in the second [multislider] should be 0 to 1 with floating-point output, as shown in the video. (You can copy and paste objects by using command+C and command+V, or through the Edit menu.)

We’ll control the volume through the use of a second [*~] object, below the first one. We can think of volume control as a multiplication-based process. Each slider in the volume [multislider] has a value from 0 to 1. 1 is maximum value, 0 is silence, 0.5 is half of the maximum value, etc. So when we change the volume using [*~], we are multiplying the audio signal by the value given by [multislider]. We add the [line~] object to process changes in volume at the audio rate. Note that if you drag one of the sliders all the way down, you can drop that step out of the pattern, creating more rhythmic interest.

There are two other expansions we’ll explore in this tutorial. The first is adding smoothness (also known as bend or slide) between pitches, so that they seem to glide into one another. We can implement this in a very simple way using a message box and an additional [line~] object into [saw~]. As in the previous tutorial, the “$1” passes through the values from the object above (in this case, frequency values). The second number indicates how many milliseconds the synth should take to reach that value. In the video, the message “$1 50” means that the synth will introduce a slide of 50 milliseconds for every pitch. This may not sound like a lot, but the difference is clearly audible.

To make the slide parameter more customizable, we can use the [join] object. The [join] object brings multiple elements together into a single piece of data. In this case, there are two elements, so we add an argument of “2” as shown. The frequency value passes into the left inlet and we can connect an integer number box to the right inlet to set and change the slide time. The text “@triggers 0” tells [join] to output the combined elements only upon input to the left inlet. This allows us to freely change the slide time without causing output, which would disrupt the rhythmic pattern. As you can see in the video, the greater the slide time, the greater the modulation effect on the pitch.

The final expansion in this tutorial allows us to divide the sequence into smaller rhythmic units by choosing the step at which the sequence starts over. We can implement this by creating an integer number box that passes through the message “max $1” into the left inlet of the [counter] object. The “max” message sets the maximum count value for [counter]. As we change the number, the number of steps looped by the sequencer changes, creating distinct rhythmic patterns. We can verify this by adding a number box to show the output of [counter] directly.