[sdiy] (OT)help processing realtime audio on Arduino?
Olivier Gillet
ol.gillet at gmail.com
Tue Feb 1 20:42:46 CET 2011
Maybe you should set the pin type for your output pin with pinMode?
Besides that, a few general comments:
- By default the sample rate of the in-built ADC is very slow (a few
kHz). You need to change it, with a potential increase in input noise.
In-built ADC on the AVR chips are quite low-fi.
- Doing audio in/out in a loop() is a terrible idea. You need at least
to use timers, or better, a ring buffer with processing in a loop and
I/O in the timer interrupt.
- For a R2R ladder you can use any pin. "PWM pins" can be used as
standard GPIO pins. It's quite easy to write 8 bits in parallels to a
block of 8 contiguous pins by addressing PORTA/PORTB/PORTC. I don't
think the Arduino library exposes that, how sad.
- If you output PWM, you'll see a continuous "analog" voltage with a
meter or anything that includes a low-pass filter (multimeters have a
filter to "average" the readouts). If you're interested in processing
CVs, it's likely that the raw PWM output won't work since modules
don't have low-pass filters on their CV inputs. You need to add a RC
filter, with a slow time constant (say 1ms) if you're processing CVs,
a faster one if you're processing audio.
- Check simple Arduino sound projects like Auduino to learn more about
generating signals at audio rates.
More information about the Synth-diy
mailing list