Mordents should be on-beat, not grace notes. And pralltrillers
(half-shakes) are always either 4 alternating notes, or an inverted
mordent.
There is of course a general problem here in that the way ornaments
are realised has changed through the centruries. Even Bach and Clementi
disagree! I'm following CPE Bach's 'True art of the Keyboard Playing'
in the interpretation here. To do the job properly we'd have two
articulations: \prall and \inverted_mordent and treat them
separately for MIDI, but typeset the same glyph.