Page 1 of 1

help with Pad arrays

Posted: 05 Jun 2013 20:54
by whatisvalis
Hi,

Wondering if the following concept is possible or if there is another way you guys can help me achieve this:

I have a number of Pad arrays that send CC msgs (to change articulations for different libraries).

What i want to do is when you press the transport record button (via lemur) it also sends out the CC of the currently selected pad array. Since there are a number of different arrays could I use a monitor for each array that shows the selected CC, and then have the record button get the value of the active array and send it as a CC msg?

cheers,

JD

Re: help with Pad arrays

Posted: 06 Jun 2013 06:13
by Softcore
You can "store" the currently selected pad (CC) in a global expression.

Then, upon tapping the record button, you can set up a scripted output or custom expression that will re-send that stored expression value.

Re: help with Pad arrays

Posted: 06 Jun 2013 17:33
by whatisvalis
Thanks for the input, that's the set-up I was trying to imagine, but what expression would i use to store the last CC sent?

Re: help with Pad arrays

Posted: 06 Jun 2013 17:38
by Softcore
Ok, let me understand! Do you use lots of Pad objects or only one with many rows/columns?

Re: help with Pad arrays

Posted: 06 Jun 2013 17:48
by Softcore
Here's an example with one Pads object with 16 pads.... ;)

Re: help with Pad arrays

Posted: 07 Jun 2013 00:46
by whatisvalis
Thanks Softcore, that's super useful to know. I love examples like this.

i might come back to this once my template is finished, it's a concept I need to test to see if it makes any sense adding.

Re: help with Pad arrays

Posted: 07 Jun 2013 08:45
by Softcore
By the way, for the purpose of learning and studying, here's a different approach - the expression is defined locally (therefore there is no need for a script in the Pads object) although I really cant tell which approach is more memory-cpu efficient.

Re: help with Pad arrays

Posted: 07 Jun 2013 13:32
by whatisvalis
Do you just add the :lastCC to close the statement since <16 will always be true?

firstof(Pads.x)<16?firstof(Pads.x)+21:lastCC

Re: help with Pad arrays

Posted: 07 Jun 2013 13:45
by Softcore
Its not always true!

You see, when no pad is pressed, the firstof(x) returns the size of the x array so when you release your finger off the pads, lastCC would become 16 (size of Pads.x) + 21.
The reason this was not required in the initial script (my first approach) was because it was set to execute on x rising from zero (so it wouldnt be executing when a pad was released).

So in essense the above statement says

firstof(Pads.x)<16?firstof(Pads.x)+21
if firstof(Pads.x)<16 (if ANY pad is pressed) then lastCC = firstof(Pads.x)+21

:lastCC
else (if no pad is pressed) lastCC = lastCC (it retains its current value)



;)

Re: help with Pad arrays

Posted: 07 Jun 2013 13:51
by whatisvalis
ah, cheers!