OK, so the crackle means audio is being lost. I’m guessing that you recorded midi in C8.5, sent it to the P515, then recorded the line output. Somewhere, a device couldn’t keep up. There are 3 possibilities: the interface, the cables, or the laptop.
If it’s the interface, then it might be the buffer size in the ASIO driver. We like to keep it small to reduce latency when recording, but keep it large w
then mixing. Since latency isn’t an issue, you could try increasing the number of samples in the buffer.
If it’s the cable, then try a different cable. Otherwise, remove sources of electrical interference.
If it’s the laptop, then it may not have the processing power to record audio at all, or it could be that the processor is being interrupted by other apps and services running in the background. You’d want to shut down all other apps, such as browser, pdf-reader, etc., and you might want to search the net on how to optimize your laptop for audio work, which typically involves shutting down a lot of info-apps and useless services.
On the other hand, the P515 manual describes a procedure for recording audio to usb flash memory. I’d think that would be a good option because it avoids the D to A conversion (done by P515) followed by A to D conversion (done by interface). You could import the file to C8.5. One advantage of this is that the P515 doesn’t have to work in real-time.
All that being said, it seems that you can do audio over usb directly to the computer, which also avoids the interface, and the (D to A) + (A to D) conversions. Since that’s the recommended approach, perhaps it’s what you did, and you still got this noisy result. I think that in the general case with digital audio over usb you need an ASIO driver specific to the instrument. This means not using the interface when you render the MIDI as audio. If you don’t like swapping ASIO drivers in and out of “Studio > Studio Setup…”, there’s the ASIO4ALL option, which allows multiple ASIO drivers to run concurrently. I’ve avoided ASIO4ALL, but other people seem to like it.