Page 1 of 1

Another run at an 8x8 Keypboard Pad

Posted: 26 Jun 2014 14:14
by electrofux
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.

Re: Another run at an 8x8 Keypboard Pad

Posted: 02 Jul 2014 17:06
by mat
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

Re: Another run at an 8x8 Keypboard Pad

Posted: 02 Jul 2014 22:51
by electrofux
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 :)

Re: Another run at an 8x8 Keypboard Pad

Posted: 04 Jul 2014 10:02
by electrofux
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

Re: Another run at an 8x8 Keypboard Pad

Posted: 14 Jul 2014 20:20
by Traxus
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.

Re: Another run at an 8x8 Keypboard Pad

Posted: 15 Jul 2014 11:18
by oldgearguy
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.

Re: Another run at an 8x8 Keypboard Pad

Posted: 23 Jul 2014 20:26
by electrofux
Alright, i will try this out, sounds good. thx.