5 Tones, 1 Arduino

Because the Arduino is in such high demand for producing multiple musical tones at the same time; [Jeremy Blum] has successfully figured out the math and other necessaries that will take your once previously single tone producing MCU and turn it into a 5 tone producing machine. unsurprisingly its really just some creative use of PWM control but it all works out in the end anyway and helps prevent you from purchasing additional sound generating chips. This truly does open up some new doors, as [Jeremy] shows with his still in production thingamakit like project: ReacXion.

28 thoughts on “5 Tones, 1 Arduino

  1. Has this individual taken into consideration the fact that…

    …Atmel AVR chips usually aren’t meant to directly drive inductive loads with PWM?

    Especially…five…speakers?

    is there an amplifier in-between? A FET buffer? Just curious, but this seems like a good way to kill a micro.

    (Of course, these days, most people know how to code far better than they know the implications of impedance…)

  2. @stealthmonkey – if i understand correctly, making a sum of his audio and sending it to one speaker will take 100% of processor power, and still sound lousy. OTOH using the available pwm generators sounds more logical and leaves you with the cpu itself available for other tasks.

  3. @tomas
    Why would adding five resistors use more CPU?

    or, to quote and slightly modify a previous comment:
    (Of course, these days, most people know how to code far better than they know the implications of resistance…)

  4. Osgeld, it’s called critical reading skills and social awareness. please look into it and ask your doctor about aspergers.

    The end project looks pretty interesting and actually based on music theory! I can’t wait to see the results and the cooperative behaviors that emerge around it to see people exploring the musicality of it.

  5. “ask your doctor about aspergers.”

    maybe you should take your own advice

    where as my post may have been blunt, hopefully the individual that it was directed to will look up passive mixer schematics and see how simple they are, and gain that knowledge

    your response however serves no other reason other than to be an asshole troll

  6. Omg, I was just thinking about this like 2 days ago lmao. I wish I had an arduino for things like this because I am a guitarist and I like to play around with effects this cuts the need for a pc and only for the board it self.

    I lack the free time to learn how to program :\

  7. Awful summary. The article is actually of mild interest, about using only one timer interrupt to produce a number of simultaneous tones. It’s mainly of interest when the MCU is doing something else, as it leaves it almost entirely idle.

    On the more resource demanding end of the spectrum, I got eight channel wavetable on a pic16f628 (link in this post), and was fighting the poor architecture every step of the way – that would be way easier on an AVR.

  8. Osgeld is correct. Simple passive mixer, get rid of the dumb speakers. Duh.

    No offense, but this has been done before. Maybe not on an “arduino” (lol) but that’s irrelevant… I fail to see how this is post-worthy in its current state.

  9. Then again for eight bucks you can use a Parallax Propeller (or if your’re really an Arduino addict sign up for a PropDuino so you can use your shields) and then you can just run the same single-channel PWM in five cogs. Ten minute project. The sine table is even in the ROM.

  10. I jumped the gun, Osgeld isn’t the asp of this thread. (and yes I was being a dick, though I don’t think my post was completely devoid of merit)

    It’s a smart piece of artwork and good technical problem solving. skills.

    The separate speakers has a lot of potential in an installation. A pentatonic scale has a lot of harmonic overlap so the way the waveforms are being generated are going to be phased in ways that will distort and overlap in a very natural way that will sound really different on where you stand by the piece. Also because we have 2 ears and brain is really good at locating where a sound is coming from it will be much more interactive and engaging to explore the possibilities than mushing the sound into one speaker.

    It is the same reason in recording a nice amp and a good sounding room are used in recording instead of direct to board. It defines the sound in ways that let stand against or support other instruments.

  11. Without the Arduino layer, directly in C, the ATmega168 is perfectly capable of generating 5 channels (and probably more) of square wave sounds in software, and do the mixing as well using one PWM output in fast mode.

    There was another very nice project posted here a while back generated 6 wavetable channels @32kbps on an ATtiny45 (which has a superior fast PWM mode).
    See http://elm-chan.org/works/mxb/report.html

  12. Sorry to feed the troll here, but I just need to have it written that I disapprove of Justin’s offensive references to Asperger’s. As is common with such things, they make very little sense. Yes, your posts weren’t devoid of merit; why not let them stand on that instead of dirtying them with misleading attacks?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.