For using samples, no, we don’t recognise the pitch content in them. It’s up to the user to sort and trigger them according to manual classification, using sample
instead of play
. To a degree, we can even change the pitch of a sample to make it fit a certain note, but it is of course useful if the sample collection already provides a spread of ‘notes’!
Having said all that, there’s definitely people here that have often used samples for instruments. Here’s a useful post:
For synths, I don’t know so much about hardware, but there are plenty of free software synths out there. Some may require you to also use a ‘VST host’ program to run the synths as virtual instruments inside them, but there are free varieties of those also. Some free software synths: Helm by Matt Tytel (which can run by itself as a standalone program), https://surge-synthesizer.github.io/, … and plenty more floating around as VST plugins that may provide more realistic traditional instrument sounds.