actually snake charming works not because of the music, but because the snake sees the flute moving left and right and rears up to strike it, following the flutes movement with its body. Within the first few tries of practising, the snake bites the flute but hurts itself and learns not to strike it later on. Then when its shown in public, the snake rears up at the flute and moves with it because it still thinks its prey, but doesn't attempt to strike it.