If you wanted to make the note player more robust, you could use more complex programming for the output scaling, or you could build a secondary grid system for note selection. In this case, though, I just wanted a sequencer that would work simply and musically, so I went down the path that I did. To tidy up the patch before I begin the next section, I again encapsulate everything specific to the note generation and end up with a tight little patch:

Creating the Gate Subsystem
What we have now is a pretty credible step sequencer – 64 notes that play based off of a 4×8 grid of rotary controls, and all coerced into a nice little pentatonic scale. But there are two parts of the hardware that we can use to make it even more interesting: the per-step LED, and the push-button switch built into the rotary controller. What we will do is to use the switch to set the gate for each step, allowing us to make more interesting phrases from our step sequences.
The switches are MIDI note producers, using the note numbers that match the rotary controller numbers. The LEDs are note-receivers, following the same note number map. So grabbing the incoming note information (and sending note information) will allow us to manage the entire gating grid.
The output of the switches is [note number, velocity], where the velocity is 64 if pushed down, and 0 if released. Since we don’t want to have to hold down an encoder to hear a step, we need to change this functionality into a toggle-like output. Probably the easiest way to do this is to literally use a toggle object, looking for a velocity of 64 as an indication of a switch press. We also need to turn the LED on or off based on the toggle value. Thus, we make a little fixture that we can use for each row’s grid system.

Now, if we use four of these fixtures for the four rows of the Code, we have a grid system ready to go. We need to connect it to the clocking system we created earlier, and we should be able to get gates out as the sequencer steps through the 64 stages. The last thing we need to do is to route the output to the MIDI note producer, so that only steps with their gates on will be output.

Finally, we wrap this up into another encapsulation (subpatcher), add a few comments, and we have a top-level patch that is simple and ready to use:

Again, there are many ways that you could expand this sequencer: you could add a preset system, you could find a way to control the tempo with the hardware, or you could build in a system to select specific steps during performance.
In our next article, we are going to turn to Peter Nyboer, the chief programmer at Livid Instruments, to take the hardware connection even further. In the meantime, use, expand and tear apart this patch, and have a blast!
Love the Code (I kill on the OHM64) and love Max (in the studio). I wrote a web-app that writes Python for control surface scripts (Ableton) available here : http://modern.dj/app/ – we are adding new scripts asap as they are written. Tight code FTW!
Will this work in MAX for Live? Not sure how to load up the patch. New to this game.
Thx. Very useful tutorial, even to other hardware devices.
Hi All,
Great tute,
As I don’t have an actual CODE, I decided to make up a Lemur version of Livid’s CODE hardware MIDI controller . . .
Version 0.9 beta uploaded to Liine Library – http://liine.net/en/community/user-library/view/167/
Seems to work with your CodeSequencer, which was the point of the exercise, as well as a bit of fun . . .
It should mimic the hardware’s MIDI messages – switches hidden under leds rather than knob/push-switches on hardware . . .
Proof of concept only – may not be coded the best, will need to review it at some point. Will probably ‘pimp it out’ later . .
Cheers
MM
Oh, this is lovely..ive been working at a sequencer of my own for my code..but i love this soo much more..i love the idea of the lights on the bottom being the running lights with the left lights showing which row so you can use the leds under the encoders to indicate gates..now i just have to figure out how to get some layers or something..for velocity..and note lenght and so on..would be lovely..but im pretty worthless at max..my sequencer uses the live.step object since it already has some of this..but still its…really messy..this is..tidy..its..wow..xD
Another thought on layers would be that different layers could also have different encoder push functions..like say glide on the pushbutton on the lenght layer or something..
Also have a question about that number 4. “Click on the smaller buttons to jump to a specific step.”
whats up with that function..cant find anything that does that in the patch..?…is it something for later?..
Thanks Darwin, it is thanks to people like you that we still have time to compose music.
Hi,
Marc your web app tip is very useful.. Thx
i searched for a Programmer they can add funtion to a remote script of my Livid Code controller…
Please I need a tip to find people they can created a script for me…! Money logo no problem !
Thx
wfg S.R.
will this patch work with Max 5? (my guess in “nada”) – thanks
Leave a Reply
DISCUSSION
8 Comments