A DDS is an NCO or numerically controlled oscillator, ONLY. Whatever yopu wish to do with the 'envelope' must be done with gain controlled amplifiers.
The AD9850 is a sinewave output device that can manage 2 sine outputs and a square wave but it's been a long time since I've read that particular data sheet.
Questions I have are
- can I use this as I could use a "industrial produced musical instrument"? Which means
- does the chip
has have the capability (or capacity) to generate envelopes to produce complex sound? No.
- how to edit the parameters if the chip is capable to do that? With
potis ed]pot is? attached to one the pins and vi other reason than to clean up the output or level shift it... ?? What?
- does it really make sense to invest in a DUE if the questions above can be answered in a positive way? No the function used to change frequency is SPI driven and FAST enough at an 8 MHz spi transfer rate to let you digitally control the waveshaping and envelope generation of the musical note generated by the DDS and it's frequency and duration
- is the more coffee? unless you've made a pot, None fresh
The first challenge is that musical instruments with a few exceptions don't generate sine waves, flutes perhaps... so there will be a shaper required... Google it and you will find a whole lot more about 'coloration' of music or the art of adding selective distortion of / to a sine wave. Analog devices makes a bunch of different DDS devices and there are more from other MFR's.
The code mentioned in the first post is I'm sure more about generating RF than music but the AD9850 is a fast and versatile DDS device that can be purchased wired and working on a PCB (hopefully) for less than $10.00 US, Shipped..
I've enclosed some miscellany from an Ebay AD9850 I bought a year or so back... there are other devices that might make better synth chips but it is certainly do-able with this device... unfortunately it is my opinion that it is beyond your skill set at this time..
This is in no way meant to discourage you, just to tell you that it is going to be a real "Project" and you really appear to need a little more education both on synth music and how/why to use a DDS device.
An AD9850 DDS makes a very stable numerically controlled oscillator variable in 12.5 deg phase steps. It can be programmed in 5 byte parallel or 40 bit serial modes and is reasonably fast to change frequency and/or phase. The final accuracy for music is well within the thermal stability of the clock oscillator supplied and is perfect for the typical uses... An L.O. for a radio or a versatile RF generator and the frequency is as stable as the ref osc is...
Btw. adjacent musical notes in a well tempered scale differ by the 12th root of two or 1.05946
but I doubt that more that 5 decimal places accuracy is required.
Funny but I remember that from tuning electronic organs back in the early 60's . Later Mostek
made a top octave (MK 10240 IIRC) generator that used a 3.59 MHz color burst crystal... They're available... on Ebay for $40.00 - $50.00 today but for that kind of money and Ebay's notorious reputation for selling "Re-Branded" or plain fake chips i'd not trust it at all as the part was discontinued in the (IIRC) late 90's and I bought one in 2002 or 2003 from RadioShack.. long since gone. Much cheaper to connect an AD9850 DDS to a Pro Mini and store the 'notes' as binary data with a byte for the required octave... the math is simple enough and easily done with longs.Edited for content and clarity... Doc