Permanent variable storing

Hello,

What is the simplest method to store in my PC permanently MT global variables ? I would like to register the stops combination of an organ. All stops send to MT a midi message ON/OFF. But I lose the information when the organ (MT software) switch off.

Thanks for your help

Hi,

Unfortunately variables do not persist in MT Pro between sessions, however you can initialize them to the values you want at startup with rules. I usually create a series of translators that do this.

First I create one with incoming trigger of Opening a project file with output of one shot timer called Init. Then I create a number of translators that I want to execute at startup that have an incoming trigger of Init timer. One of these translators which I call "Initialize Global Variables" handles this.

So if I want something to persist I would.

  1. Set the stops which would set the global variables I want.
  2. Dump the global variables in the log window.
  3. Copy and paste the values in a text editor.
  4. Copy and paste only the global values I want back into the rules of my "Initialize Global Variables" translator.

Then the next time my project starts, the variable will be reset the way I want them.

You can also record any other registrations this way and use different timer to recall them again using rules.

If you want them to persist in a different way, you would need to use some sort of "helper" application to send the global variables (as MIDI data) when you want to store them and the receive MIDI to restore them.

A native feature to persist ("store" and later "retrieve" global variables) has been requested but I'm not sure of the schedule to implement this feature.

A few users have figured out how to store and retrieve data from external MIDI controllers to do this but alas this is also not ideal.

For a helper application to do this reliably would need at least 5 MIDI data bytes since global variables are 32 bit signed integers (5 bytes x 7 bits each = 35 bits). Then you would need another 1 or 2 bytes to represent the global variable name (IE "ga")you wish to store and retrieve. Then maybe more data to represent the filename to store the data to.

The format of this data would probably be best to be handled as a System Exclusive data stream.

I know this is not an ideal situation but hopefully this will give you some ideas until such time that a persistent global variable feature is available.

 

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

 

 

Really thanks Steve for your long and detailed answer. Some clue seems interesting despite of the fact I have no idea of what the user save when he record a combination organ. For example on my project, the console has 64 stops. The user can record a stops combination of these 64 stops. So before to store the Stops data I have to scan all stops to read if they are ON or OFF. If you add the fact than the user can store 100 combinations, you easily understand that I need a strong and easy persistent variables record system.

Thanks again for your help.

Kind regards

Bernard

OK, maybe if you can tell me what MIDI is sent for each stop, I can help you with a solution.

I assume if you have 64 stops, that means you can essentially set or reset 64 bits (each stop with either an on or off value), which means you should be able to store the registrations in 2 global variables (32 bits each).

If we can figure out how to interpret and store the MIDI messages into a bit map, then we should be able to:

1) Set the registrations (which will update the 2 global variables)

2) Dump the variables

3) Create a translator to duplicate the values in rules of these 2 global variables in rules.

Then every time you execute the translator (probably as a timer), you should be able to restore the setting of the registration based on the translator rules (as long as you can do this with MIDI).

So my questions are?

1) What MIDI is sent for each registration setting?

2) What MIDI is recognized to recover the setting? Of course if you cannot recover the setting with your device, then all of this is moot anyway.

 

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Just to let other users know.

I have a helper solution for Windows for this. I spent a lot of time on it so it is not free but I can provide it at a reasonable price. It also requires Bome MIDI Translator Pro 1.8.5 which you can request as well. If Florian agrees, he will provide MT Pro 1.8.5 and I can provide the helper along with instructions (Windows platform only). Just hit me up on my email address.

 

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

@SteveC Hi Steve. Stumbled across this thread and am intrigued by your solution. Might you elaborate on it? Thanks.

Yes,

My application (not developed by Bome) uses the Windows command line to communicate with the current Beta (1.8.5) of MT Pro. I believe it will be included in the upcoming release as well.

I store the global variables in a text file for persistence. MT Pro can tell my helper application to update them (via the command line of my application). And I can use my application to send command line messages to MT Pro to capture or set them.

Since this is all done via the command line, there is some overhead so I would recommend that the user only updates persistent variable when necessary so it does not slow things down.

Reach out to me via email if you are interested in my application which I call “mh” (for MIDI Helper).

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz