The problem sounds like the MIDI routing is going into a feedback loop. This means the sampler device getting signals from Studiologic, is sending the MIDI data back to the Studiologic. And Studiologic doesn't understand that it is its own signal returning back but thinks that the MIDI signal is coming from another controller. Therefore Studiologic passes it directly to the sampler, which causes a feedback loop. Since this happens very rapidly, you hear a detuned sound because same sample is triggered more than once with very close intervals.
The channel on the sampler should only accept MIDI signals, not send any MIDI signals back.
For example this is how it's done in Nuendo 4 channel settings. MIDI-in of the instrument channel is accepting signals from Scarlett but not sending any:
.