Conditional statements with multiple pads that stay active

Discuss problems and solutions.
Post Reply
1000errors
Newbie
Posts: 18
Joined: 13 Dec 2011 15:27
Location: The Netherlands
Contact:

Conditional statements with multiple pads that stay active

Post by 1000errors »

Hello,
sorry if this question has been asked and answered before but I've really searched well for this before asking.

I am trying to create a conditional statement that needs two conditions to be met before carrying out an action.
This part I can do and it works fine, but this is the tricky part, the conditions need to set by the last active values of 2 sets of pads.
Not their current value but the last time they were pressed (and I can't use switches either)


I have my first set of pads which are labbelled "Follower1" and "Follower2"

My second set of pads are labelled "MBall x" and "MBall y"

I also have 2 faders called "follower 1" and "follower 2" and 1 multi ball.

How I would like this to work is I press and release the pad called "follower1" and then press and release the pad called "Mball X" and then the x value of the fader called "follower1" is equal to that of multi ball's x value. The rest should be self explanatory.

This is fairly basic stuff and all works in the example I have included bar one massive problem..
I need to keep my fingers pressed down on two pads all the time in order for this to work, obviously this is completely impractical.
Does anyone know the solution?

Many thanks in advance! Olly


The script I have written (executed on frame) is:

if(Pads.x[0])
if(Pads2.x[0])
{
Follower1.x=MultiballA.x;
}
if(Pads.x[0])
if(Pads2.x[1])
{
Follower1.x=MultiballA.y;
}
if(Pads.x[1])
if(Pads2.x[0])
{
Follower2.x=MultiballA.x;
}
if(Pads.x[1])
if(Pads2.x[1])
{
Follower2.x=MultiballA.y;
}
Attachments
conditional statement requiring 2 pads to be pressed.jzml
(16.52 KiB) Downloaded 68 times
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Conditional statements with multiple pads that stay acti

Post by Softcore »

You have overcomplicated things, I reckon....

Do you need toe faders to take snapshot of the multiball or keep movign along with it (when the conditions are met)?

Why not use switches?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Conditional statements with multiple pads that stay acti

Post by Softcore »

Anyways....here's one way to do it!
Attachments
conditional statement requiring 2 pads to be pressed-fixed.jzml
(17.96 KiB) Downloaded 79 times
1000errors
Newbie
Posts: 18
Joined: 13 Dec 2011 15:27
Location: The Netherlands
Contact:

Re: Conditional statements with multiple pads that stay acti

Post by 1000errors »

Hello,
first off, thank you very much for trying to help!!!
but unfortunately your method does not solve my problem.

Perhaps it would help to explain what I am trying to achieve, I'm new at scripting using the lemur app so maybe you are right and I am in fact over complicating things.

My intention is to create a sort of modulation patchbay for controlling live visual software with float values generated internally in the lemur app.

My idea is to have 3 sections.

Section 1) I will have a series of faders that are pre assigned to control parameters in my visual performance software. These will be the only thing in my lemur template that send any osc data out of the lemur patch. (named follower 1,2 in my first example)


Section 2) This will consist of objects that create constantly changing float values, (multi ball x,y in my example), but I will also include step sliders, lfos and lots more.
This section will not send any osc float values out of the software directly.

Section 3) My 3rd section is basically what connects the first 2 sections.
This section will consist mostly of pads with pop up menus (based on AB PadMenu)

My first set of pads with be named things like "layer opacity" "layer hue" "layer size" "glitch amount" ---- these correspond to the names of the faders in section 1 which in turn correspond to the names of the parameters they are mapped to control in my visual software.



*THIS IS THE PART I AM ASKING FOR HELP WITH
These first set of pads will be used for selecting a parameter in my visual software that I wish to add some modulation to. (buttons are named follower1,2 in my first example)
once one of these pads has been pressed a second set of buttons "pop up menu" will appear in a container (based on AB PadMenu)


now this second set of pads will be used for choosing what modulation source (from section 2, multi ball x or y or an oscillator etc) will then be routed to control the currently selected fader.x value in section 1, which will then in turn modulate the corresponding parameter in my visual software.

The solution that has been offered although works to some extent bt it does not allow me to have follower 1 following multi ball x whilst simultaneously follower 2 follows multi ball Y, this is essential for what I am wishing to achieve and for the *pop up menu system that i wish to have will require the buttons to be pressed in the order I previously stated.

I have created another example of what I am wishing to achieve, and although it works fine for 2 parameters (eventually I wish to have literally hundreds of parameters with the ability to route different modulation sources to control them which with) the current method requires a separate *pop up menu per parameter which is not very convenient and seems like it will be a very inefficient way of doing this.

*when i say pop up menu I mean a hidden container that has pads or switches that becomes visible when a separate button from outside of the menu is pressed


Which is why I want just one pop up menu that has different actions based on which of the previous parameter button was pressed first.

I hope I have explained this well enough, and that someone may be able to help.

Many thanks in advance!
Olly
Attachments
modulation patchbay demo.jzml
(21.44 KiB) Downloaded 70 times
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Conditional statements with multiple pads that stay acti

Post by Softcore »

Ok I have seen your second example and its clearer what you want to achieve and its also clear that even though your example works - its not what would be prefered for a multitude of assignments.

You need to think in a very, very different way.....your "pop up" menu SHOULD define an alltogether different array and this array would be then the "basis" on which the on frame conditions will be met or not.

I'm a bit busy for the 2 following days, but I can mock you up an example on Thursday if anyone else doesnt catch up! ;)
1000errors
Newbie
Posts: 18
Joined: 13 Dec 2011 15:27
Location: The Netherlands
Contact:

Re: Conditional statements with multiple pads that stay acti

Post by 1000errors »

Great! thanks very much for taking your time to help me.
I look forward to your reply! :)
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Conditional statements with multiple pads that stay acti

Post by Softcore »

I avoided the onFrame script - I always avoid them, when possible. Explanatory text is where your notes were...The menu object is now only one - and it can stay one, regradless of how many source modulations or modulations you plan on adding. You will need to edit the scripts though and add some more variables and text objects if you plan to expand on the idea - I hope my text notes make it comprehendable....if not - ask here!
Attachments
modulation patchbay demo-fixed.jzml
(24.26 KiB) Downloaded 82 times
Joe Soap
Regular
Posts: 462
Joined: 07 Jul 2012 15:04

Re: Conditional statements with multiple pads that stay acti

Post by Joe Soap »

Those are some badass variable names dude! ;)
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Conditional statements with multiple pads that stay acti

Post by Softcore »

lol yeah, they were actually derived from the word "assignment" but then I saw it....oh well....
Post Reply