To use Rosegarden to print drum notation for compositions that exist only in the MIDI realm, such as vintage computer game music.
Rather than develop a nice, first rate feature that would be enjoyable to use, my aim is only to hack things to a point where I can get the task accomplished, even if the result is brutally ugly to use.
The Edit… Split… Split by Drum feature. This scans a segment to find the discrete pitches, then moves each pitch encountered into a new segment. All the F#3 go into a segment by themselves, all the Ab4, all the C0, etc. This is a good beginning, but it needs refinement.
To work out which pitches to combine into a single segment, such as open and closed hi-hat. This will be limited to GM percussion only, and hard coded for the basic standard GM drum kit, cross-referenced to whatever LilyPond supports. If it isn't in basic GM or if LilyPond can't support it, then it doesn't get in. Hard coding the rules saves a massive amount of work. If users encounter non-GM files they wish to convert into drum notation, they'll have to remap the drums to GM first. If that became a frequent issue for someone with a particular vintage synth or whatever, this remapping could be scripted a lot more cheaply than fancy internals could be constructed. There just isn't any point in laying all that groundwork to create mappings when one mapping will be used the vast majority of the time, and when there are only a small number of exceptions (all pertaining to the snare and hi-hat as far as I recall).
Once the drum splitter is smarter, the next step is to collect a list of every kind of drum LilyPond can export, and create a way to designate a particular segment as containing that kind of drum. This means the pitch is irrelevant, and non-GM mappings could be accommodated here easily. The obvious way to go here is to add a combo box to the SPB to designate that this segment contains a hi-hat or what have you.
Once it's possible to designate a hi-hat segment, LilyPond export needs to be modified to deal with putting all of this together. It is probably sufficient to write each segment to a discrete Voice. I have no idea as yet how to deal with the problem of rests.
It should be possible to modify LilyPond export to notate things like cross-stick, accents, and ghost notes; the latter two of which could be guessed at reasonably by examining velocity, and using simple hard-coded ranges. Velocity less than n equals an automatic ghost note, velocity higher than y equals an accent.
Possibly add some configuration and whatnot so there is more flexibility.