You don't seem to understand 'intellectual property', which is what we're discussing here.
Someone (Yamaha, Korg, whoever) has spent a lot of time and money sampling and then processing them to make them playable in a keyboard. To then sample their samples or reverse engineer them is theft of their intellectual property and therefore IS illegal, however much you then do to the sounds. Look up the meaning of 'derivative' in this context. I won my own 'case' as it was clear cut, and didn't even have to go to court!
Yamaha actually do own the rights to the sounds and styles that we use, but they specifically allow us to use them in music production without paying them royalties.
I've seen several instances on various forums of reverse engineered sound libraries for keyboards. As yet, Yamaha et al don't seem to worried, as the figures are no doubt quite small and not worth them worrying about. But if they wanted to force the issue, they could.