3.5.7 The Articulate script

A more realistic MIDI output is possible when using the Articulate
script. It tries to take articulations (slurs, staccato, etc) into
account, by replacing notes with sequential music of suitably
time-scaled note plus skip. It also tries to unfold trills turns
etc., and take rallentando and accelerando into account.

To use the Articulate script, you have to include it at the top of
your input file,

\include "articulate.ly"

and in the \score section do

\unfoldRepeats \articulate <<
all the rest of the score…
>>

After altering your input file this way, the visual output is heavily
altered, but the standard \midi block will produce a better
MIDI file.

Although not essential for the Articulate script to work, you may want
to insert the \unfoldRepeats command as it appears in the
example shown above as it enables performing abbreviatures such as
trills.

Known issues and warnings

Articulate shortens chords and some music (esp. organ music) could
sound worse.