Pages: [1]   Go Down
Author Topic: Tone() and DAC  (Read 717 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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?
Logged

L.C.

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 21
Posts: 1670
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 -


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 -



Duane B
Logged


Pages: [1]   Go Up
Jump to: