I don't believe there's a ready-made automatic utility. (
Edit: lidnariq mentioned Vegaplay above for non-bankswitched NSFs.)
For NSFs without bankswitching, you can simply place the data inside NROM (32k), and write a very small stub to start playback, and find some unused part of the 32k space to insert the stub (for most NSFs there will be space at the top of the range.)
- RESET initializes stuff (zero memory, prepare APU), calls NSF's INIT routine, turns on NMI and goes into infinite loop.
- NMI calls NSF's PLAY routine.
- IRQ not used.
- Vector table must be added.
For NSFs with bankswitching, this is more difficult. The stub might be trickier to insert. (The top of the stack might be a useful place, if you can get it small enough; NSFs will not do anything special to the stack, but many NSFs will write to all places in RAM.) You could use the newly created
Mapper 31 which supports NSF style bankswitching, but otherwise you will need to convert NSF banking code to use whatever the target mapper uses. (Expansion sound NSFs would have to use the mappers they belong to.)
Since NSFs are deterministic, and the music loops after a point, you could in theory automate the replacement of banking code by emulating each song for a while and logging the bankswitch writes (and unused regions where it's safe to insert code, etc.) and replacing them with operations for the target mapper.
So... I mean, you could. I don't think such a tool exists at the moment, though. I did it "by hand" a bunch of times for a few music compilations using Mapper 31. There's source code available for most of those, if you'd find that useful:
Famicompo Pico (source)