First Due Project Quick And Dirty Synth At 44.1Khz

Hi,
Borrowing a lot from the timer interrupt thread I knocked out a quick synth project for the Due. Its running at a sample rate of 44.1Khz, the same rate as a CD, its also using the DAC for output.

For the DAC Configuration I have cheated and used analogWrite(DAC0,255); to initialise the DAC, then access it directly in the ISR using dacc_write_conversion_data(DACC_INTERFACE, ulOutput);

Its quick, I can't really say that its dirty, at the high sample rate my first and only impression is that it sounds really clean and crisp.

I will use this code as a framework for a wavetable synth as can anyone else who wants to grab the code from here -

And as it says in the code, thanks to Sebastian Vik for the head start -

Duane B

That looks great.

I will use this code as a framework for a wavetable synth

My SpoonDuino project uses a wave table synth generated from an iPad talking to Processing through TouchOSC. I haven't put it on line yet but you are welcome to have the code if it fits in with what you want to do.

Hi,
I plan to add wavetables as another synth option on the five dollar keyboard -

I found a resource with 1,000's of 16 bit single cycle waveforms that I was planning to store on an SD Card so the user could browser and play them through the five dollar keyboard.

Heres a link to the adventure kid website where he provides the wavetable collection for download -

There is a also a collection of 8-bit Nintendo waveforms which I will have a play with on the current 5 dollar synth before I migrate it to the Due.

Are you hand drawing your wavetables on the spoonduino ?

Duane B

rcarduino.blogspot.com

No, what makes a wave interesting is not so much it's waveform but how it's waveform changes over time. That attachment shows the iPad app that allows you to draw the envelope of each harmonic in the wave. As you do that the right hand side shows the resulting 16 wave tables. The spoonduino plays each waveform for a bit before moving on to the next. This can be looped or done as a one shot.

Hi,
I have reread your post many times and think I finally get it.

Each harmonic is given its own envelope, all envelopes are divided into sixteen common intervals, the sixteen waveforms are the result of summing the product of the harmonics and their corresponding envelopes at each of the sixteen intervals ?

Having read a little more about wavetable synthesis, its not what I will be doing, I will aim for something less UI intensive which will most likely be as simple as providing the option to load one or more wavetables in place of the usual oscillator shapes. Its hard to beat the instant appeal and immediate simplicity of the Auduino, and its that spirit that I want to capture in the five dollar keyboard - I have a few effects to morph the sound, bit crushing being a simple and effective example.

Duane B

rcarduino.blogspot.com

Yes that is it.
If you go with a fixed waveform then altering the amplitude as the sound progresses is standard. The Attach, Sustain, Decay envelope is popular.

This is the collection of waveforms I was planning to put on an SD Card and explore with my various Arduino synth engines -

If you browse around you will find samples in the repository as well.

I was thinking of just using an LCD, a pot to scroll and a few buttons to traverse up and down through the directories/waveforms.

Hopefully it will sound interesting, the five dollar keyboard is quite entertaining as it stands, the addition of these waveforms and bit crush, xmode, echo and overdrive effects modulated by a spare oscillator should make it a little more interesting without having to build too much of a user interface.

For the moment I am just using an organ envelope - i.e. on/off, I know I will need to add ADSR at some point.

Any experience with this type of waveform - am I going to be disappointed ?

Duane B

Any experience with this type of waveform - am I going to be disappointed ?

Yes lots.
I think you might be dissapointed with the results. One cycle of a sax waveform is not going to sound like a sax when repeated. What gives sounds their unique tambura is the way the waveform develops over time. So a plucked string for example constantly changes the mix of harmonics it has in it so it sounds plucked. The same goes for other sounds like blown ones. Basically any waveform repeated will always sound like an organ with a diffrent arrangement of stops pulled out.

Do you guys have any thoughts about using this project for an effects box with a guitar?
I want to create a multi-effect box for my guitar I have.

There are units available to add many effects to the guitar sound but, I would like to create my own box.

At this point, I need advice on what to do with the raw guitar output and then how to run it back into my amp at or about the same voltage the guitar would produce.

I want to create a multi-effect box for my guitar I have.

Yes that is a good use for the Due.

what to do with the raw guitar output

Amplify it to 5V peak to peak.

how to run it back into my amp at or about the same voltage the guitar would produce.

Put it through a potential divider and couple it with a capacitor.

That would be quite an interesting project - driving home from work I was thinking about using the Due as a rough auto tune for vocals, would be five minutes of fun at the christmas party - if only I could find the time.

Duane B

Hi,
Question from GM, how would you amplify the signal to 5V peak to peak - I assume its micro volts of pure AC, so do you use a summing op-amp to add a 2.5 offset and gain ?

I am interested in giving this idea a go.

Duane B

so do you use a summing op-amp to add a 2.5 offset and gain ?

No. Just have two resistors generating a mid point and AC couple into it. Just a normal op-amp amplifier to get the amplitude up.

http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/

Thank you Grumpy_Mike!

I will try to get going on the project. I have a couple op-amps and will have to see if I can make them work. This could be so cool!