In the second case sound will be louder but the pitch will not change because loudness depends on amplitude. By hitting it hard it will make its amplitude higher.But the frequency will be same. And the point is to be noted is that the loudness depends on the amplitude not the frequency.