Go Down

Topic: First Due Project Quick And Dirty Synth At 44.1Khz (Read 3642 times) previous topic - next topic

DuaneB

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 -

http://rcarduino.blogspot.com/2012/11/quick-and-dirty-synth-for-arduino-due.html

And as it says in the code, thanks to Sebastian Vik for the head start -
http://arduino.cc/forum/index.php?action=post;topic=130423.15;num_replies=20

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

Grumpy_Mike

That looks great.

Quote
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.
http://vimeo.com/38466551

DuaneB

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

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

   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 -

http://www.adventurekid.se/akrt/waveforms/

   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

   

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

Grumpy_Mike

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.

DuaneB

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
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

Grumpy_Mike

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.

DuaneB

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

http://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/

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
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

Grumpy_Mike

Quote
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.

cyclegadget


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.
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

Grumpy_Mike

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

Yes that is a good use for the Due.

Quote
what to do with the raw guitar output

Amplify it to 5V peak to peak.

Quote
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.

DuaneB

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

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

DuaneB

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

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

Grumpy_Mike

Quote
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/

cyclegadget


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!
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

Go Up