Hello Steve,
I don't think there is any way to directly create a midi file with a text editor, as a midi file is a binary format.
I have used a variant which involves createing a text file in a special format, and then using another prog to convert this file into a midi file. BUT, this prog is a DOS program, now quite old, and you need a machine that can support such. A PC no later than XP will work, otherwise you need some sort of DOS emulator.
I have two DOS progs called ENCODE and DECODE, which came as part of a Midi Tools package written and sold by someone called Kevin Weiner in the US. All very useful, incl midi players, filters, various utils to convert/modify midi files. DECODE will take a SMF (Standard Midi File) and convert it into a .TXT file (with two options, the full/detailed format or the much abbreviated, and less readable, format). The TXT file can be viewed, and edited, etc. I've uploaded examples of a DECODE file during previous threads. Then, you can use the ENCODE prog to generate a new .MID file from the .TXT file. By decoding an existing valid midi file, and studying the layout of the file, it would be possible to create a new TXT file from scratch and then generate a midi file from it.
This may be far more fiddly than you have in mind?
I think that there are some other music file systems that may use an intermediate 'language' to create a music file, that can subsequently by converted into a midi file. I seem to remember something called ABC, or something like that? Try a Google search for something like 'text file to play music'. Or there are old progs like 'Band in a Box' (again, I've got an old DOS version, but there are much newer versions of this now available) where you enter chords like a Guitar 'tab' format and the system will save the data, and you can play with auto accomp, or save the result as a midi file to be saved or manipulated elsewhere..
More info, just ask - but NB, all my stuff is now fairly old, and DOS based, so not so easy to use W7 onwards.
Geoff