Questions about buttons.

Hi I was just wondering if there was a way or a dedicated button to accomplish this effect. (Check attachment)

I’m trying to build a hihat paddle module for my DIY drumkit and I didn’t want to expand the code for this.

Please help!!

Google "microswitch" for a start.

Why do you want to switch from one analog channel to another? What are you trying to accomplish?

Detecting a pedal stomp is best done with a micro switch or heavy duty push button switch.

Detecting a drum stick strike (is that what the piezo is for?) is more complicated and probably needs an amplifier and peak detector between the sensor and the analog input.

The sort of switch you want is called a single pole change over switch. It has three contacts on it, a common, a normally open and a normally closed.
Depending on the state of the switch the common connector is connected to either the normally open, or the normally closed. These are often abbreviated to Com, NO and NC.