I have a project/product that uses tones generated with NCO. I created a generic #include file that lists the T2PR, T2CON, and NCO1INCU_H_L values for each note over 3 octaves. When I want a note, I call that subroutine. I then PAUSE for the note duration (have to run the math for 1/8, 1/4, 1/2, whole, etc.). Entire ditties are "canned" into a subroutine.

As for MIDI, I never worked with it. Nuts and Volts Magazine has featured several articles dealing with MIDI over the past couple years. I would assume you could equate a MIDI value to an NCO subroutine equivalent.