You could always use the Capcom music engine from Rockman / Rockman 2. It is pretty much plug and play.
You can find it at
http://bisqwit.iki.fi/jutut/megamansource/ .
If you want it in binary format, it's located in rockman2.nes or megaman2.nes at file position $30010.
It ends at $30A60, which is immediately followed by a table of song pointers.
You'll want to place it so it runs at the address $8000 in your ROM.
Each song pointer is 2 bytes. At the address pointed, is the song data.
The song data is in this format:
0000 byte $0F ; this identifies as a song (as opposed to SFX)
0001 word Channel1Pointer ; points to the data for channel 1
0003 word Channel2Pointer ; points to the data for channel 2
0005 word Channel3Pointer ; points to the data for channel 3
0007 word Channel4Pointer ; points to the data for channel 4
0009 word MetaPointer ; points to the list of vibrato specifications
Each channel is a stream of commands. The following are the most important commands:
$00 $xx
Sets playback speed to xx (each note plays for xx frames)
$02 $xx
Sets the duty-cycle values to xx. Accepted values: $00,$80,$40,$C0.
This controls the type of sound produced by the NES hardware.
$03 $xy
Sets the volume and envelope of the sound. I think y is the volume and x is the envelope decay rate, or vice versa.
$04 $nn $addr
Declares a loop-end. The commands in between of the address $addr and this loop command are repeated nn times. If nn=0, loops infinitely.
Loop nesting is not allowed, unless the outer nn=0 and inner nn>0.
$05 $xx
Sets the base note to xx. The value xx (in semitones) is added to each note played.
Multiples of 12 give a difference of an octave.
$06
The following note will be played 50% longer (i.e. if the length is otherwise indicated 8 units, this makes it 12).
$30
The following note will be played 1/3 shorter (i.e. if the length is otherwise indicated 8 units, this makes it 8*2/3). This can be used to play triplets.
$40..$5F
Plays a note with length=2. The note played is (bytevalue-$40 + basenotevalue), except $40 means silence instead.
The actual duration for the note is 2*playbackspeed frames,
except if prefixed with the $06 byte or with the $30 byte.
$60..$7F
Plays a note with length=4. The note played is (bytevalue-$60 + basenotevalue), except $60 means silence instead.
$80..$9F
Plays a note with length=8. The note played is (bytevalue-$80 + basenotevalue), except $80 means silence instead.
$A0..$BF
Plays a note with length=16. The note played is (bytevalue-$A0 + basenotevalue), except $A0 means silence instead.
$C0..$DF
Plays a note with length=32. The note played is (bytevalue-$C0 + basenotevalue), except $C0 means silence instead.
$E0..$FF
Plays a note with length=64. The note played is (bytevalue-$E0 + basenotevalue), except $E0 means silence instead.
If you don't use vibrato, the vibrato specification pointer can be specified as 0.
To use the sound engine, the following interface is available:
jsr $8000 ; Call this once every NMI.
lda #1
jsr $8003 ; Call this when you want to start song number 1
lda #$FC
jsr $8003 ; Call this when you want to speed up music
lda #$FD
ldy 1 ; fade power
jsr $8003 ; Call this when you want to initialize a volume fade
lda #$FE
jsr $8003 ; Call this when you want to stop all sfx and music
lda #$FE
jsr $8003 ; Call this when you want to stop all music