Another run at an 8x8 Keypboard Pad

Discuss Lemur and share techniques.
Post Reply
electrofux
Regular
Posts:297
Joined:24 Jan 2012 18:22
Another run at an 8x8 Keypboard Pad

Post by electrofux » 26 Jun 2014 14:14

I am struggling to make this work. An 8x8 pad object that behaves like a Keyboard but with access to the state of the Pads as variables (Pad Numbers pressed/not pressed).
I had the keyboard part working with custom Midi with the help of the community but i quickly realized it doesnt get me any further because i also need the Pad Numbers because i want to display and calculate different scales and input notes into an arpeggiator.
So it needs to be done with scripts and here i get lost with arrays, nonull, array-last_array and stuck notes.
Is there an obvious solution that i have missed.

mat
Regular
Posts:127
Joined:08 Dec 2011 09:21
Location:Germany
Contact:

Re: Another run at an 8x8 Keypboard Pad

Post by mat » 02 Jul 2014 17:06

Hey,

not sure if that fits for you, but Scalomat is a defineable pad-keyboard where you can make an 8x8 matrix. It is also nice as import for an arpeggiator as it has a hold mode... output of pads should be pads.x as vector (but note of pads will refer to the scripting)
see video here: https://www.youtube.com/watch?v=nHJqe7rypfs
Scalomat in user area here: https://liine.net/en/community/user-library/view/419/

greetings*mat
Lemur modules and sequencer: http://music-interface.com
Setup: Win7professional 32bit, Intel Core 2 Duo @ 2,66 GHz.,Tascam US-144MKII, Ableton Live 8.4,
Arturia Analog Lab., Max/Msp, Maxforlive, Lemur Legacy + Ipad, Akai MPK61, Doepfer Pocket Control

electrofux
Regular
Posts:297
Joined:24 Jan 2012 18:22

Re: Another run at an 8x8 Keypboard Pad

Post by electrofux » 02 Jul 2014 22:51

One of the reason i need a single 8x8 pad object is that it is going to be scaled in size in the template i plan to put it in. Also i want to save space.
I have a version with single pads working but it gets big in size pretty quickly when adding scripts to each pad.

Edit: Oh just realized this is a newer version, isnt it? Looks good, investigating :)

electrofux
Regular
Posts:297
Joined:24 Jan 2012 18:22

Re: Another run at an 8x8 Keypboard Pad

Post by electrofux » 04 Jul 2014 10:02

It is a very cool template. Pretty spectacular update. But i don't think i can use it for what i have in mind because it produces the notes via a custom Midi.

An 8x8 padobject with a custom Midi acting as a keyboard is super slim and when i first wanted to do this it was quickly solved (with help form the forum). So i thought it might be an equally easy thing to translate the custom midi to a script but until now i fail at handling the arrays so that i dont get stuck notes.

Btw, this was the thread which brought out a custom midi version:

https://forum.liine.net/viewtopic.php?f=32&t=4079

Traxus
Regular
Posts:216
Joined:30 Nov 2012 06:19
Location:Detroit
Contact:

Re: Another run at an 8x8 Keypboard Pad

Post by Traxus » 14 Jul 2014 20:20

Hi, not sure if this is what you were having trouble with, but to get the press states of the pad object, you can place an on expression script inside the given object with something like this:

Code: Select all

//-----setup lastX as a custom expression within the pads object
//-----script execution: on expression: x

decl i;

for (i = 0, i < sizeof(x); i++;) {
    if (x[i] != lastX[i]) {
        //-----this pad has changed states
        if (x[i] == 1) {
            //-----this pad is currently held down, fire noteon()
        } else {
            //-----this pad is not currently held down, fire noteoff()
        }
    }
}

lastX = x;

you'd have to do some additional tracking to tell if a given pad had *changed* states or else lemur will re fire the noteon / noteoff for every pad, each time *any* of the pads change states, so we use lastX to track the previous status.

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: Another run at an 8x8 Keypboard Pad

Post by oldgearguy » 15 Jul 2014 11:18

one thing I do for basic note on/off is use the same message for both and in the velocity parameter use (x*127) since if the pad/button is pressed, x will be 1 and you'll get full velocity (note on) and if it is released, you'll get 0, which gives you note off. You can get more clever and instead of a hardcoded 127, make that a variable as well.

In any case, it saves writing a bunch of if/else code to handle button press/release.

electrofux
Regular
Posts:297
Joined:24 Jan 2012 18:22

Re: Another run at an 8x8 Keypboard Pad

Post by electrofux » 23 Jul 2014 20:26

Alright, i will try this out, sounds good. thx.

Post Reply