If the ROM just plays music, and it's (PD), then it's probably made with NES music composition software such as Famitracker or NT2. If it displays a sprite based music video as well, then it's called a "demo".
Most music ROMs are stored in a different format called .nsf (NES sound format), which is usually associated to a media player with a .nsf codec installed. It's not that hard to convert a music-only .nes to .nsf or vice versa, or to make the composition software spit out .nsf or a music-only .nes. And it's not that hard to make a homebrew .nsf: