SuperBrain (Multi Engine Midi Sequencer for grid & LP X)

SuperBrain

SuperBrain is a five track sequencer with configureable sequencer engines per track. Each track can send note information to external gear via midi or to the internal sc engine. Notes can be send in mono, poly, or in fork mode.

This script was born out of the necessity to control hardware gear via a central interface. SuperBrain combines “structured midi recording” with “generative sequencing” possibilities.

The script itself is based on my personal workflow as well as on the direct inspiration and indirect influence from this wonderful community with its creative spirit.
Hence it contains scaled down variations of community scripts such as meadowphysics, classic approaches such as step sequencers and midi loopers each with their own twist.

Requirements

norns &
Launchpad X or
monome grid (thanks @Quixotic7)

Setup Norns

  1. in SYSTEM > DEVICES > MIDI select Launchpad X 2 in device slot nr. 1 (make sure to select ... X 2 since this is used for the programmers’s mode)
  2. the devices in slots 2-5 are referred later to as usb devices, select any usb midi device which you want to later control from the script (if you use a grid instead, use slots 1-4 for usb devices)
  3. When you run the script, the norns should automatically detect if a Launchpad X is attached, otherwise it assumes a grid is used instead.

Documentation

The documentation will use the following short notation for grid interaction:
*: click
**: double click
: hold
*
: click followed with hold

[M]: main engine area (x:1-8; y:1-4)
[K]: main keyboard area (x:1-8; y:5-8)
[S]: side area (x:9; y:1-8) == Launchpad side row
[T]: top area (x:10; y:1-8) == Launchpad top row

Thus, the notation _ [K] ** [M] reads: hold button in keyboard area, then double click in main area
For both [S] and [T] adding a number notes the specific button in the area. * [S1] reads: click first (y=1) button in the side area (x=9)

Main Architecture

The grid is devided in three main parts: (1) top row = global functions, (2) upper half = sequencer engine, (3) lower half = isomorphic keyboard.

The top row of the Launchpad is used for global functions:
*[T1]: play all tracks
*[T2]: stop all tracks

_ [T3] * [M]: select preset slot
_ [T3] _ [M]: save to preset slot

* [T4-8]: select track
_ [T4-8]: edit track options (sequencer engine, midi target, usb device, midi mode, midi channel)
** [T4-8]: reset sequencer engine of track

The norns UI is only used to support the grid interaction. No changes to the sequences or to the engines can be made directly from norns. However, the UI depicts helpful information to provide feedback during the usage.

sb_main_view
The main view shows the symbol of the current sequencer engine in the center of the screen ("’#" = Quantum#Physics). The number in the right corner indicates the selected track, and in the left corner the global transport (play/stop) is shown.

sb_help
When holding K2 the “help” view is shown and E1 navigates through the different help entries.

sb_overlay
Many of the actions performed on the grid produce a short UI overlay to show the change made to the sequencer engine.

Sequencer Engines

Quantum#Physics

is a scaled down version of the famous meadowphysics script. This version offers 4 “rhizomatic cascading counters”. Rules and ranges are not implemented.

* [M]: start counter from or jump to value
** [M]: stop counter

* [S]: start or stop counter

_[S]: set speed and resets for counter
_[S] *[K]: set note

Graph^Theory

is a graph sequencer with 4 playheads. The 32 vertices are connected via individual edges. In the default configuration the vertices form a traditional 32 step sequencer, meaning each vertex is only connected to the next vertex. If a vertex contains multiple edges, the playhead follows a random edge.

** [M]: clear notes in vertex
_ [M] * [M]: set/remove edge
_ [M] * [K]: add/remove note
_ [K] * [M]: add/remove notes

* [S]: de/activate playhead
_ [S] * [M]: playhead jump to vertex
_ [S] _ [M]: set reset vertex

*_ [S1]: playhead speeds

Time~Waver

is a 4 loop midi looper with time filtering. The midi notes are recorded to a fixed 16th note quantization and the loop length can be quantized to the multiple of a chosen value or to the note quantization. Each note stores its order of appearance which can be used to filter early or last added notes (called time frame). This allows to temporarily filter, e.g., early overdubs or to define a time window through which notes are pushed when new notes are added.

* [M]: start empty loop and set length to multiple (x) of the loop quantization value
* [S]: start/stop empty loop or arm existing loop
** [S]: clear loop

_ [S1]: show time frame per loop
_ [S2]: show loop quantization

Download

Installation

;install https://github.com/BeatRossmy/SuperBrain/
* This command is taken from another norns script page, but wasn’t verified yet.

To-do’s:

  • monome grid support (thanks @Quixotic7 !)
  • check code for launchpad pro compatibility (left and bottom row)
  • set default velocity for non-velocity sensitive grids
  • more sequencer engines
  • maybe small softcut scripts?
33 Likes

This is super cool. I’ve been holding out but I may have to break down and get a launchpad now. Great demo!

Wow! time to build another norns diy? I have an unused launchpad.

currently it is launchpad X support only, since i make use of some of the new features such as fading and blinking LEDs. but my plans are to make it work with older launchpads and the monome grid (which should already work in theory, do not own a grid to test it in person). what version of launchpad do you have in mind? launchpad S or a newer one?

2 Likes

I really enjoy the velocity sensitivity and especially together with digitakt and digitone it unlocks quite some expression in theses machines. it is possible to play the digitakt as a polyphonic sampler with the help of the fork feature.

1 Like

Will it work with launchpad pro mk3? It seems to have all the same features of X if not more.

I was thinking of getting a mini mk3, no velocity or pressure sensitivity, but that is ok; I’m not much of a player.

I checked the reference it looks like it should work. however, i have to look through the code and exclude the left and bottom rows. Not sure what will currently happen if you use these.

But give it a try and send me some feedback! I will make it work.

I was also thinking about getting one, since I like the smaller form factor quite a bit. From checking the manual it looks totally fine and should work at the moment straight out of the box.

One thing I plan to add is the possibility to set the default velocity since neither the monome grid or launchpad mini send velocity. currently they would generate 127 velocity values, which is probably not so nice to listen to.

Currently does not seem to work at all. Are you using midigrid?
Edit: it seems to register pressed pads but there is no visual feedback

@kveye i am not using midigrid. Have you selected Launchpad X 2 as the first midi device? can you post the errors in the maiden console, if there are any.

Sorry for the trouble and thanks for the feedback.

As I previously asked I have pro mk3. So I can’t select X :slight_smile: I selected pro mk3 1 as it seems to work with scripts supporting midi grid. And only this device seems to work for input here. There is something not working on the feedback

Also nothing happens if I press left and bottom row, so not sure if that needs additional handling

@kveye found the problem, the mode change message is slightly different for launchpad pro … I will fix that and send you a message if I (think I) resolved the problem.

thanks for the interest in the script! if you are comfortable to try to fix the problem locally you can try to change line

  msg = {240, 0, 32, 41, 2, 12, 14, mode, 247}

to

  msg = {240, 0, 32, 41, 2, 14, 14, mode, 247}

in SuperBrain/lib/grid/LP_X.lua line 66

Not sure if the problem is there
Here is matron output when I press a pad.

lua:

/home/we/norns/lua/lib/util.lua:130: attempt to compare nil with number

stack traceback:

/home/we/norns/lua/lib/util.lua:130: in function ‘util.linlin’

/home/we/dust/code/SuperBrain/lib/grid/LP_X.lua:132: in field ‘event’

/home/we/norns/lua/core/midi.lua:408: in function </home/we/norns/lua/core/midi.lua:398>

ok that is strange, based on the log I would assume that data[3] is nil in you case, but all midi messages consist of three bytes …

can you change in SuperBrain/lib/grid/LP_X.lua line 130
if not pos then return end
to
if not pos or not data[3] then return end

@kveye what pad have you pressed? sorry for the trouble, but i would really like to help you make it work with the launchpad pro …

No trouble at all.
The messages pop up in log when I press pads in M area. Also I tried playing with it and the keyboard seems to produce sound but I wasn’t able to sequence anything. Also wasn’t able to make visual feedback to work, no pads are lit.

Maybe looking at how midigrid works or using it altogether would help? It seems to already handle differences between launchpad models.

that is true, I decided to not use midigrid, since I wanted to make use of the full led abilities of the newest launchpad generation (set color as full rgb value → smoother varibrightness and auto fading LEDs). But maybe I have rethink that, since it would make the use of many different devices possible.

@kveye can you change SuperBrain/lib/grid/LP_X.lua line 111

msg = {240,0,32,41,2,12,3}

to

msg = {240,0,32,41,2,14,3}

I hope that will make the difference, now both messages (enter programmer mode and LED lighting) should be adapted to launchpad pro mk3 sysex.

You are welcome to steal just the device configuration from midigrid. Check out the better_aux branch at https://github.com/jaggednz/midigrid/blob/better_aux/ I started to try to standardise the auxiliary buttons.

I’d also welcome any PR’s that make RGB easier to implement for scripts like yours, as I’ve mostly focused on wide device support and keeping parity with the monome grid.

The general direction I was working in is to allow extending scripts to utilise the auxiliary buttons on the lp’s and push devices. I was struggling to formulate a “context” api that I’d be happy supporting and I’m on a bit of a hiatus because of life, working on other scripts and new gear.

Thanks for that! I will have a look and try to optimize my code. To explain my objectives, I was also thinking about keeping th LP X code as compatible with the normal varibright grid, therefore I am currently using the RGB feedback only to generate more brightness levels than typically available with the standard color table. further I added the possibility to add "fade" as a fourth parameter in led() so that you can specify if the led should auto fade. Further I added some logic to only update changed pixels to keep traffic as low as possible.

This looks like an amazing script - thanks!

If I understand correctly, it does not currently work with midigrid devices (i.e., Launchpads prior to LP X), though - is that correct?