Ask shown here, the MIDI works well before recording. After recording, there is noise.
How do I fix this?
What you're hearing is clipping, this occurs when the waveform changes sharply or suddenly, to a value more than the audio's maximum tolerance. It occurs most commonly in LMMS when a waveform is cut wrongly, which is likely what is happening here.
My first instinctive solution is to lower the instrument's volume, so your note isn't as likely to hit the audio 'ceiling'.
If that doesn't work, and your sound doesn't clip while playing, my personal best solution is to edit the instrument properties so that the envelope has a sustain / release value to it. This will lower the volume quickly instead of simply cutting off the note.
There are also other tools out there such as Audacity that have features/plugins to help remove clipping. If you're OK with it during production, you could simply go back over your exported sound and edit it.
If your instrument is always doing this, you should take a look at the MIDI velocity the notes are coming in at. It may be a bit too high for many instruments not to clip.