I’ve noticed some files I opened in a text editor have all kinds of crazy unrenderable chars
You’re looking for https://en.m.wikipedia.org/wiki/Character_encoding Which explains the funny characters.
can it? Sure, most any arrangement of bits can be converted into some kind of Unicode text. Can it be converted to something meaningful or readable? No, some formats are plain text (.txt, .ini, .json, .html for some random examples) that are meant to be read by humans, and others are binary formats that are only meaningful when decoded by a computer into specific data structures inside a piece of software.
At the end of the day data is just binary, i.e. it’s composed of 0 and 1. What those 0 and 1 represent is mostly irrelevant to this discussion. The short version is that 01000001
can mean A
or it can mean that a given pixel is 65/256
red, or that the speaker should vibrate in a specific frequency, etc, etc.
So what happens when you open a file that’s not text in a text editor? Well, some of the 0 and 1 make up gibberish, or characters that are not meant to be printed. Fun fact, you should be able do this the other way around too, i.e. open a text as an image, but again it will be gibberish, and most likely would not load since images have lots of information that relate to size, compression, etc, that if incorrect the program won’t know what to do, but because text can always be valid it will always work, although sometimes your editor might show weird thing in the places where there’s a non-printable character.
Yes, see Binary-to-text encoding (e.g., Base64).
Can you comment on the specific makeup of a “rendered” audio file in plaintext, how is the computer representing every little noise bit of sound at any given point, the polyphony etc?
What are the conventions of such representation? How can a spectrogram tell pitches are where they are, how is the computer representing that?
Is it the same to view plaintext as analysing it with a hex-viewer?
There’s two things at play here.
MP3 (or WAV, OGG, FLAC etc.) provide a way to encode polyphony and stereo and such into a sequence of bytes.
And then separately, there’s Unicode (or ASCII) for encoding letters into bytes. These are just big tables which say e.g.:
01000001
= uppercase ‘A’01000010
= uppercase ‘B’01100001
= lowercase ‘A’
So, what your text editor does, is that it looks at the sequence of bytes that MP3 encoded and then it just looks into its table and somewhat erronously interprets it as individual letters.
I think you are conflating a few different concepts here.
Can you comment on the specific makeup of a “rendered” audio file in plaintext, how is the computer representing every little noise bit of sound at any given point, the polyphony etc?
What are the conventions of such representation? How can a spectrogram tell pitches are where they are, how is the computer representing that?
This is a completely separate concern from how data can be represented as text, and will vary by audio format. The “simplest”, PCM encoded audio like in a .wav file, doesn’t really concern itself at all with polyphony and is just a quantised representation of the audio wave amplitude at any given instant in time. It samples that tens of thousands of times per second. Whether it’s a single pure tone or a full symphony the density of what’s stored is the same. Just an air-pressure-over-time graph, essentially.
Is it the same to view plaintext as analysing it with a hex-viewer?
“Plaintext” doesn’t really have a fixed definition in this context. It can be the same as looking at it in a hex viewer, if your “plaintext” representation is hexadecimal encoding. Binary data, like in audio files, isn’t plaintext, and opening it directly in a text editor is not expected to give you a useful result, or even a consistent result. Different editors might show you different “text” depending on what encoding they fall back on, or how they represent unprintable characters.
There are several methods of representing binary data as text, such as hexadecimal, base64, or uuencode, but none of these representations if saved as-is are the original file, strictly speaking.
Most binary-to-text encodings don’t attempt to make the text human-readable—they’re just intended to transmit the data over a text-only medium to a recipient who will decode it back to the original binary format.
I do understand I’m not able to read it myself, I’m more curious about the architecture of how that data is represented and stored and conceptually how such representation is practically organized/reified…
technically, yes. all unprintable binary can be resolved to 64 printable characters. but that resulting string may not be english or any human language.
But its still contains the actual data in a faithfully reproducible/useable way?
Yes. Decoding a base64 encoded string will give you back the exact original data.
Importantly though, this isn’t what you’re seeing when you open files in a text editor as you describe in your original post, and if you copied the text of those files and saved a new copy it’s very likely that it would not reproduce correctly.