Go Down

Topic: Playing simultaneous tones? (Read 3 times) previous topic - next topic


never mind, I get it now.

What about http://sealedabstract.com/code/bassdll-an-arduino-piezo-music-library/? What does this one do, and how would I use it? (sorry for prolonging this thread, I just want to learn as much as I can)


Playing simultaneous tones?

Use the hardware pwm modules or even with timer isrs if the frequencies aren't too high.


Jan 27, 2013, 01:44 pm Last Edit: Jan 27, 2013, 01:48 pm by DuaneB Reason: 1
There are basically two ways to generate sound from the Arduino -

1) using the timers to generate squarewaves

2) using DDS to generate waveforms which may include square, triangle, sine, noise and many others.

DDS has the advantage that you can easily add envelopes to create a more interesting sound, you can also add more channels or mix multiple channels into fewer channels etc. Then you can get into waveshapers, digital filters, wavefolding etc etc etc.

Peizo projects will tend to be based on 1) the output volume is not controlled by software, only the frequency, a lot like just using the tone library.

With the timer based methods you can fake envelopes to a degree by dropping the fequency rapidly which creates and effect similar to a note tailing off as it decays for a more interesting sound.

Duane B



I assume bassDLL uses DDS, judging from your description. How would I use it?


I am not sure that it does, but if you want to I can only point you to the same Illutron B project that I have suggested in the past. The post includes a nice external link to a DDS introduction which generates a sinewave, the post itself then goes into more detail on creating musical sound.

If you pm me your email address i can send you the code.

I know that in the past you have concluded that its too complicated, it isnt really I have extensivley commented the code and if you want to take the next step to better sound its as good a step as any.

Duane B

Go Up