• ### Conditional expression that doesn't work.

Hi,
I’m puzzled by a conditional expression that doesn't work at all.
My purpose is to make changing envelope for a granular experimentation.
I have try multiples ways to write it, nothing seams to work correctly.
This is the selected condition :

Condition.pd
If you could help me to resolve this problem or redirect me to a post where this kind of problem was solved, I will be glad. Thank you.

• Posts 9 | Views 1253
• @FredIR I can't follow your patch, but I bet the arguments are coming into [expr] in an order you did not intend. Do this: disconnect that [expr] and connect 3 different [print]s to each of those connections, e.g. [print f1], [print f2], [print f3]. See if it prints in the order you expect.

• Thanks jameslo
Good idea,
but even that the out put of the first expression conditional is a list of numbers as expected,
the second expression conditional just out put one zero every time.
But if I enter two messages [1( & [2( in order to check the output, it works just fine.
I really don’t understand this behavior...

Edit: Sorry jameslo I just forgot to bang the second expression so it gave me just the first number witch is always zero.
Once again sorry.

• @FredIR said:

Edit: Sorry jameslo I just forgot to bang the second expression so it gave me just the first number witch is always zero.

Bang the expression? When I tested the expression, all it required was for a number to come in the left most inlet. I think a bang would be equivalent to inputting that same number again (which to me is more evidence that the inputs aren't coming in the order you think they are).

• @jameslo Yes you are right, but as I use a bang on every number I need, it works.

Envelope.pd

Thanks again.

• @FredIR a piece of advice, always use [trigger] and never use fan out connections like you do here. Your [inlet] for example, goes to at least four other objects, and it's impossible to tell where it goes first and where it goes last. Besides, it is prone to error.

• @FredIR Good advice from everybody......
I put this on the forum a while ago..... https://forum.pdpatchrepo.info/topic/13320/welcome-to-the-forum
It is quite essential reading for anyone starting with Pd.
It is certain that your messages are arriving in the wrong order, and as @alexandros says, we can have no idea where the error could be because we cannot know in which order you connected the objects (we can, by reading the text version of the patch, but it would take a while to then rebuild it with triggers so as to make it readable, and our heads would be spinning)....

So \$f1 arrived before \$f2 or \$f3 and by adding a bang to your order of operations after they have arrived you get the correct answer, but you are lucky that the object banging that bang received its data late enough for the solution to work.
David.

• @FredIR you might want to check IOhannes' punish plugin. It can help solve a fan out connection. https://git.iem.at/pd/punish

• @alexandros & @whale-av Thanks for those good advice, from now one I will use [t b b] in order to check my patches. and i will try to simplifies the patches I'll post in order to be more readable.