[sdiy] (OT)help processing realtime audio on Arduino?
dan snazelle
subjectivity at hotmail.com
Tue Feb 1 20:07:07 CET 2011
ok, I am trying to figure out how to write a tiny but of code that will hear sound on arduino input 0 and allow that integer to be stored in a variable
which can then be divided by 4 and output from pin 11.
anyway, so far my code looks like this but it doesnt work:
CODE
const int INPUT_PIN = 0; // INPUT
const int speakerPin=11 // output to opamp or speaker, etc
void setup() {
}
void loop() {
int INPUTresult = analogRead(INPUT_PIN)/4; //read the value of input and divide by 4....i dont think this is how you would divide it by 4....
analogWrite(PWM_PIN, INPUTresult); //PWM_PIN has to be a pin labeled PWM on the arduino, and the value [0,255]
}
end code
sorry if this is a big mess. I have gotten a couple books on arduino but they all seem to completely skip over reading sound into the arduino and outputting that same sound
what i would like to try and do is just real simple experiments with the audio.
i am not even trying to save it in RAM. eventually i would like to try an R2R ladder out of the chip. would i use the non-pwm pins for that?
there was an interesting article by LAB 3 on realtime audio processing on the arduino but it went WAY over my head
and the arduino forum seems populated with a lot of people who dont have any real connection to synths
so that is why i am asking here.
thanks for any help advice or links
More information about the Synth-diy
mailing list