The file associations to have Sonar open midi files are made during Sonar installation, by default, so double-clicking a midi file in File Explorer will launch Sonar, which then proceeds to set it up with each midi channel going to its own track, and TTS-1 loaded. Each track in one of these commercially available midi files has some General Midi instrument patch change information embedded in it, and since TTS-1 is a nicer sounding General Midi synth, it works out nicely.
I use this all the time, to learn new prog tunes - as many of them are actually freely available out on the web, so I will frequently open a complex/difficult song that someone has been kind enough to build as a midi file, and then I can use Staff View to look at rudimentary transcribed notes to learn otherwise difficult parts. (Emerson Lake and Palmer, Genesis, etc...)
Bob Bone