Why can't we use Ruby for sound?

Code Sound & Surround Teaser

Ruby is one of those programming languages that seems to get slotted into a specific use-case in people’s minds. You use Ruby for web development, C or C++ for high-performance code, Java for banks and insurance companies, Python for machine learning, Rust for trendily secure code, Typescript for web frontends. Everyone just “knows” these things. But why?

For a long time I had wanted to make my own A/V receiver with my own audio algorithms. Most people just buy a TV and call it done. Some people will buy a TV and a sound bar and call it done. A few more will buy a TV, a receiver, and some speakers and call it done. And the super dedicated (or super rich) will buy an expensive hi-fi system and/or home theater. But not me. Instead of just buying a receiver and pushing that “Dolby” or “DTS” button, why not do things the hard way, and make my own?

Put those two things together – my love of Ruby, and my love of sound – and mix in a bit of 2020 lockdown. I just had to prove that Ruby is good for more than web development. I ended up writing my own stereo-to-surround-sound decoder (more than one, in fact), and a bunch of other audio code, all in Ruby. Not content with that, I’ve released a lot of my code on GitHub and I’m making videos to teach others about sound, and about Ruby.

This series of videos and posts is all about my journey to find out just what Ruby is capable of, and to make the best-sounding surround decoder ever written in Ruby.

Each video uses code to explore some aspect of sound, with the goal of building up a collection of tools and ideas that we can put together to build a surround sound decoder, or solve any other sound-related problem. In the teaser/intro I show some of the visualizations I used to help further my own understanding of sound. Episode 1 covers some basics of sound, focusing on concepts that are relevant to how we experience and encode surround sound. And in episode 2 I make a synthesizer in Ruby, and make a song using only that synthesizer.

So here’s the teaser, and you can check out the rest of the series on YouTube. I’ll write more about each video in later posts, going into greater detail about the concepts demonstrated in each video.

Along with each video, I’m adding more and more audio algorithms to the mb-sound project on GitHub.

Subscribe to my channel to help support this video series and find out when new videos go live.