I mean the editor and sonar try to work with the same MIDI devices. And Windows does not "like" that (sometimes it is not allowed to "share", sometimes something crash). You can try to disable all MIDI devices in Sonar and check the editor still crash. With some luck it will not. If that is the case, try to enable one by one in Sonar till the editor crash (can be Alesis, can be something else). It should be possible to eliminate that using software midi looper (there are many).