Input/output, Order and global variables

Since I messed up with my own project inputs and outputs, that gives me the excuse to put some questions I have about a bunch of things in the general setting of a project.

1 - About input and output, what's the best practice? Should I set them in the Project Default tab and then check Project Default Ports in every Preset where I don't need to change them?

Where I should create aliases, at the Project or Preset level?

And also, what could go wrong when switching OFF an existing alias and ON another one, when both aliases are pointing to the same port? I would expect that not causing anything, but instead in the Log Window I read [port closed] at the end of every Outgoing message. Seems strange. Note that I have all Translators working with Project/Preset Default Ports checked. I was just trying to tidy up the project and remove inconsistencies cause my head is already overloaded when working in Bome :_)

2 - Do the order of Presets matter? Meaning are they processed in order? And what about Translators order?
Which leads me to..

3 - Where should I create global variables? Does it matter at all where?

And also, I have 5 main midi channels that are used throughout my controller. I thought: it could be better to define them as global variables in case I want to switch all translators from one to another (channel). Is it stupid? And another silly doubt that I have is: when I use a global variable to assign a certain number to a local variable in Incoming and then that local variable is changed value in Outgoing, does my global var change value too? (I think not, but I'm not sure).

Hi, let me see if I can tackle your questions.

1 – About input and output, what’s the best practice? Should I set them in the Project Default tab and then check Project Default Ports in every Preset where I don’t need to change them?

SJC> I generally set any ports that I will be using at the project level. That way they will not open or close themselves as presets are enable and disabled during the project. The exception would be that you WANT to enable and disable ports (allowing other applications to use them. On Windows, only one application can own a MIDI port at a time.

Where I should create aliases, at the Project or Preset level?

SJC> Alias are always defined at the project level, no matter where you create them.

And also, what could go wrong when switching OFF an existing alias and ON another one, when both aliases are pointing to the same port? I would expect that not causing anything, but instead in the Log Window I read [port closed] at the end of every Outgoing message. Seems strange. Note that I have all Translators working with Project/Preset Default Ports checked. I was just trying to tidy up the project and remove inconsistencies cause my head is already overloaded when working in Bome :_)

SJC> If you open 2 aliases that are pointing to the same physical port and you send to both aliases, you will get duplicate messages sent to the same physical port.

Also if you have 2 input aliases tied to the same physical port and the you get something twice, you will see duplicate incoming message.

I generally manage ports at the preset level to reduce having to change 100s or 1000s of translators. I seldom use translator level inputs and outputs for the same reason.

 

2 – Do the order of Presets matter? Meaning are they processed in order? And what about Translators order?
Which leads me to..

SJC> Yes they go from top to bottom, from first preset then through translators under that, then next preset. This is described at some detail in the documentation (F1)

The exception is translators that use incoming timers which are processed based on the time you set.

3 – Where should I create global variables? Does it matter at all where?

SJC> I usually put them under a Preset at the top that I call "Init". On project open, I call a one shot timer also called "Init". Then I create translators with incoming trigger of timer "init". Each translator does a different action. I usually have one called "Initialize Global Variables". I document and initialize all project global variables there in alphabetical order. If I need a new global variable. I look there and document and create the next unused one.

 

And also, I have 5 main midi channels that are used throughout my controller. I thought: it could be better to define them as global variables in case I want to switch all translators from one to another (channel). Is it stupid?

SJC> No, I often assign global variables as channels. That way if things change, I can change just a few global variables and maybe no translators.

 

And another silly doubt that I have is: when I use a global variable to assign a certain number to a local variable in Incoming and then that local variable is changed value in Outgoing, does my global var change value too? (I think not, but I’m not sure).

SJC> I usually copy global variables into local variables within a translator at the beginning and then put them back if changed at the end. You need to be careful not to have different translators changing the same global variable (especially when using timers in which things can happen asynchronously).

With that said, there are only 10 local variables oo-yy, so sometimes I have to just use the globals within the translator.

The other value of copying globals into locals in a translator is that you can make translators more generic with locals and just change a few lines at the top and bottom of the rules for the differences.

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

 

Great now it's more clear.
I get all of what you said but some details.

SJC> If you open 2 aliases that are pointing to the same physical port and you send to both aliases, you will get duplicate messages sent to the same physical port.

Also if you have 2 input aliases tied to the same physical port and the you get something twice, you will see duplicate incoming message.

I have to be more precise. In Project default MIDI OUTPUT when using 1 Virtual MIDI port in settings you have the actual physical port and an automatic alias for it. Then I add a second alias with a better name pointing to the same port. If I switch off the automatic alias and switch on the alias I created I get Port State "pending (error)" and Outgoing MIDI has the [port closed] indication added in the Log Window and no midi messages can reach the DAW.

Also, it seems that if I edit the number of virtual ports in Settings to 2 and then switch back to 1, ports are not deleted but left grayed out in MIDI INPUT/OUTPUT sections. Should I manally delete them? (sorry it's a little thing but I'm trying to come to peace with a lot of these little things)

SJC> I usually copy global variables into local variables within a translator at the beginning and then put them back if changed at the end.

I think I understand but I'm not sure when I assign global variables to local variables, does the global var change value (so I have to reset it)? See example in the attached image. To be extra-clear I don't have any rule involving that global variable.

 


Attachments:
![](upload://sFLrOmdywUjRz24WU5d6yYz1JKv.jpeg)

I have to be more precise. In Project default MIDI OUTPUT when using 1 Virtual MIDI port in settings you have the actual physical port and an automatic alias for it. Then I add a second alias with a better name pointing to the same port. If I switch off the automatic alias and switch on the alias I created I get Port State "pending (error)" and Outgoing MIDI has the [port closed] indication added in the Log Window and no midi messages can reach the DAW.

SJC> This happens occasionally in MT Pro 1.8.4 (I just discovered this). A fix will be available in the next release. It the meantime, after defining your new alias and re-assigning it, save, close and re-open your project file and all should be OK. If this becomes an issue, please go to the contact us web page and request a copy of the pre-release for the next versin.

Also, it seems that if I edit the number of virtual ports in Settings to 2 and then switch back to 1, ports are not deleted but left grayed out in MIDI INPUT/OUTPUT sections. Should I manally delete them? (sorry it's a little thing but I'm trying to come to peace with a lot of these little things)

SJC> Typically I just leave 3 ports defined in my projects just to save myself on deleting aliases that point to nowhere. If you have defined inputs and output that are physical ports that no longer exist, you have to redefine them to their new ports (if used) or create aliases for the unused ports and point them to the real port you are using. Seldom do my projects need more than 3 virtual ports.

I work on A LOT of other users, project files and they often have their own aliases defined. After a while, my settings file gets clogged up with a lot of unused aliases. When this happens I use the View-Setting Reset menu and remove all aliases (after saving my current project file). The next time you open a project file, you will then be prompted of any aliases not assigned in the project you are trying to open.

I think I understand but I'm not sure when I assign global variables to local variables, does the global var change value (so I have to reset it)? See example in the attached image. To be extra-clear I don't have any rule involving that global variable.

SJC> No, local variables and global variables are separate. Local variables and their values "disappear" outside of a given incoming trigger, so if you want it to persist, you need to store the value back into a global variable. Think of local variables as "temporary" variables just to be used within the scope of a translator's incoming action while global variables are "semi permanent" meaning they exist until you close the project or redefine their value. When a project is opened, global variables are 0 until you define a different value. (The do not persist across sessions).

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

Perfect! Thank you alot Steve, you’re really helpful. Working with BMT is slowly becoming less cryptic every day :slight_smile:

Glad to help!