Posts

Showing posts from July, 2024

Implementing multi-threading support for sonifyCPP

Image
 SonifyCPP is my software written in C++ that "sonifies" or creates sound from any input image. I have explained in my last blog post how exactly this is done. The input image pixels have to be read one by one, and in my approach I generate sine waves for each of these pixels. Clearly, as the image dimensions increase, the computational cost increases. One simple way of increasing the speed of sonification is to just naively downscale the input image to a dimension that is "sonifiable" (something like 200x200). But this approach is just....meh. So I thought, instead of sending the pixels one by one to the sine wave generator, how about I send it in columns. And that's what I did. This, sadly, did not result in considerable speed up. So, the only other way was to implement multi-threading. Multi Threading For those who have been living under a cave, modern computers have processors which have more than one working "brain" or cores. (Note: I'll use p...

SonifyCPP - A software for converting images to music magically

Image
 Well.....it's not magic, it's programming and mathematics that's helping us produce the music or audio signals. A while back, around November of 2023, I had participated in the NASA Hackathon. There was variety of projects to choose from to work, I chose the project called "Image Sonification". Me and my team members had 48 hours to code the software in any language we wanted. We chose to do it in Python for some reason. Okay, I'll back up out of the flashback for a second to describe what Image Sonification actually is. Similar to how microphone is used to produce some audio signals and then is processed on a digital audio workstation to produce a digital audio, Image sonification refers to the process of converting the images to audio signals. Coming back to the hackathon flashback, we finished coding the project to produce some sort of "music" from input images that were smaller resolution (We couldn't figure out a way to optimize the code to...