General
help with Pad arrays
Started by whatisvalis on .
Sign in or create an account to join the conversation.
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
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
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.
Then, upon tapping the record button, you can set up a scripted output or custom expression that will re-send that stored expression value.
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?
Ok, let me understand! Do you use lots of Pad objects or only one with many rows/columns?
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.
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.
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.
anything_can_be_an_expression-noscript.jzml
anything_can_be_an_expression-noscript.jzml
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
firstof(Pads.x)<16?firstof(Pads.x)+21:lastCC
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)

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)
ah, cheers!