Page 1 of 2

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

Posted: Sun Aug 02, 2020 1:57 pm
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.

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

Posted: Wed Aug 05, 2020 9:20 am
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.

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

Posted: Fri Aug 07, 2020 7:16 am
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.

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

Posted: Fri Aug 07, 2020 2:16 pm
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)?

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

Posted: Sat Aug 08, 2020 10:07 am
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

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

Posted: Sat Aug 08, 2020 11:05 pm
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?

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

Posted: Sun Aug 09, 2020 6:28 am
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.

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

Posted: Thu Aug 20, 2020 12:39 pm
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()?

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

Posted: Thu Aug 20, 2020 3:56 pm
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.

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

Posted: Sun Aug 30, 2020 7:57 am
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