[Macro Buttons] System.execute over VBAN

How to use Voicemeeter Remote API and control Voicemeeter Audio Engine
Post Reply
py2raf
Posts: 9
Joined: Wed Jul 17, 2019 6:52 pm

[Macro Buttons] System.execute over VBAN

Post by py2raf »

Hi there, Vince!

Let the following macro button, for execution in the remote computer.

1. Mute Strip 1
2. Mute Strip 2
3. Execute a command.

Code: Select all

BEGIN_SECTION("vban1")
Strip[1].Mute=1;
Strip[2].Mute=1;
System.Execute("c:\users\rodrigo\auto\ptt-off.cmd");
END_SECTION
By running this macro, it will successfully mute the strips 1 and 2 - but will not run the system.execute.

As a secondary interesting noteworthy finding; if I put the system.execute at the top of the script:

Code: Select all

BEGIN_SECTION("vban1")
System.Execute("c:\users\rodrigo\auto\ptt-off.cmd");
Strip[1].Mute=1;
Strip[2].Mute=1;
END_SECTION
Everything fails: the script stops running everything after the system.execute

Well, my root question is: How can I trigger a system.execute in a remote computer via VBAN?

Running VoiceMeeter Banana 2.0.5.0.

Thanks a LOT!

- Rodrigo.
Vincent Burel
Site Admin
Posts: 1323
Joined: Sun Jan 17, 2010 12:01 pm

Re: [Macro Buttons] System.execute over VBAN

Post by Vincent Burel »

system functions are interpreted and executed by MacroButtons only. if you send a System.Execute function in a VBAN Text request, Voicemeeter will receive it but won't excute it, because it is executed by MacroButton app only. You may write your system function outside of the BEGIN_SECTION ou SendText('vban1", ...request...);

Code: Select all

BEGIN_SECTION("vban1")
Strip[1].Mute=1;
Strip[2].Mute=1;
END_SECTION
System.Execute("c:\users\rodrigo\auto\ptt-off.cmd");
py2raf
Posts: 9
Joined: Wed Jul 17, 2019 6:52 pm

Re: [Macro Buttons] System.execute over VBAN

Post by py2raf »

Hello Vince!
Thank you very much for your reply.

I wanted to trigger a command in the remote computer using the Macro Button - Is there any provision or functionality for it?

Thanks again!!
Vincent Burel
Site Admin
Posts: 1323
Joined: Sun Jan 17, 2010 12:01 pm

Re: [Macro Buttons] System.execute over VBAN

Post by Vincent Burel »

you can send a VBAN-MIDI request then, it will come in Voicemeeter VBAN-MIDI stream and will be forwarded to the related MacroButtons.
py2raf
Posts: 9
Joined: Wed Jul 17, 2019 6:52 pm

Re: [Macro Buttons] System.execute over VBAN

Post by py2raf »

Hi again, Vince! Thank you very much for your post!

Well Vince, I'm afraid that I couldn't figure out how to do it - In either Midi Mapping or vban-2-midi apps I necessarily have to specify a Midi Input Device

Well, the truth is I'm sort of clueless - and I swear that I have read the documentation :D

Can you provide a bit more information on achieving it?

For what is worth: Me and my friend PY2UGO are crafting a entirely remote operation of a radio using VoiceMeeter! We need to execute the remote commands to send the CAT commands to Tune, PTT on/off, etc. our transceivers.

Thanks a LOT!!!

- Rodrigo, PY2RAF.
Vincent Burel
Site Admin
Posts: 1323
Joined: Sun Jan 17, 2010 12:01 pm

Re: [Macro Buttons] System.execute over VBAN

Post by Vincent Burel »

Well, it's easier that you think.

in your distant MacroButton, you may generate a MIDI message with SendMidi command
example: SendMidi("vban1" , "note-on" , 1, 64, 64);

it will be received by Voicemeeter VBAN MIDI1 Input Stream for example. This MIDI stream is automatically forwarded to local MacroButton app, as it was coming from the MIDI mapping device.
py2raf
Posts: 9
Joined: Wed Jul 17, 2019 6:52 pm

Re: [Macro Buttons] System.execute over VBAN

Post by py2raf »

Hey Vince! We're almost there!!!

So, for documentation sake:

REMOTE = Computer that you want to have some program to run
CONTROL = Computer where you will be using Macro Buttons to run stuff in REMOTE

1. Configure the Macro Button In the REMOTE computer that will be performing the tasks with the system.execute, other macros etc.
2. Configure and enable VBAN in your REMOTE computer. Ensure to enable the incoming MIDI1 stream. Fill the "IP Address From" field accordingly, containing the IP address of your PC that you will control via Macro Buttons. Leave both General VBAN, MIDI1 and Command1 as enabled.
--
3. In the CONTROL PC, Open Macro Buttons, click on the "Macro" icon at the top left of the Macro Buttons - select "VBAN Configuration"
4. In MIDI1, check the "on" box, and add the IP address of the REMOTE PC. Click OK.
5. Change "Button Type" from Push Button to "2 Positions"
6. Still in CONTROL PC, choose any button, and in "Request for Button ON/Trigger IN" define:

Code: Select all

System.SendMidi("vban1", "note-on", 1, 64, 64);
7. in "Request for Button OFF/Trigger OUT" define:

Code: Select all

System.SendMidi("vban1", "note-on", 1, 64, 64);
(yes, it's the same content)
--
8. Back to the REMOTE PC, right-click the key of interest that you want to tie together with the CONTROL button. Check the box "Learn (from MIDI mapping device)". DO NOT CLICK OK YET.
--
9. In CONTROL PC, hit the button that you want to control
--
10. Back to REMOTE - it should show "#1 Note On E3 (64)" in the textbox below "Learn". Click OK.
--
11. Click on your CONTROL PC at will! State changes immediately.

So Vince, this is what I came with. Is this correct/complete?

It works perfectly with 2-position buttons.

HOWEVER; I didn't manage to make it work finely with push-button commands: As soon I send the message, the button gets stuck as pressed at the Remote PC. I have to press again at the remote to the button leave the pressed state at the remote.

Any tricks to get around it?

Thanks again!!!
Last edited by py2raf on Thu Feb 06, 2020 9:59 pm, edited 1 time in total.
py2raf
Posts: 9
Joined: Wed Jul 17, 2019 6:52 pm

Re: [Macro Buttons] System.execute over VBAN

Post by py2raf »

Okay - I figured out, it WORKS!!! \o/ :D :D :D :D

SO - for Push Buttons! The steps are:

5. Leave the button state as "Push Button"
6. In "Request for Button ON/ Trigger IN define:

Code: Select all

System.SendMidi("vban1", "note-on", 2, 64, 64);
7. in "Request for Button OFF/Trigger OUT" define:

Code: Select all

System.SendMidi("vban1", "note-off", 2, 64, 64);
(NOTICE that the first one is note-on and the second is note-off)

Proceed with the following steps.

[EDIT] - Ensure to use different numbers for each button (the first numbers after the "note-on" or "note-off")

Thanks, Vince!!!!
Vincent Burel
Site Admin
Posts: 1323
Joined: Sun Jan 17, 2010 12:01 pm

Re: [Macro Buttons] System.execute over VBAN

Post by Vincent Burel »

the exact syntax is:
System.SendMidi("vban1", "note-on", channel, note, velocity);
Note there is only 16 channels but 128 notes (0 to 127).

To emulate a keyboard or MIDI controller button, you may use note-on/off like this

PUSH button:
System.SendMidi("vban1", "note-on", 1, 64, 64);

RELEASE button:
System.SendMidi("vban1", "note-on", 1, 64, 0);

if velocity is ZERO, then a note-on is interpreted as note-off (universal process).

but you can explicitely send a note-off like you did
System.SendMidi("vban1", "note-off", 1, 64, 64);
Post Reply