MIDI Trim is intended for use with solenoid pianos. Its purpose is to shorten unnecessarily long notes that are already held on by the sustain pedal, allowing the hammers to return to rest at the earliest opportunity without compromising the performance.
The earlier note releases improve repetition, quieten the solenoids and, with less time for the reverberation to decay, also help to mask the sound of the hammers hitting the hammer rail on their return. However, is should be stressed that this is not a panacea for all ills as it is only operative while the sustain is on.
Here Cakewalk is displaying a comparison of the before and after MIDI files for an Ampico piano roll with its infamous note extensions. The new note timings are superimposed in red over their original lengths shown in green. The sustain pedal timings shown underneath remain unchanged.

Here is an even more extreme example produced by Artificial Intelligence software that converts audio files into MIDI. While sustain is on there is only a miniscule gap between notes, and while this might not pose a problem for synthesised pianos, it is physically impossible for solenoid pianos to react that quickly.

Current version 1.00 (31 March 2023): MIDITRIM.ZIP
After downloading the ZIP file, right click it, select Properties and Unblock it.
Windows Defender has been incorrectly identifying this program as a virus and it was submitted to Microsoft for analysis. They confirm that "the submitted files do not meet their criteria for malware or potentially unwanted applications" and that as of 3rd April 2023 "The detection has been removed".
MIDI files may be either type 0 or type 1 and will normally just contain a single piano track.
Drop the MIDI file into the program window and the output file will be stored in the same folder with a modified filename ending in (trimmed).mid

There are three parameters to play with, although the default settings are a good starting point.
| Shortened Note Length | Notes for which the sustain is on for their entire duration are shortened to this value (unless they were already shorter than this). |
|---|---|
| Note-Sustain Overlap | Where sustain is only actuated while a note is already playing but then remains on for the remainder of its duration, the note may be released early once the sustain has become established. This brief delay ensures that all the dampers have had time to clear the strings. |
| Sustain Extension | Although any note that remains on after sustain has been released should not normally be trimmed, if it is only for this brief period then it is deemed to end at the same time as sustain is released and so becomes eligible for trimming. |
If the MIDI file only contains a single piano track at a constant tempo then the remainder of this section need not concern you.
In this preliminary release there are a couple of minor limitations that it might be possible to address in the future.
First, a quick recap on the two types of MIDI file involved.
Type 0 files have only one track with everything bundled in together, and with up to 16 channels available for different instruments.
Type 1 files may be further subdivided into multiple tracks with the first track
just containing common elements such as the song title, lyrics and tempo changes.