I've been having recurring daydreams about how freeing it would be to have my own spectrogram/sonograph program, one where silence was an RGB value of [0,0,0], and where the loudest volume was [255,255,255], and where the closest thing to silence was [1,0,0] ...ect, in an ordered list with every color as a volume level, and with sounds stored as bitmaps. But I'm a newb who has only ever done stuff with pictures and console apps... ...I don't even know WHERE to begin to start this particular undertaking off on a good note.

Do you know of any good gpl resources or source code to help me start this project?

I just need a starting place, I know that whole books could and probably HAVE covered this topic in-depth, but if someone could maybe give me a list of those books [or alternatively software or web tutorials which fill the same role], those would be suitable answers. I just need to know how to start (I already know how to code bitmaps in a hex editor and kinda know how to read and write files in C++, so... I just need help with this archaic-knowledge-feeling sound generation info)


Welcome aboard. I am afraid that this question might be seen as is of-topic, as it is very broad. You might just want to ask for a library here, although personally I would not bother & would just code it all myself.

Readers, please note that this is not intended as an answer. It is just a comment that grew, and grew, and …

If I understand correctly, you want to detect sounds and display them as colo(u)rs ? I am not sure what you mean by “with sounds stored as bitmaps”, unless you want to display an image for each sound. Maybe you could/should display in a different way, like a chart, where you can see historical data, not just the current sound? Maybe, in v2.0, you could have a way to export the sounds detected (volume, duration, etc)? You could also add “Reporting” of most frequent values/average values; if you are measuring something like street noise, you could compare today with yesterday, the same day last week/last year, this month with the same month last year, etc, etc.

If you just want to display, then you don’t need to know “know how to read and write files in C++”.

First, of course, you need some hardware to detect the sound. Are you planning to use a PC, or do you want to also learn a new platform such as Raspberry Pi (I prefer the Onion Omega 2, but YMMV).

Next, how often do you want to sample the sound? Once per day/hours/minute/second? Or “as often as possible”?

If you struggle with C++, maybe consider another language? Python is much simpler, very popular & well supported, and has many, many, many, plug-in libraries, which make it very powerful.

Is your pseudo cod really as simple as this?

forever (or until interrupted)
    measure sound
    update display
    delay (if you want to wait between samples)

It’s probably best to choose a language which has good graphic capabilities. For C++ that probably means learning a library like Qt. For Python, our resident guru @SteveBarnes can help you :-)

You might want to consider how to “grow” this application, learning new things along the way. For instance, you could start it as a PC based app. Then you could have it not display anything, but instead send some info to a web server, which updates a page that you can visit in your browser. Or you could make it an Android App, add raspberry Pi somehow, etc … If any of this sounds like learning fun, then stop now and make a plan –don’t just jump straight in. You don’t want to find yourself halfway up the mountain only to look across and realize that you are on the wrong mountain ;-)

This sounds like a very simple project, but it could grow and grow (see my V2..0 above), adding features and helping you learn new skills as you go.

Sister sites to be aware of:

Tools you need:

  • An IDE such as MS Visual Studio or Visual Code for C++ (or Eclipse CDT, Netbeans, etc) or PyCharm for Python
  • Learn to use the debugger, it is your absolute best friend when developing software
  • Maybe look into Static ode Analysis (AKA Linting) to try to make your code even more bug free
  • Learn Unit Testing and end to end testing in V2, if you network your app

And so much more. I could go on & on, but this “comment” is long enough already ;-)

Good luck – and I am sure that you will have great fun with your dream

  • 1
    Also thank you for your response, I like your positivity and knowledgeability, I was hoping for more info on good resources for generating tones in C++, so that I could create something like a drawing app, and then use SDL or something to analyze each pixel's value and then decrypt it into a sine wave; and again, like, that's ALOT of stuff, but my problem is that I don't know where to start learning about tone generation
    – user179283
    Jan 3 '19 at 10:58
  • 1
    Lots of good questions, I was thinking about leaving many of those attributes to be user defined by the metadata of the bitmap actually, thanks for asking😅, and if bitmaps can't store that metadata: I was gonna pack em in with an XML document. Most people might use the human hearing range, but some people might want to make music for bats. Furthermore: the scale is determined by the space between the bounds, to allow for smooth apegios, and more flexibility and whatnot, also sinewaves are standar but other primitives should be allowed instead or as well like tris or squares
    – user179283
    Jan 3 '19 at 11:05
  • 1
    Yeah, I'm autistic AND ADHD so that may be hindering our communication somewhat. How best should I ask? I want gpl C++ libraries that let me generate tones, and/or a good link to a good tutorial, I mean that is VERY specific, but those are only CLOSE to being software... ...they're very fringe and I don't know where to ask but here
    – user179283
    Jan 3 '19 at 11:09
  • 1
    So if when a picture goes in: a song comes out. Each vertical pixel line in the image is an instant of sound
    – user179283
    Jan 3 '19 at 13:42
  • 1
    Not trying to be rude, I been up all night so my social skills took a dip. I am not trying to be hostile to you, but I'd like you to explicitly state the apparent contradiction, since: I am human too
    – user179283
    Jan 3 '19 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.