Assuming you are talking about diverting the YM sounds to MIDI, there are two factors involved, one is discovering what 'notes' are being played by the YM chip and sending those out as MIDI events, the other is somehow finding out what the composer of the YM music intended the note being played to sound like. Sound chip music usually rapidly alternates between sounds on one channel - for example one channel may be alternately playing both drum and bass, with that channel of the soundchip constantly being reprogrammed to sound like one or the other instrument.
MIDI output is usually one of two things:
Generic, as I believe the soundtrack for Bombjack is: This means that the game sends out MIDI notes only, usually only on one MIDI channel / as one instrument and leaves the selection of the actual instrument to the user.
Instrument specific, like the music for 'ECO' which is meant to be played on a Roland MT-32 Synthesizer module (and sounds very good if it is). In this case the MIDI information contains up to eight separate simultaneous tracks of music, and is also sending instrument select, or 'program change' codes which select specific sounds from the wide range of sounds such modules usually have available.
So the answer, in my opinion, is that this is not a very straightforward thing to do - really, the support needs to have been built in, and there effectively need to be two different internal versions of the song, one for YM replay and one for MIDI. The only time this won't apply is if the YM music is ultra simple and just plays three note polyphonic music using a single sound - then it would be relatively straightforward to intercept the notes being sent to the YM IC and translate them into MIDI note events.
I think MIDI music is only worth it when the music has been specifically composed for a particular instrument such as the Roland MT32 or the Casio CZ-101 or the Yamaha FB-01, or possibly for any MIDI instrument in the 'General Midi' class in which a wide range of instruments undertook to conform to a standard set of similar sounding sounds - however, I'm not sure if any ST games supported GM because I think it came along a little bit later than the ST.