How do the Mute buttons work on the Fundamental/Mutes module?

This is in fact the code that is handling the mouse click. The state of the buttons is stored in the params array. When a button is pressed down, the corresponding param value is 1.f (1 volt), and when it is not pressed down its value is 0.f (0 volts). The min and max values are set on line 28 of Fundamental’s Mutes.cpp:

configParam(MUTE_PARAM + i, 0.0, 1.0, 0.0, string::f("Ch %d mute", i+1));

The muteTrigger.process(...) piece of code is checking to see if the param has gone from “off” (0.f) to “on” (1.f).

This is how I’ve always seen button presses handled in VCV Rack plugins.

You can take a look at the code for my Boly Puttons module on GitHub for an example of how I implemented radio buttons. It’s not the prettiest implementation, but it works :slight_smile: Look at the checkForParamChanges and switchOffAllButtonsButOne methods. Good luck!

1 Like