Coding help for Arduino

davidenlasmontanas

Beta member
Messages
2
Location
Sweden
Hey everyone, this is my first post, I hope you could help me with a school project me and some friends are working on. :)

We want to create an interactive painting tool where the user paints by using sounds.

Therefore, we think an Arduino could help us doing this. We have an idea that the pitch on your voice will decide the color. The brush size will be decided by how loud your voice is. Maybe even program so more variables could be included, such as velocity, overtones, formants. But this is secondary.

How could we write the code so different frequencies triggers different colors and and different volumes triggers different brush sizes?

We've had a thought of having low frequenced sounds dark colored and the higher pitch you have the brighter the colors will get. If you make a soft sound, the brush size will be big. The louder you make the sound, the smaller the brush gets. So if you want to make a big black blob, just make a weak groan. If you want to make a bright yellor tiny dot, make a high pitched scream.

Thanks in advance!!
 
You'll want to find a sound input library for an Arduino (I assume you're using C or C++ as your language?). One that gives values based on the frequency, decibels, etc. on the sound input from a mic (or whatever your input source is). Then you can base the brush size, color, etc. based on those values.

I've never done Arduino programming, so I'm just tossing out ideas based on what I've done for programming (normal desktop applications / web applications).
 
You'll want to find a sound input library for an Arduino (I assume you're using C or C++ as your language?). One that gives values based on the frequency, decibels, etc. on the sound input from a mic (or whatever your input source is). Then you can base the brush size, color, etc. based on those values.

I've never done Arduino programming, so I'm just tossing out ideas based on what I've done for programming (normal desktop applications / web applications).
Thank you for your answer, that makes a lot of sense.

What exactly do you mean with a sound input library? I have never ever done any coding like this so I'm completely lost. There is a software to the Arduino and yes, it's C or C++ (don't know which) and in that software there is a library with presets but I don't know where to start.

Do you have any idea how I can start?
 
Like I said, I've never done any Arduino programming so I won't really be able to help with specifics, but I can try to help on basics.

A library is a .DLL or .H/.CPP file with pre-written functions and such used for a specific purpose. So a sound library could have functions specifically for getting sound from a hardware device and getting the decibel level / frequency - which IMO would be most of the "hard" work done right there. Here seems to be a decent list of audio libraries for Arduino:
Arduino Playground - LibraryList

Could look through them and see if they give anything close to what you want. You may have to combine a library and custom code, or even a couple libraries to do what you want.
 
Last edited:
Back
Top Bottom