💾 Archived View for hipstre.flounder.online › cmuse › 20210224W1807.gmi captured on 2023-06-14 at 13:56:00. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-03)
-=-=-=-=-=-=-
Here are my notes on what I call "C-Music". This is a simple incrementing index that is bit-busted (put through a phrase of bitwise operations, shifts, ANDing, ORing, XORing, and so on) and then output raw. In 2012, the originator of this hack (who name is lost to me! I wish I knew so I could give credit where due. If you know: hipstre@protonmail.com) fed the numbers straight into /dev/some-sound-device. Quickly, some clever hackers made little websites that took the mess of bits and chopped it into a 44.1khz mono wave (at 8-bits, I believe). But this stream can be "synæsthetized" into any format. My latest experiments (I hope I can find them) were in C, rather than C++, and generated raw 16 bit output. I would then open Audacity and import it raw, at which point I could do anything I wanted with it. I could do it 8bit, 16bit, 24 even. I could do it stereo, Little Endian, Big Endian, Middle Endian. I could set it to 8kHz, 16kHz, 22kHz, 44.1, 48, 96. And I would do all that. So for every raw output, I was generating a dozen files by hand.
I never found a good sound format for output. I couldn't figure out how to code a .wav file… manually (if you will). Waves have this strange demand that the data comes in "chunks" and that any unfilled bits be set to 0. Why? Why not just make sure the chunks are a multiple of 32 bits? In fact, WHY HAVE CHUNKS AT ALL? The answer, it turns out, is that the format was standardized in the 1980's. It's a derivation of the .RIFF format which assumes "page" sizes of 64k, a Microsoft gift that keeps on giving. Why can't we have a simple header over raw data file format? Even Sun Microsystem's .au format has bizarre demands.
I left it all off trying to figure out how to shoehorn the .wav format to work for me and I never could get it right. I assume that there is a C Library for working with .wav files, but I can't figure out how to do these things. My latest thinking is that I should do this all in Ruby, but the Ruby gem (Anyone else a little irked by "gem" being hijacked by gemini when Ruby already has "gems"? My guess is "No" because apparently I am the only person in the world who uses Ruby for anything other than Rails, a mystery I cannot comprehend) wavefile is a little "mysterious" to me. This leaves Python, which I feel certain has an excellent .wav module. I've said too much. I often sound like I know what I am talking about when I don't. My whole life is leaving semi-colons off the end of things.
comments: hipstre@protonmail.com