Pads value

Discuss Lemur and share techniques.
nitefish
Regular
Posts: 56
Joined: 24 Aug 2012 07:43

Pads value

Post by nitefish »

Bonsoir.
I have a 16 pads object.When I monitor his values,I get an array like this :
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0},if I hit the fourth pad.
Is there a way to get a result as:
{row number,column number,boolean} ?

I'm sure it has been discussed but I cannot find the thread...
Thank you.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Pads value

Post by Softcore »

Not sure really but what if you use subarray function to create subarrays according to your columns - rows?
nitefish
Regular
Posts: 56
Joined: 24 Aug 2012 07:43

Re: Pads value

Post by nitefish »

thanks for the interest,Softcore.I was thinking about manipulating arrays.
I found the Thread I was looking for:

http://forum.liine.net/viewtopic.php?f= ... triz#p4987

It seems to give the right output,but I need to understand how it works before using it...
nitefish
Regular
Posts: 56
Joined: 24 Aug 2012 07:43

Re: Pads value

Post by nitefish »

I don't find a way...
The abMatriz module shows the right value {x,y},but this is a bit too "abstract art" for my actual scripting skill.(AB. Rulez!).
In the guide,Pads,Switches and leds are described as "two dimensional arrays" and I was sure this would be easy to find a solution.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Pads value

Post by Softcore »

Im still buffled as to what you are trying to achieve....meaning {row number,column number,boolean} is too abstract to begin with....what if more than one pad is pressed?

Also, how are your 16 pads arranged? how many rows - columns?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Pads value

Post by Softcore »

Im quite sure this is NOT what you asked, but it might help you get some ideas....

The monitor displays the row and column of the last pressed pad.....if you prefer Lemur logic (where the first row is 0 and not 1) then just delete the +1 in the declared expressions (Im sure you will understand once you see it)
rowsandcolumns.jzml
(3.3 KiB) Downloaded 124 times
nitefish
Regular
Posts: 56
Joined: 24 Aug 2012 07:43

Re: Pads value

Post by nitefish »

Softcore,you help me a lot.Thank you!
To be more precise.I need to build osc messages like this for SuperCollider
/Pads/row/column/value(0 or 1).
You are right,pressing more than one pad will be a problem :D ...
transposing this with non-radio switches too.

I' m just doing basic things with the Lemur since last summer .But now I want more,I want problems.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Pads value

Post by Softcore »

lol hear ya!

Ok so, the final question is...how often do you want the /Pads/row/column/value(0 or 1) to be sent? Im guessing, you want to "monitor" the value so you want a constant transmission? If so, you will be needing a onframe script which will send custom OSC messages constructed based on the logic already existent in my above example (to get rows and columns).

edit to add: well the logic needs some modfication to take into consideration of more than one pad pressed - obviously nonull and geting the size of the nonnull array will be needed
nitefish
Regular
Posts: 56
Joined: 24 Aug 2012 07:43

Re: Pads value

Post by nitefish »

bonsoir,
So,I can monitor in SuperCollider this address/message:
msg[/address/address,row value,column value]
but I cannot find how to monitor the boolean value (0,1).
The SC program is waiting for a message on this form:
msg[/address/address/row value/row column/boolean]
I think I can work on this on the SuperCollider side,but can we build osc addresses with variables in Lemur?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Pads value

Post by Softcore »

This should be very easy to accomplish by using the script above to set individual expressions for row, column and value and then the oscout(target, adress, args[]) function.

Unfortunately, I haven't worked with this function that much and Im not really sure how to implement it. I can't even get the correct syntax to make a testing template work.
Post Reply