Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
YO MAMA HEAD
Sep 11, 2007

Does anyone here have any advice for working with PWM audio on the Arduino Uno? I'm trying to make an algorithmic synthesizer (a la http://countercomplex.blogspot.com/2011/10/some-deep-analysis-of-one-line-music.html) and have gotten past the ugly problems of on-the-fly string evaluation and getting sound to come out of the dang thing. I'm having two main problems:

—What values should I be throwing this thing? The details of the ugly register construction is well beyond my experience level. Pages like http://arduino.cc/playground/Code/PCMAudio seem to suggest it's an unsigned byte, but I only get low rumbly squelches unless I shift my values left a few times.

—Is there any reason the speed would be wobbling from its supposed 8000hz clock? I don't know enough to tell if this is a consequence of the affordable hardware or my laughably bad attempts at memory management.

I will pastebin code if necessary, but I imagine these questions can be answered more generally. Thanks!

Adbot
ADBOT LOVES YOU

  • Locked thread