General
Difference between a script and an expression?
Started by Zacky_Momo on .
Sign in or create an account to join the conversation.
Hi there, I'm new to scripting and scripts and expressions look the same. What is the difference between these two?
An "expression" is a variable Lemur constantly knows its value (roughly).
So an expression could be:
Further down the line, you might meet expressions which are not defined in a fixed way like above but feature yet another mathematical expression.
For example in a Pad object you can create an expression w and set it so that:
For example, now provided that x = 1 when a Pad is pressed, x = 0 when a Pad is released, then w will be the exact oposite of x so you could for example midi map that w expression and have a Pad send TWO values inverted, to switch on something in your mapped device - software and off something else at the same time.
Read cautiously the User Guide of Lemur and you will understand more.
So an expression could be:
k = 25
With scripts you can perform mathematical operations on those expressions, and then use the resulting numbers as a way to manipulate other objects of Lemur or the actual midi - OSC output.Further down the line, you might meet expressions which are not defined in a fixed way like above but feature yet another mathematical expression.
For example in a Pad object you can create an expression w and set it so that:
w = 1-x
The main difference then in "coding" expressions and scripts, is that expressions can only have a "one-line" script in them, while scripts can be multi-lines and more complex. Also expressions could be also thought of as "bonus" midi mappable outputs for the objects they are created in.For example, now provided that x = 1 when a Pad is pressed, x = 0 when a Pad is released, then w will be the exact oposite of x so you could for example midi map that w expression and have a Pad send TWO values inverted, to switch on something in your mapped device - software and off something else at the same time.
Read cautiously the User Guide of Lemur and you will understand more.