Regarding MIDI:

That would certainly rule out any issues with key switches or mechanics.

Is the piano new enough to have a USB port? Many keyboards do, with the capability to present themselves to the PC as their own MIDI device, alleviating the need for a third party MIDI interface.

Does this thing have fancy weighted/levered keys that are designed to feel like real piano keys? If so maybe there’s an issue where the key mechanisms of a couple keys are loose and rattling, but only when the keys are in the “pressed down hard” position. This might make a physical buzzing noise that sounds similar to distortion.

Does the noise appear to get quieter or go away if you turn down the volume? You could diagnose whether or not it’s related to frequency resonance in the speakers or body of the piano by fiddling with the volume.
_________________________
Tony Fabris