Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

The Virtual Audio Mixer discussions and support...
slantalpha
Posts: 14
Joined: Fri Jul 31, 2020 10:36 pm

Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by slantalpha »

I've been using a paid license of Voicemeeter for a few years now, and I want to take my setup to the next level :)

I want to make a hardware interface with a push button to mute a specific Voicemeeter channel and also turn on a physical LED to indicate whether or not the Voicemeeter channel is muted (the physical LED is synced to the Voicemeeter channel red mute indicator).

Can this be done using Arduino, and would I need to use the Voicemeeter Remote API to communicate with the Arduino board to light up the mute indicator physical LED? Or do I need to use a different kind of hardware interface? I was just thinking of Arduino because everyone thinks of using Arduino for DIY projects these days. I'm open to suggestions to using other boards as well.
Andres
Posts: 192
Joined: Fri May 01, 2020 7:25 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by Andres »

Hi. Using MIDI you could mute each strip and bus in Voicemeeter. It should be possible to use an arduino board to build a simple MIDI controller. You can Google "arduino midi conttroller" to see some examples. They use Arduino MIDI library with additional software like a Serial to MIDI bridge and a virtual MIDI port.

This video contains some references: https://youtu.be/JZ5yPdoPooU

I don't know how to turn on/off an indicator LED from VoiceMeeter.
Vincent Burel
Site Admin
Posts: 2008
Joined: Sun Jan 17, 2010 12:01 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by Vincent Burel »

there is no parameter "feedback" in Voicemeeter remote protocol (MIDI or VBAN-TEXT).
and there is no request to get parameter status.

only the Voicemeeter Remote API provides parameter states, but it's for a client application running on the same PC than Voicemeeter.
slantalpha
Posts: 14
Joined: Fri Jul 31, 2020 10:36 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by slantalpha »

Vincent Burel wrote:there is no parameter "feedback" in Voicemeeter remote protocol (MIDI or VBAN-TEXT).
and there is no request to get parameter status.

only the Voicemeeter Remote API provides parameter states, but it's for a client application running on the same PC than Voicemeeter.
Hi Vincent, thanks for the reply. Is there a way to use the Voicemeeter Remote API to create a Win32 program on the computer, and then somehow program the Arduino to "talk" to the Win32 program using its USB virtual COM serial port to get / set the necessary parameters (I'm not sure how that would work)?
Vincent Burel
Site Admin
Posts: 2008
Joined: Sun Jan 17, 2010 12:01 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by Vincent Burel »

yes, sure, you can build a client application to make amediator between your arduino and voicemeeter.
just follow example in SDK: viewtopic.php?f=8&t=346
slantalpha
Posts: 14
Joined: Fri Jul 31, 2020 10:36 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by slantalpha »

Vincent Burel wrote:yes, sure, you can build a client application to make amediator between your arduino and voicemeeter.
just follow example in SDK: viewtopic.php?f=8&t=346
Is the Voicemeeter Remote API DLL written in standard C? How can I import it into a C++ or C# program?
Vincent Burel
Site Admin
Posts: 2008
Joined: Sun Jan 17, 2010 12:01 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by Vincent Burel »

yes of course, it's programmed like a standard microsoft dll, you can use it with any language able to call _stdcall functions.
slantalpha
Posts: 14
Joined: Fri Jul 31, 2020 10:36 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by slantalpha »

Vincent Burel wrote:yes of course, it's programmed like a standard microsoft dll, you can use it with any language able to call _stdcall functions.
Hmm... I'm getting some compilation errors in my C++ program. In Visual Studio 2019 I set the character set to "Not Set" and added _CRT_SECURE_NO_DEPRECATE to the preprocessor definitions.

Here is the line that it does not like (taken from wmr_client.c):

iVMR.VBVMR_SetParametersW(L"Bus[0].device.wdm=\"Speakers (High Definition Audio Device)\"");

Here is the error that's coming up:

error C2664: 'long (unsigned short *)': cannot convert argument 1 from 'const wchar_t [60]' to 'unsigned short *'

Any ideas? What is the difference between iVMR.VBVMR_SetParametersW() and iVMR.VBVMR_SetParametersA()?
slantalpha
Posts: 14
Joined: Fri Jul 31, 2020 10:36 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by slantalpha »

Vincent Burel wrote:yes of course, it's programmed like a standard microsoft dll, you can use it with any language able to call _stdcall functions.
Edit: I got past that message by changing the unsigned short * to a wchar_t *.




Now I have a very basic C++ program, and I've copied the code from vmr_client.c over.

I changed it to a console app to make it easier to follow, with the entry point as int main().

I called the InitializeDLLInterfaces() function from vmr_client.c, and I get a result of zero back (no error). VBVMR_RunVoicemeeter(3) also works (an integer 0 is returned), and I also see Voicemeeter open on my desktop.

But for some reason, when I run

iVMR.VBVMR_SetParameterFloat("Command.Restart", 1.0f);

... I get a -1 error.

This other command also gives me a -1 error as well:

iVMR.VBVMR_SetParameterFloat("Strip[5].mute", 1.0f);

If I just want to mute / unmute a channel, are there any other things I need to do besides call InitializeDLLInterfaces(), which also calls RegistryGetVoicemeeterFolder and also executes iVMR.VBVMR_Login?

Here is my code from int main():

Code: Select all

int main(array<System::String^>^ args)
{
	int resp = 99;

	resp = InitializeDLLInterfaces();

	printf("InitializeDLLInterfaces result: %d\n", resp);

	resp = 99;

	resp = iVMR.VBVMR_SetParameterFloat("Command.Restart", 1.0f);
	printf("Command.Restart result: %d\n", resp);

	resp = 99;

	resp = iVMR.VBVMR_IsParametersDirty();
	printf("IsParametersDirty result: %d\n", resp);

	resp = 99;

	resp = iVMR.VBVMR_SetParameterFloat("Strip[5].mute", 1.0f);
	printf("Strip[5].mute result: %d\n", resp);

	if (iVMR.VBVMR_Logout != NULL) {
		iVMR.VBVMR_Logout();
		printf("Logged out.\n");
	}
	if (iVMR.VBVMR_AudioCallbackUnregister != NULL) {
		iVMR.VBVMR_AudioCallbackUnregister();
		printf("AudioCallback unregistered.\n");
	}

	return 0;
	
}
Here is the output from my console window:

Code: Select all

InitializeDLLInterfaces called.
InitializeDLLInterfaces: GetVoicemeeterType: 268448720
InitializeDLLInterfaces: GetVoicemeeterVersion: 268448784
InitializeDllInterfaces: iVMR.VBVMR_Login: 268448432
InitializeDLLInterfaces result: 0
Command.Restart result: -1
IsParametersDirty result: -1
Strip[5].mute result: -1
Logged out.
AudioCallback unregistered.
slantalpha
Posts: 14
Joined: Fri Jul 31, 2020 10:36 pm

Re: Hardware interface (Arduino?) mute button for Voicemeeter channel and mute indicator LED

Post by slantalpha »

Thanks guys. I figured it out. Looks like InitializeDLLInterfaces() does not call VBVMR_Login() automatically.

Once I called VBVMR_Login() manually, everything started working :D
Post Reply