I've been doing more research on pianos (again) and finally tried out some neat technologies and wanted to talk about them (and their pricing)
Preface
So my digital piano comes with about 3 usable (unique) piano sounds. There's two grand pianos and one upright (and then a bunch of others that are probably useful to some people). The problem is, I can't use the two grand pianos, because there's something about them that really messes with my ears. Apparently this is relatively common: the same sound can be perfectly fine for most and then absolutely jarring for others. Everyone has sounds they like and dislike, and it's one of the reasons people always urge you to try instruments before you buy them. I asked several people and nobody could hear what I was hearing, yet every time I'd play some notes in a certain octave, it's like they would twang metallic and unnatural and drown out all the other notes. It's SO jarring that I had to just stop using those two.
This is mostly fine, the upright piano sounds great! And when I get the chance to practice on real acoustics, they're all uprights anyway, so it's a cozy sound to me. But there's another problem: this stupid 3000 dollar pile of particle board and branding doesn't let you record audio properly. How... how?? How is this not a thing. They even say on their official website "yeah just like... record the output from the headphone amp?". We'll see why this is a problem later.
Recording audio
So real quick: most digital pianos, even really really cheap ones, let you at least record wav to a USB stick. My parent's cheap Casio, which cost 1/5 of my piece of garbage, lets you do this. The fact that mine can't is specifically a "we restricted features to try to get you to buy the more expensive model". Thanks, capitalism! Always check the features of a digital piano for what you need, never assume it has something just because it seems obvious. I'm dumb and didn't do that.
Anyway, if for some reason your piano doesn't support recording to external media, you can get a decent-ish recording out of an amplified 3.5mm port (the one you use for headphones) if you are either (a) careful and have the right computer hardware or (b) just get the right device. Sony still makes handheld recorders just like the oldschool ones from decades ago, just with digital audio instead of tape. These all also have a line in port with protection against over-powering, so you can use it to record amplified sources. This is a reasonably failsafe and all-around decent way to record ANY analog output over a line (maybe this is why headphone ports are being removed? blegh). There are other brands which make these kinds of devices, up to you what you want to use. One issue though is that audio is often a bit crackly even though it's not clipping.
So, what about option (a), just using a computer, or a phone? There's a couple problems: one is that you need a device which has a dedicated microphone port. Those are weirdly rare these days!! Not a single one of my computers or devices had anything like that. And though phones that still have headphone jacks all mostly have TRRS compatible ports (meaning you can have a mic signal; that whole thing is actually pretty interesting and you should look it up), you need a splitter to make it work AND the mic is mono only AND for some reason I couldn't find a single recording app which would accept the input from that source, even with a splitter. They all used the external mic with no option to switch. Maybe it's an android/ios thing. And even if you do manage to get it working, that port expects almost NO power on that mic line. Audio is transferred over analog as voltage differences (think of waves, and their amplitude is the voltage), which only induces a TINY current in the line. It's why you don't need to power (most) microphones; you can get this voltage difference using a sound-sensitive membrane attached to magnets. But going the other direction: headphones need a lot of power (relatively speaking), so those signals are amplified to have more. Unless the receiving device is expecting this (many are not), you can very easily damage your recording components. Be careful, and consider just getting a dedicated recorder!!
Or you could just record out loud I guess... that has a whole host of other problems though. There's a reason you have to go to a dedicated studio to record good audio and can't just do it in your living room (though there is definitely a "home recording" vibe which can be cool).
An alternative
OK here comes the cool technology part. Even if the company that sold you your piano has decided that basic usability features are for premium customers only, they ALL invariably have a midi output. Like... if they start removing that, oh my goodness. Also, most piano tutorial apps expect this midi output to tell you if you're playing right, since detecting it through the mic SUCKS. But anyway, yes, midi out. Your digital piano is ofc a giant midi keyboard.
MIDI is a universal "music language". It describes the sounds instead of sending the recording of one. So if you play middle C on your piano, it'll send information that (a) you're playing a piano (b) you played middle C (c) you played it for this long and with this attack (d) extra data about the current state of the piano (sustain etc). And other things maybe, IDR. Your digital piano actually often uses this same information to produce the sounds you hear, since it has to produce the information anyway.
Well, if you have all the same information the piano has in order to produce sounds... couldn't you have a program listen to that MIDI out and produce your OWN sounds? Yes! And this solves both problems of recording and of "I don't like how my piano sounds". There are various pieces of software, usually called "VST"s, which will take this midi output and produce sounds on your behalf. And some of them do it in VERY cool ways.
Modeling
Most digital pianos use "sampling" to produce the piano tone. They went out to real acoustic pianos and carefully recorded TONS AND TONS of sounds, such as each note at various levels of attack, and then created a huge bank of samples. The piano then plays back these samples as you play the right notes, and then sprinkles some fancy extras on top to make it more convincing. This used to be the "better" way to do it, as you could get relatively convincing audio samples with the right equipment and I mean... you're literally recording the real instrument.
Another approach is to attempt to model the physics of the sound, the materials, the instrument, etc to generate the sound in real-time. After all, an instrument is a complex system and you can't accurately capture all the nuances just from recording. If you play two notes at the same time on a real acoustic piano, it's NOT the same as recording the two notes individually and playing them simultaneously. There's a whole mess of harmonics, making an absurd amount of combinations. But if you could model the system, then all combinations can be generated as needed. People often compare modeling to video games, which I think is an apt comparison. Modeling has been getting better lately as computation has gotten cheaper and we've developed better algorithms and such. For many people, the difference between modeling and sampling is negligible at best, and may often be in the favor of modeling depending on the person.
Since you're actually generating sounds as needed using physics-based modeling, software which models the sound usually gives you a VERY high degree of control over the generation of that sound. With samples, you can only stretch and mangle them so much before they become unintelligible. So while you can add reverb and layer extra effects on top of the sound, or maybe brighten or dampen the sound a bit, you can't necessarily change the fundamental character of the sound, since it was recorded from a very particular piano. But with modeling, you're basically creating a piano yourself, so you can easily change stuff like the hammer hardness, soundboard resonance and characteristics, overall body resonance, etc.
I just think it's cool! Especially as a programmer! It's always way cooler to write a program that really GENERATES something in real-time vs something that just repeatedly shoves massaged precomputed data in your face.
Cost
OK this is a bit of a double-edged sword. On the one hand, for SOFTWARE, I think stuff like this is expensive. One of the most popular piano (and string-based instrument) modeling software costs around 140 USD to start, and they expect you spend more like 300+ on it for all the features. And each additional instrument pack is like 50 extra dollars (though you do get some with your purchase). It's at least not a subscription, but that's a steep cost just to change the sound of your piano. But on the other hand, this one time purchase will let you transform ANY digital piano, regardless of speaker or sample quality, into a beautiful and highly realistic sounding piano (and give you excellent recording features). So... I don't know, it can kind of pay for itself in some cases? You buy a really really cheap digital piano with a good enough action for you, then you hook it up to this software and save potentially thousands of dollars. It just sucks that as usual, everything surrounding playing the piano is ridiculously expensive compared to other hobbies.
But regardless... I'm actually happy with the purchase, even though it was spawned by my piano's inability to just RECORD TO A DANG FLASH DRIVE. And me not trying the piano out before I bought it.
Thanks for reading

🏳️⚧️