Global Variable Reference

JacobiusWrex

2016-07-29 15:51:51

Hi everybody

I have attached a file that you may find useful in your projects using lots of global variables.
It's basically just a list of all the global variables, you can use it to keep track of/layout your big projects.

Let me know if you have any suggestions.

Thanks

Wrex
Attachments
Global Variable Reference.txt
(1.69 KiB) Downloaded 408 times

TomViolenz

2016-09-30 13:38:17

did "if" ever get fixed?!

I avoid using it because Bomes often confuses it for the if in if/then statements. To the point were it works for a while and then all the sudden stops working and the cause is always that Bomes doest read it right. (as gleaned from the log)

So I stopped using "if"

Just a little bug though no big thing 8)

florian

2016-10-01 15:56:22

It got fixed, so you should be able to use the variable "if". But in general, it's not a good idea.
Florian

TomViolenz

2016-10-04 16:43:51

good to know :-)
But yeah, I will probably still out of habit avoid using it.

Mister36

2016-10-23 21:21:53

Thanks to JacobiusWrex for the reference list.

Might there be any automatic way to find all the currently used global variables from a project though? Or is this only way (aside from manually going through and checking) to make all assigned global variables >0 and check the global variable dump?

It would be really great if there was a global variable "report" function that just output a table with the global variables used anywhere in the project and perhaps their locations in the project and current values.

florian

2016-10-23 22:46:04

Hi Mister36, I agree 100%. In a future version, we will add a search function which allows you to list all used variables, MIDI ports, etc.
Thanks,
Florian

Mister36

2016-10-25 17:18:53

florian wrote:Hi Mister36, I agree 100%. In a future version, we will add a search function which allows you to list all used variables, MIDI ports, etc.
Sounds great. I look forward to it. Will be very useful indeed. Until then (and beyond even), it's still best to keep track of them. But brains sometimes forget to do that. :P

sjcaldwell

2016-10-25 19:23:21

I try making a habit of assigning all global variables and initial value at project open. Then using comments I document
what the meaning of each of them are. If I want to create a new global variable, then I look at my init code and comments to find out if it has already been used. When I add it, I also add an initialization to it, even if zero. So I can always look at my first translator in my Startup preset to keep things documented. My main gripe is the 2 letter names
I have to assign that really mean nothing. I keep having to refer back to my Init global variables translator to remember what I named everything. I'll be happy when we have variable names with some meaning.

Another thought would be to have something between global and local variables such as below

Global - scope is everywhere
Preset - scope only within a given preset
Local - Only available within the translator

florian

2016-11-01 11:46:39

Hi,
preset-level global variables and translator level global variables would be nice, indeed. Will think about it.

Note that "local variables" are local per incoming event. If you have 2 simultaneous incoming MIDI messages which trigger the same translator's incoming action and assign a local variable, the translator will be executed twice at the same time, with the respective values of pp. MT Pro's internal engine is entirely parallel, so this concept is very useful to avoid conflicts for simultaneous processing. But it's harder to explain than to just say "local variables are local to a translator"... The user's manual does try to explain the difference a bit more...

Thanks,
Florian