General

How to make Text object showing numerical values?

Started by hodok on .

Sign in or create an account to join the conversation.

11 posts

In the "monitor" object properties look for the "value" input box. In there you put the variable you wish to be displayed - below it you can also put "units" (like dB or %, this is just a visual thing).

Here is an example of 4 monitors all displaying the x of a fader but in different types of "measuring" (raw floating value, percentage, negative-positive percentage, midi values (0-127). Also notice the "precision" functionality - with it you can set how many decimal digits you want displayed (or none if you put precision 0)

monitorexamples.jzml
Lets stick to Lemur terminology to better understand each other...so.....

Expressions (variables) can exist in Lemur as either
A. Custom expressions inside a project (root level of project) or inside an object. By tapping on the x= button a new expression is created and then you proceed by naming it, and then by defining a static value to it OR handle it with scripts
B. declare an expression in a script

Now, if your variables are of the second nature, i.e. you declare and manage them in a script, then they are "killed" when a script is finshed executing - in other words they cannot be displayed in a monitor, in fact their whole existence is strictly related to the functionality of the script and that only.

At this point you either create custom expressions to replace the expressions used in your scripts OR attach here an example of what you are trying to do so i can help you find a solution!

;)
If I didnt do any mistakes transcribing the script, this should be what you are after....BTW I noticed some of the declerations inside the script being completely redundant? For example you declare an expression

qminus1=0

and then a few lines after you have

decl q1 = (a1 * q0) + qminus1;

Why add zero to a multiplication anyways? In fact why is qminus1 even declared? Its not used anywhere else
Perhaps this is part of a greater scheme you didnt send....

monitor2.jzml
Thank you! It's pretty much what I needed. So, I have to create expression outside of script, so that it is available to use in other places. Who would have thought? :)
I understood about variables not being available when script is not executed, but it's OK, because I don't need them outside. Actually script represents canonical mathematical formula and I just written it closely to how I would write it on paper, so it is for the sake of human(me) readability, redundant declarations is also for that.
In second example you implemented this algorithm without script body at all. This is indeed useful technique. Although I don't need it in the present case, this made me realize Lemur finds the order of calculations of expressions automatically, which is quite convenient.