As always, before the practical part of a small review of the work ahead. To generate a melody using step sequencers, you need to set three things: the rhythm, the numbers and the duration of the notes. Usually, all this is set using a single matrix interface:
Here, the length of a note depends on the tempo and conditionally equals one step, and the rhythm and tonality are set simultaneously. But this is not our way. We will create our own small sequencer for each of the parameters.
Rhythm sequencer
Let's start with the rhythm. It is from it that the triggers will come to the other sequencers. So, let's create the Max MIDI effect and add the following objects to the new patch: multislider , counter and metro and connect everything as shown in the figure (rhythm1.amxd) : ')
I think the comments can figure out how everything works. Moving on. It is necessary to visually display the current position of the sequence. The slider object (rhythm2.amxd) will help us with this:
At first glance, it may not be clear why the range of the slider is 0 ... 17 , and not 0 ... 16 . The fact is that our rhythm is presented in the form of rectangles, and the slider is a strip that should coincide with the left edge of each rectangle. If the slider has a range of 0 ... 16 , the strip will shift noticeably, that is, the sequence position will not be displayed correctly.
It remains to make convenient management of the sequence boundaries, for which we will use the rslider object. It looks like a regular slider, only sets the range. It has two outlets: the left shows the minimum value, and the right maximum (rhythm3.amxd) :
Melody sequencer
The sequence of notes will be hammered into it. Let's create 16 live.numbox objects - this is an analogue of the Max object number , only has the appearance of the native interface elements live, as well as some other buns (about which later). So, we collect the following scheme (melody1.amxd):
I commented out the patch to the maximum so that it was easier to figure it out, so I think there is no need to thoroughly describe the work. If you have questions, ask them in the comments.
Note Length Sequencer
This sequencer is no different from the previous one, but instead of notes, live.numbox will set the lengths of notes in milliseconds in the range 0 ... 1000(length1.amxd) :
We put everything together and create MIDI messages.
So now we connect all this (mainseq.amxd) :
By default, standard gui max objects do not save their state with a live session, unlike guilive objects . * , Which is why pattr objects are connected to some interface elements.
This is almost all. It remains only to enter all the elements of the patch in the small space of the live device. To do this, select all the objects of the interface, right-click and click Add to presentation. Now you can turn on the presentation mode, where we arrange everything as convenient. Here's what I got (step-seq-pattr.amxd) :
Yes, here it is. When adding this patch to live, it opened in presentation mode, you need to open the patcher inspector, right-click on an empty place in the patch and check the box “open in presentation”.
At last
For completeness, this sequencer does not have enough velocity control, but this can be easily finished using the same multislider. It would also be nice to add a reset button to the initial position.