Go Down

Topic: Tone() and DAC (Read 929 times) previous topic - next topic

Patouf

Hi, I haven't got my Due yet, but I saw that the DAC pins allowed to make any kind of sound signal, so I wondered if this worked:

Code: [Select]
tone(DAC0,some frequency);

And if yes, would it make a square wave or a sine one?
And if no how can i get a sine wave from it?
L.C.

DuaneB

Hi,
   I also do not have a Due yet, but when I do I will be converting some of my synthesizer projects to run on it.

   The Due will generate a square wave, you have to write code to generate a sinewave, the most common technique is known as direct digital synthesis. This approach uses a table of values to generate the output waveform, once you have a basic framework up and running you can generate any waveform you want including some very out there waveforms.

   I have a four oscillator wavetable library up and running on my UNO which I will convert to Due once I get one.

Here is a good intro to direct digital synthesis technique -

http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/

   Its worth mentioning that sinewaves are not very interesting, they are very plain sounding, squarewaves, rampwaves and all kinds of broken up waveforms are more interesting.

   I recently found an online resource where a guy had collect 100's of waveforms and made them available for download, one of my first due projects will be to put these onto and SD card and build a quick synth engine to play around with them.

Here is a quick UNO Based project that shows off some DDS with a bit more background -
http://rcarduino.blogspot.com/2012/08/the-must-build-arduino-project-illutron.html

And here is my current DDS Synth engine in action -
http://www.youtube.com/watch?v=ZuKoG15oObk

And finally this hypnotic little video of someone messing around with a synth engine and an oscilliscope - not a sinewave in sight but lots of wavetables and wavetable mixing -

http://www.youtube.com/watch?v=BGjfjzggYDo

Duane B
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy