Need help with buttonstate
As jsotola has pointed out, there is a mistake in your code. Remove the line

buttonstate = digitalRead(C)


and replace 

if(buttonstate == HIGH)


with

if(C == HIGH)


Moreover, I suggest you take a look at the debouncing example in order to make the sound "smoother" ie no jitters because of the button