> Your computer’s sound card probably has a built-in MIDI library (like general MIDI) that will include a piano as an instrument.> Note that I’m using the word “soundcard” very loosely here: in many cases sound hardware is onboard nowadays.
Mainstream computers haven't included "soundcards" (integrated onboard or otherwise) with any kind of built-in hardware synthesis (wavetable or FM) for nearly 30 years. What you have for hardware is mostly just a dumb digital to analog converter with some mixing features and possibly some basic canned DSP/codec functions.
> The point is your computer will have sounds you need built in.
> Whereas your computer’s sound hardware is likely to have a piano as a wave table instrument
They're going to be on the hard drive as files and synthesis is entirely in software, from which you have numerous options, including what comes with the OS. MacOS and Windows come with basic MIDI soundfont synthesizers, and on Linux you typically end up using something like fluidsynth or timidity tied to JACK/ALSA.
Hardware wave table synthesis as a usual thing is long gone (AC'97 is nearly 30 years old).
I don't think there is a straightforward way to portably configure and sequence MIDI and loopback the OS builtin synths if for some reason you don't want the audio going out the default sound device (yes, it is possible, key here is straightforward to configure programatically). What is relatively straightforward is using fluidsynth with a suitable soundfont though. Depending on what you're trying to accomplish you run a soft-synth entirely in the browser.
> You can then export your track as a WAV file and chop it up into individual notes using Audacity.
There are tons of freely available SF2 soundfonts, some with wide instrument coverage, some dedicated to single instruments with multiple layers, some very high quality (just google soundfonts). Poorly redigitizing and recreating one from the OS builtin soft-synth sounds like a waste of time.
https://thedailywtf.com/articles/web_0_0x2e_1