Press and hold A & B and press Reset. If done right, the sound test menu will appear.
In level 10, after killing the boss, press and hold Select. When your ship moves again, the music will be different. After beating another boss, the music will return to normal unless you hold select again.
You can also change the music by holding Select after your last ship is destroyed.
This code is strange. The debug mode is only available in the USA version, but you have to use the Family Computer Keyboard, which only came out in Japan. To enable the Debug Mode, Reset the NES 9 times. On the title screen, use the keyboard to type COMPILE and press Enter. If done right, a sound should be heard. Now, during the game, you can pause it and press Select on controller 1 to change weapons, Clear (Clr) on the Keyboard to get 254 lives and Insert (Ins) or Delete (Del) to warp back and forth between levels.
Lose all your lives and right before the words "Game Over" appear, press and hold Select. If done right, the game over music will be different.