Beta version 4.4

A new update. The OSC functionality is essentially the same as in the last update, with the following changes:

  • To send an OSC message in midiScript, you can now use the same syntax as before {osc.send:}, and the shorter form {osc:} is also available.
  • Breaking change: The OSC event variables no longer include “osc” in their names. You now have e_ip, e_port, e_address, e_argcount, and e_arg1-e_arg5.
  • In addition, the individual segments of the OSC address are available as event variables e_segcount and e_seg1-e_seg5.

On the Advanced settings tab in global settings, I have added a “Miscellaneous” section that includes a button to clear the in-memory image cache.

Version 4.3.0.175

How e_seg1-e_seg5 work?

What e_port stores ?

e_seg1-5 is according to your earlier suggestion. They’re the OSC address split on “/”.

e_port is the port number of the port on which the message was received. Pretty useless since there can only be one port…:flushed_face:

Suppose I have a profile “A” and a profile “B,” both containing OSC scripted buttons with the following code:

[(init){osc.connect:127.0.0.1,7001,9001}]

Suppose I switch from profile “A” to profile “B”.

During the transition between the two profiles, there is a brief interval where the buttons from profile “A” are unloaded and those from profile “B” are loaded.

My question is: during this transition between the two profiles, does the OSC connector disconnect and then reconnect to 127.0.0.1,7001,9001 for a brief moment?

Yes, it will.

What do you think of keeping the connection until all buttons of the profile ‘B’ are loaded? Then check if some button of the profile ‘B’ has {osc.connect:127.0.0.1,7001,9001}. If true, keep the connection. If false, disconnect.

In other words, what do you think of adding a small delay for automatic disconnection in the pages/profiles transitions with a timeout of 2 seconds in the case that the profile ‘B’ has no buttons configured with the midi plugin?

Apart from that, I wonder if it would be possible to have a new event for when the buttons/dials are unloaded (for the whole plugin, not only for osc).

I must admit I don’t understand this focus on ports. If you want to keep ports open, I suggest using the method you mentioned earlier: dedicate a background script to keep them open, and they will never close.

Plugins are unaware of profile changes, so it’s not possible to implement any logic for such events.

Having an event for button unload is risky, at best. The action environment is shutting down, and I can’t say what will work and what won’t. In addition, if the unload is due to a plugin shutdown, a timeout is involved, and the plugin is forcibly terminated if the shutdown procedure takes too long.

I know… :grinning_face_with_smiling_eyes:
No problem! :+1:

This is giving an error:

This is working as expected:

Is it an issue or is it by design?

Is it possible to store IP and ports in one var?

No, it’s not. I’ll see if I can change that.

Correction: This is not showing any error in the editor, but it is not connecting the ports

It can be a question of taste, but I would prefer the actions for connect and disconnect like this:

  • One specific action for store globally the data (IP,ports) with a custom name
  • One specific action to connect to a custom name connection
  • One speciific action ro disconnect a custom name connection

For instance:

[(init) {osc.store.connection:Totalmix,127.0.0.1,7001,9001}]
[(init) {osc.store.connection:YamahaXT,127.0.0.1,7002,9002}]

[(init) {osc.connect:Totalmix}]
[(press) {osc:/bla/bla/bla}]

[(tap) {osc.connect.to:YamahaXT}]
[(press) {osc:/bla/bla/bla}]

Of course it can be done with vars, but I feel it is better to treat the osc connection without ‘@’. Why? As I said, it is a question of taste, the functionality is the same.

I have been testing 4 osc connections at the same time from Totalmix using 4 background scripts.

When I change the TotalMix workspace, TotalMix sends a full dump of its state: roughly 1,300 messages for every connection.

As the /snapshot/load/N messages are the last ones of the dump., I have been testing how long it takes for the plugin to show the correct value of the active snapshot after a workspace change.

The midi plugin needs around 1 second to show the 4 values in one button after a change of workspace (1,300 messages x 4 = 5,200).

If I simply change snapshots, the 4 buttons show the correct snapshot instantly.

Interesting figures. Thanks for conducting the test. That means the plugin uses about 0.2 ms per message to scan the scripts for potential receivers; I think that’s pretty good.

I had a similar idea when we talked about global OSC ports, i.e., setting a custom name for a port. We can come back to this idea when global OSC ports are to be implemented.

I would implement this (now or later) and forget the global osc ports in the global settings.

We already have 8 global osc ports configuring one in each background script.

If we can call them with a custom name it’s better, just because it is easier than typing or copying/pasting the ip and the ports in every button/dial.

Even if you don’t implement the custom names for store/connect/disconnect, I would forget global osc ports and use global vars in background scripts and button/dial scripts.

I have been testing e_seg1-5.

They are pointing to the segment positions 1-5 (not what I suggested), but it works fine and it is easy to understand for users, so I think this approach is better than my suggestion.

However, the limit of five segments seems insufficient to me.

I would recommend offering a higher number of segments for longer messages.

For instance, many messages for changing fader positions in the TotalMix OSC protocol already consist of five segments.

I assume that other hardware or video devices might use more than five segments in their messages.

The following actions are working as expected without giving any error:

none1

none2

I’m not sure if you had already tried setting ports to #none#, or if you had planned for this in the development and the instructions. IMO, it’s a good option to avoid using ports that aren’t needed—for instance, for a button or dial that only needs to send data.

This update will be the last before publishing unless serious bugs are found. There is a small change that allows the OSC connection parameters to be fully declared in a variable.

May be extended in the next release.

#none# doesn’t work. The properties that store port values accept only integers, so #none# will be treated as 0, which means port 0 is used. It’s a good idea, though, for the next release.

Version 4.3.0.177

This is working as expected, great!