diificulty to understand how to use the if then function
3 posters
Page 1 of 1
diificulty to understand how to use the if then function
I want to understand how to use the 'if' statement. Could I get some examples from the documentation page? I'm not quite clear on how to apply it.
For example, where I might use 'if':
In their example, I envision being able to use:
Also, if I add:
Something like:
I know this isn't correct, as I've read that it requires another variable to assist:
That's why I'm asking if it would be possible to have some more examples on how to use them.
Thanks !
For example, where I might use 'if':
- Code:
[(@StkTrkRc:2-12){state:0}{cc:15,71,0}]
In their example, I envision being able to use:
- Code:
[(#IF((@StkTrkRc >= 2) & (@StkTrkRc <= 12)#){state:0}{cc:15,71,0}]
Also, if I add:
- Code:
[(@StkTrkRc:0){state:0}{cc:15,71,0}]
[(@StkTrkRc:2-12){state:0}{cc:15,71,0}]
Something like:
- Code:
[(#IF(@StkTrkRc NOT 1)#){state:0}{cc:15,71,0}]
I know this isn't correct, as I've read that it requires another variable to assist:
- Code:
{@l_v:MAX(@e_ccvalue, 64)}{text:#MIN(@l_v, 25)#}
That's why I'm asking if it would be possible to have some more examples on how to use them.
Thanks !
lionoil- Posts : 43
Join date : 2022-03-03
Re: diificulty to understand how to use the if then function
I haven't looked at the IF statements since they are only a "side effect" of being a part of the math library I use to perform basic math calculations.
Without having looked into the details, I think the IF statements you describe in principle have the correct syntax, but IF statements cannot be used the way you describe since expressions of any kind (enclosed by # characters) can only be used in actions, not in events.
Without having looked into the details, I think the IF statements you describe in principle have the correct syntax, but IF statements cannot be used the way you describe since expressions of any kind (enclosed by # characters) can only be used in actions, not in events.
Re: diificulty to understand how to use the if then function
Thanks for the clarification!
lionoil- Posts : 43
Join date : 2022-03-03
Re: diificulty to understand how to use the if then function
Hi.
Could this if/then function be used to trigger actions when receiving a specific Mackie signal ?
In other words, can we link incoming midi to outcoming actions ?
Is there any link to some documentation ?
Is this function related to the deep-linking topic ?
Thank you
Could this if/then function be used to trigger actions when receiving a specific Mackie signal ?
In other words, can we link incoming midi to outcoming actions ?
Is there any link to some documentation ?
Is this function related to the deep-linking topic ?
Thank you
jacquesmk2- Posts : 17
Join date : 2024-01-17
Re: diificulty to understand how to use the if then function
I get a feeling you are overcomplicating things a bit. You don’t need if/then functions for most things since the script syntax is in itself a form of if/then. If this happens (the event), then do this (the action).
And yes, you can link incoming midi to outgoing actions; that is one of the main functions for scripts.
And no, it has nothing to do with deep linking.
If you, e.g., want to catch the Mackie Play command and send some CC when that occurs, you can do like this:
[(noteon:1,94, 127){cc:1,1,100}]
Syntax and examples are in the documentation; I don’t know if you are asking for something other than that.
And yes, you can link incoming midi to outgoing actions; that is one of the main functions for scripts.
And no, it has nothing to do with deep linking.
If you, e.g., want to catch the Mackie Play command and send some CC when that occurs, you can do like this:
[(noteon:1,94, 127){cc:1,1,100}]
Syntax and examples are in the documentation; I don’t know if you are asking for something other than that.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|