i am taking a raw square wave signal from a synthesizer and trying to convert that into brightness for an LED.
Unfortunately, since frequency doubles every octave, I am not getting a linear response for the dimmer. Weirdly, it is the opposite of what I would expect.
Between the lowest note and the same note an octave up, the light goes from off to half bright. and it gets brighter slower and slower as I ascend.
Does this make any sense? This seems like it should be easy to do, but I dont really know where to go from here...
Sorry, I was very tired when I wrote that post. So I am actually mapping the pitch of the synth to the hue of the LED.
I am getting the sqr wave out of the synth directly. There is a solder point on the circuit board that is just a square wave out.
I have that going directly into digital pin 7, and ground of the synth is wired into arduino ground.
Human senses like pitch, loudness and brightness are all approximately logarithmic in response -- so 10 times as much noise power sounds "twice as loud". The same is true for LED brightness, that is "twice as bright" is about 10 times as much light. You can correct for this by using an exponential lookup table to program brightness. Here is an example, but Google will provide many more http://www.avrfreaks.net/forum/logarithmic-led-brightness-function