This is due to latency issue, go into your options menu and click on audio setup, there you will see a drop down menu from internal block size, if not uncheck the box next to it to allow it to drop down. the higher the number the less crackling you will experience but the more delay between your midi key input will become find a happy middle to get the best of both worlds. Suffice to say you should make sure you have an audio interface such as a focusrite to help with this issue even more so. better audio interfaces will allow a lower block size compared to others and will in return allow for almost zero delay on key inputs and have minimal crackling noise. Some audio interfaces have an asio driver as well and this should be tried out as well to see if this helps. please take note there is also a menu on the top right that says "control panel" click that sometimes that opens a new sample menu to allow you to raise it more and help eliminate the crackles the more ms (milliseconds) raised the better it will help fix it.If all else fails this could be due to processor, not saying yours in bad in the least bit, but some of the beefier processors such as your may have high cores and perform great on most things but they tend to be only subpar on single threaded or multi threaded tasks. I am using a AMD FX8350 Black edition and only on extreme occasions have any issues. The link to get this processor https://www.newegg.com/Product/Product.aspx?Item=N82E16819113284
please make sure you have an efficient cooling system as simple installing this with a normal one can cause overheating and it will burn itself out and in rare occasion start fires due to the high power consumption and output.
Before you go buying a new Processor make sure to uncheck all but one box on the USE CPU CORES area and see if that helps to use only one rather than multiple cores
~Eclipse The Producer~