help!

'inputPin0' seems like a poor choice of name for the volume control input.

Having three inputs all handled and managed in the same way makes me think that you should be managing them in an array.

When you are deciding which input to connect to, your logic only works when there is exactly one non-zero input. I suggest that instead you define an order of precedence between the input. For example, you could say that input1 is selected if it is active; input2 is selected if it is active and input1 isn't; input3 is selected if it is active and input1 and input2 are not active. You could implement that easily by testing each input in order and stopping when you find the first active one.

How is your sound input connected to your analogue inputs? You are testing for a zero signal, but depending how you're connecting you may find that doesn't happen very often or at all. You may need to test for the value being below a threshold rather than zero. Is an instantaneous zero signal sufficient to decide there is no input? I would have thought it made more sense to check for the signal remaining zero for some time - for example, ten seconds. To achieve that would require a significant change to that final block of code dealing with tempo. As it stands, all it seems to do is delay for 10 seconds, assign tempo=30 and go into mute mode. Perhaps you intended that "if(tempo = 30)" to be an == rather than assignment, although that doesn't make any sense either since tempo will never equal 30 at that point.

What I'd do if it were me is have an unsigned long that holds the value of millis() when the last sound was detected, updated to millis() each time sound is detected. If that value indicates that you haven't heard sound in the last 10 seconds (or whatever), go to mute mode. I'd ditch the ideal of tempo altogether.