Beta version 4.4

I’m not following you right now; I don’t understand… :grimacing:

Could you post an example of the multi-event command you are referring to?

[(osc1:*)(@l_shouldIcare:"yes"){do_whatever}]

If you don’t want to handle received messages. set @l_shouldIcare to something other than “yes”.

But I must admit I like my original solution better, where a script explicitly told the OSC controller when it wanted to connect to an OSC connection. It is more logical, easier to explain, and far easier to implement.

I will go back to the original design. I think the discussion about auto-disconnect got confused. It was never about disconnecting the ports; it was about disconnecting the script from the OSC controller. Whether the OSC controller should disconnect the ports when no one is using them is another matter altogether. The scripts will need to connect, can disconnect if needed, and will be auto-disconnected from the OSC controller when unloaded. The admin page will include a setting that lets users decide whether the ports should remain open or be closed when no one is using them.

Perfect!

I would suggest to set it to “remain open” by default to avoid problems.

Great.

Good decission, well done.

I never said that {disconnect} action would be important for silencing received messages.

{disconnect} is useful to release/unbind/set free the input port of the midi plugin if another app need to hear though that port

Yet another example of the fact that we meant different things by “connect/disconnect”.

What is connect/disconnect for you?

“Connect” = when the script connects to the OSC controller and tells it that it wants to use the connection oscX and receive messages that arrive on the input port.
“Disconnect” = when the script tells the OSC controller it is no longer interested in receiving messages from oscX. These actions are crucial to enable the plugin to route messages to the correct destinations.

What is happening at the port level is more or less uninteresting to me. I still think that closing ports you don’t use is architecturally more correct, but I now leave that decision to the user.

Okay, I understand the differences in terminology we have, and I understand your point of view regarding ports.

What is your idea for the OSC implementation? Will it be only available for javascript/midiscript? Or you will also add a “Generic OSC button” and a “Generic OSC dial”?

At the moment, I have no other plans beyond the scripting support. I have no clear view of what a dedicated OSC button/dial would look like, and I don’t know if it would make things easier than using a script.

I thought you also wanted to implement generic buttons and dials for OSC. That was an assumption on my part that I shouldn’t have made. If you are only considering scripting support for the long term, then your approach makes more sense to me.

I’ve made a short video. It shows a dedicated OSC controller for Totalmix from the marketplace called “TotalMix FX Control” (link)

You can see that when I change to an empty page the osc controller keeps hearing to totalmix (=ingoing port is open). AFAIK, this is the standard behaviour in OSC world, to never close the ingoing port to avoid loosing messages and also to avoid that another app “steals” the port.

That said, if OSC in the MIDI plugin can only be used via scripts, closing the ports when they aren’t in use might be a good idea.

If a user wants to keep an input port open at all times—to constantly listen for events arriving on that port and, consequently, to ensure that no one else occupies it—they can simply use a background script.

I agree with you that your chosen solution—global settings that let the user decide whether a port stays open or closes when not in use—is the best approach for users.

However, if you believe the MIDI plugin will function better “under the hood” without this global setting—as you originally designed it—then don’t overthink it; just ignore my suggestion. Stick with your original design. If, in the future, you decide to add generic OSC buttons and dials for users who don’t want to (or don’t know how to) write scripts, then it would certainly be worth having a global setting to keep the ports open.

See this video. It seems that {osc.disconnect} is not telling the osc controller to not receive more messages.

Thanks, I’ll look into that while I remodel the OSC management.

OK, decision time!

I need to (or at least want to) publish this version within two weeks. Given all the changes I need to make to the current implementation to add the global OSC ports, I cannot safely do this and guarantee a stable result.

This release will include the current implementation, with some minor additions, such as event variables for the OSC address segment and similar minor changes. Port management will remain as is, with ports closed when no one is using them. Ports locked open is primarily a protection against users making mistakes, and I don’t consider it a vital feature.

In upcoming releases, I might add global OSC ports and have them work in parallel with the “local” ports (where “local” ports are fully declared in the script with IP and port numbers, rather than referencing a global port). In such a scenario, “osc” will be used for local connection references, while osc1-osc8 will be used for global port references.

You could also publish the current beta changing the current names of actions and events, just adding ‘1’. That means to implement the first global osc connection in this relase, and you can add osc2-8 in future releases:

{osc1.connect:…} instead of {osc.connect:…}

{osc1:…} instead of {osc.send:…}

(osc1:…) instead of (osc:…)

{osc1.disconnect} instead of {osc.disconnect}

*If {osc.disconnect} bug is tricky, I would remove this action for this release

I can try next week (monday to friday in the studio) the midiscript for osc so from my side I can help you next week if you want to publish it asap.

The {osc1.connect:…} action inside a background script will keep the ports open, isn’t it?

No. There are no global osc ports in this beta. I will keep the “osc” name unnumbered for “local” definitions, i.e., as today, where you specify all connection properties in the connect action. When/if I add global ports, they will be numbered 1-8.

I haven’t looked at it yet, but I don’t think there will be any problem fixing it.

Yes.

I think this is another example where we mean different things by connect/disconnect.

Disconnect does not disconnect the ports; it disconnects the script from the OSC controller. If it is the last script connected to the ports, the ports will also be closed. If other scripts are still connected, the ports remain open.

When you press the left button, the script on the left button disconnects, but the script on the right button remains connected.

Now I understand.