Difference between a script and an expression?
-
- Newbie
- Posts: 7
- Joined: 18 Mar 2016 03:34
Difference between a script and an expression?
Hi there, I'm new to scripting and scripts and expressions look the same. What is the difference between these two?
Re: Difference between a script and an expression?
An "expression" is a variable Lemur constantly knows its value (roughly).
So an expression could be:
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:
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.
So an expression could be:
Code: Select all
k = 25
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:
Code: Select all
w = 1-x
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.