AD9833 Poly Signal Generator – Part 2

Following on from having built a six-way AD9833 Poly Signal Generator shield, its time to play with the pots and buttons.

Warning! I strongly recommend using an old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments or amplification!

These are the key Arduino tutorials for the main concepts used in this project:

If you are new to Arduino, see the Getting Started pages.

Parts list

  • Arduino Uno
  • 6x AD9833 signal generator modules
  • AD9833 shield as described here: AD9833 Poly Signal Generator
  • Amplification/speaker for output

The Circuit

This is using the shield as is with the mono jumper present and using both switches and potentiometers, but no MIDI.

The Code

There are many choices of what to use the potentiometers and switches for.  For this demonstration, I’ve set it up as follows:

  • Switch 1 – coarse pitch – low or high.
  • Switch 2 – waveform – sine or triangle.
  • Potentiometer 1 – frequency.
  • Potentiometer 2 – frequency multiplier (for detuning/chorus).

There are two “helper” functions that will set the frequency and mode for all six signal generators.  The set frequency function accepts two frequency parameters used as follows.

void adSetFrequencyAll(MD_AD9833::channel_t ch, float freq, float freqdiff) {
for (int i=0; i<NUM_ADS; i++) {
ad[i]->setFrequency(ch, freq+freqdiff*i);
}
}

Pot1 is essentially linked to “freq” and pot2 is linked to “freqdiff”.  “freq” can have a fixed offset based on the setting of switch 1 of either 0 or 1050.  With the range of a potentiometer being 0 to 1023, and with my frequency code starting at 30, so giving a theoretical range of 30 to 1053, this crudely gives me twice the granularity from the pot.

The only other thing to note is that I always check for changes in the pot or switch settings before updating the signal generators as I don’t want to be constantly sending messages off to them.

You can find it on GitHub here.

Closing Thoughts

This is a very promising start and already we can hear some interesting sounds coming out!  It will be interesting to see what happens if I start treating it as two sets of three oscillators or if I drive it over MIDI.

When using it with MIDI I could either use single oscillators for six-note polyphony or treat it as three pairs of two oscillators, which might allow some simple 3-note polyphony with more complex sounds.

Kevin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s