Difference between a script and an expression?

Discuss Lemur and share techniques.
Post Reply
Zacky_Momo
Newbie
Posts:7
Joined:18 Mar 2016 03:34
Difference between a script and an expression?

Post by Zacky_Momo » 18 Mar 2016 16:20

Hi there, I'm new to scripting and scripts and expressions look the same. What is the difference between these two?

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Difference between a script and an expression?

Post by Softcore » 18 Mar 2016 20:08

An "expression" is a variable Lemur constantly knows its value (roughly).

So an expression could be:

Code: Select all

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:

Code: Select all

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.

Post Reply