(max) assignment 1 – build an arpeggiator

due by beginning of class, 1/13

Build an  arpeggiator that plays a some type of 9th chord (voiced however you would like) above a played MIDI note, either in order stored or randomly, that starts with the playing of a MIDI note, and stops when you release the note. To summarize:

  • arpeggio should start when you press any key on a MIDI keyboard.
  • arpeggio should stop when you release the key on a MIDI keyboard.
  • arpeggio should use the note number of the pressed MIDI key as the lowest note of the arpeggio.
  • arpeggio should be some type of ninth chord, voiced however you like.
  • you should be able to play arpeggio either in order stored, or in a random order.
  • duration notes in arpeggio should match speed of note playback.

I am not uploading any demo patchers from the first week, but I think that you can recreate this patcher fairly easily. Working from the description should also give you a better idea of how each part of the patcher functions. I have posted a brief description of the objects used in the first week, and I’m going to give you an outline of how to create the arpeggiator. Although the arpeggiator is a fairly standard simple program, it will form the basis for a wide collection of variations that will extend your ability to generate gestures and accompaniments in Max.

outline of the patcher

note output

Start from the bottom, meaning start with a noteout object. Connect a makenote object to it with appropriate arguments. Then connect a number box to makenote, so that whenever your type in a new number (or drag the number in the box with the mouse), you will generate a note-on/note-off pair. You should hear notes with these three objects. If you don’t, check your connections and help/documentation. You can also add a pgmout object with a number box connecting to it to change sounds on the general MIDI synth. At every point, check to make sure your patcher is performing as expected before moving on to the next paragraph/function.

midi note input

Once you get note output from the bottom of your patcher, start moving up from it. You will need to create an addition object that adds the stored arpeggiator intervals to your MIDI note input. At this point you should add your MIDI note input section, off to the left and above the objects you have already created. You need a notein object, and a stripnote object, since you only want the note number being passed to the output when you press the key – note when you release it. Connect a number box to the left outlet of stripnote to make sure that the note number from note-on messages are being passed from stripnote. If you don’t see numbers changing when you press different keys on a MIDI keyboard, then you haven’t connected noteon and stripnote properly.

playing intervals (initial stage)

With a MIDI note input connected to the right inlet of an addition object, you can add another number object connected to the left inlet of the addition object. This number box will display the interval being sent to add to the current note input. You should now be able to press a MIDI key, then type in a number to this top (at this time) number box and hear an interval above the MIDI key you last pressed. Try a few MIDI keys and typing in a few intervals. Remember, the typing of the interval (and hitting return) triggers playback of the note at this point, not the pressing of the MIDI key.

storing and outputting intervals

You will use a table object to store the intervals for the arpeggiator. Once you add the table, you will want to use the Inspector to change settings for the table to make editing it more manageable, and to save the data in the table with your patcher. The Inspector is accessed by selecting an object and clicking on the “i” in the bottom below the patcher window. (Alternately, you can select an object and use <cmd> – I.)

In the table inspector, move to the bottom section labeled “table.” Enable “Save Data With Patcher” so that data in the table will be saved with your patcher. Otherwise, the table will be blank every time you open your patcher. You should also reduce the size of the table. Consider how many intervals you will include in your chord. Remember that you can voice the chord however you want. If you have 5 intervals, then you can reduce the table size to five. Next, consider what your largest interval will be in half steps. If you use a compact ninth chord in root position, your largest interval will be 14 (for a major ninth). This value translates to your table range. Reducing the size and range of the table will make it easier to edit, by enlarging each edit point. Close the inspector.

Lock the patcher and then double-click on the table object to edit it. Moving your mouse around the table will show you location and value. Add the desired intervals to your table, close the table window, and unlock the patcher. Add a number object that sends to your table. Now, you should be able to press a MIDI key, then type numbers into the top-most number box and have the intervals sent from the table, to the addition object, and eventually to makenote and out.

playing intervals in time and in random order

Now we will add the ability to generate numbers at a time interval, randomly selecting an interval from the table. Add a metro object. Use a time value for the metro that matches the note duration in makenote. Remember that the default time format for Max is milliseconds (ms). Connect a toggle object to the appropriate inlet of the metro to start and stop it. Connect a button (bang) to the outlet of the metro to see/verify that the metro is outputting bangs when it is turned on by the toggle.

Connect the output of the button to a random object. Set the argument (range) of the random object to match your table size (number of intervals you have stored in table). Random outputs from 0 to Arg – 1, which matches your table locations. Connect the output of the random object to the number object that feeds into your table. Check that you can now turn the metro on with the toggle and have random intervals output at a regular time interval from the table (and continuing on through your patcher to generating notes).

playing intervals in order

To play intervals in the order stored in the table you need to use a counter object. The counter object will count from zero to a maximum that you specify as the argument. The argument to counter should be one less than the argument to random to match your table locations. Make a second connection from the button that triggers the random object, connecting the button to the counter. Connect a number object to the appropriate outlet of the counter, and then connect the number object to the table (like you did with the random). Turning on the metro should cause the counter to output 0 to the argument maximum in a repeated cycle. You will hear two notes at a time, with the counter and the random both sending number locations to the table.

switch between counter (ordered) and random (unordered)

You will need a ggate (graphic gate) to switch between ordered output and unordered output. You place the ggate between button (connected to the metro) and the counter/random objects. To make this insertion, delete the connections from the button to the counter and random objects. Add a ggate. Connect the output of the button to the right inlet of the ggate. Connect one output of the ggate to the counter and the other output to the random. Now you should be able to turn on the metro and hear only the ordered output from the counter or the unordered output from the random. Click on the ggate to switch between the counter and random.

turning on playback using key velocity

Since a toggle object will turn on when it receives a non-zero number, and turn off when it receives a zero, we can use key velocity from our MIDI note input to control the toggle.

Add a number object, and connect it to the key velocity outlet of notein. Don’t connect it to stripnote, as that will only pass note-on key velocities. Connect the number to the toggle.

The patcher should now function as specified. When you play a note on a MIDI keyboard the arpeggiator should start, It will trigger intervals either in an ordered or unordered way depending on how the ggate is set, and it will stop playing notes when the MIDI note is released.


Comments

One response to “(max) assignment 1 – build an arpeggiator”

  1. […] use patcher (p), send (s), and receive (r) objects to create a cleaner looking version of your arpeggiator patcher. You should also add external MIDI CC control of durations, using ctlin and scale, and add […]

Leave a Reply