(using the case of Magic Tone Network layout)
Launchpad Pro with its velocity sensitive pads and polyphonic aftertouch is quite a cool option to use as an input device for playing melodies and/or chromatic percussions.
LP Pro's firmware even provides so salled „note mode“ right for that. But I don't like the implementation, because it tries to mimic piano-style keyboard (which has linear) structure using the rectangular grid (which is obviously not linear). Piano-style keyboard has some keys between other keys, and this may be implemented well with a hexagonal matrix, which similarly has some cells between other cells (like in AXiS-49 controller), but not in rectangular, which is fretboard-like. So, in case of Launchpad-like devices, fretboard-style layout is better option.
Fortunately, there's a man named Andreas Samek, who is probably a genius, and invented an excellent note layout system for Launchpad and similar controllers with rectangular matrix. It's called Magic Tone Network and explained here:
This patch implements MTN layout, but the custom object used for it allows to set any custom layout by entering output note values for every pad.
Original MTN solution involves software layer (and even worse, proprietary software not available for Linux natively.) With Axoloti, one could design a solution that behaves as hardware-only. So, I decided to implement this, and to be happy with all my hardware modules and DAW-free setup.
If you've seen the video above, you've got the concept how the patch works. But for better understanding, see this table:
By default, you're in the centre of the table (8x8 area with red font). Root notes (C) of every octave are highlighted.
With LPPro arrow keys, you can shift the playable area around. One pressing of a Left or Right key shifts it 2 columns on the left or right respectively, until the counter reaches its minimum or maximum. Counter values from 1 to 9 are available on the edges of the table for reference.
Up and Down keys just transpose all notes in the playable area, one octave per pressing, until the counter reaches its minimum or maximum. Vertical counter values are available for reference too.
The colors of the arrow keys are changing according to the counters, for easier understanding where on the table we are.
The main patch handles playable area shifting, arrow keys and root notes highlighting. The polyphonic subpatch handles note input and visual feedback for it, highlighting not only a pressed pad, but also another appearance of the same note on the playable area. With polyphony set to 12 (for hexadactyls?), the whole thing eats something between 6 and 7% of DSP, which is not so bad, i think.
There are totally 4 objects with device attribute for MIDI output, 2 in the main patch and 2 in the subpatch. One should pay attention how they are set, since Launchpad Pro can exchange MIDI data either via USB or MIDI DIN (just like Axoloti). Also the proper target for note output should be set inside the polyphonic subpatch (since fancy LED blinking is probably not the only thing you want this patch for). This will be improved in the next versions, since 4 is definitely too many and not convenient.
This version of the patch does not contain any sound generation objects inside, only MIDI input/outpt, because i designed it primarily for use with hardware synths. But you can easily add sound generation stuff to the polyphonic subpatch, if you need.
Finally. Working on this patch, i've made a bunch of custom (embedded) objects. The pieces of code written by me may be suboptimal, horribly suboptimal, or even scare you. That's because at the moment my C knowledge is limited to 4 or 5 lessons for beginners, so i can't use tables, arrays, bitmasks and other cool stuff. I also can say in my defense that the code works however
And here it is:launchpadPro_magicToneNetwork_20180821_final_beta.axo (101.4 KB)