Arduino Multi-pot Mozzi FM Synthesis – Revisited

I’ve been watching how people have been getting on with the Arduino “Make Your Uno” kit in which you build up your own Arduino Uno and a five-pot synth shield.  I’ve love to get one, but I really can’t justify the cost as I don’t need the soldering practice (well, I might, but not on a kit like this!); I have similar home-made shields that already have the same functionality and more; and I like MIDI on my shields!  But as a kit I really hope it does well.

But one thing I wanted to do was update my Arduino Multi-pot Mozzi FM Synthesis project to include the option for pitch control to make it more useful for use with the Arduino Synth Shield. I also wanted to try out my Arduino Mozzi Experimenter Shield PCB.

This is that project.

Note that I regard this as a “beginner” project if you’re using the official Arduino Synth Shield kit.  But if you want to make one of my Mozzi Experimenter PCBs then that is in the “advanced” category!

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

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

The Circuit

If using the Arduino “Make Your Uno” kit, then this should “just work” with the five potentiometers onboard.  Details of how they map to controls are provided later.

If using my Arduino Mozzi Experimenter Shield PCB then the additional potentiometer should be added to A4, 5V and GND.  Also some kind of amplification is required for the audio output.  Use of MIDI is optional.

IMG_6687

The Code

This is the same code as used with my Arduino Multi-pot Mozzi FM Synthesis project, so I won’t go back over how that all works here.

What has changed though is the addition of an optional FREQ_PIN setting for a potentiometer to control the frequency of the synthesis.  This works as follows:

  • If the pot is on zero, then there is no effect.
  • If the pot is turned, then the frequency is changed between 220 Hz and 1043 Hz depending on the pot setting. Note that this requires triggering the envelope generator to start the note when the pot is first turned.
  • If the pot is turned back to zero, then the envelope generator is told to stop the note.

It can also work with MIDI in that if a MIDI note is already playing then the pot value is added to the MIDI note. It isn’t really a pitch bend, as it will only add, not subtract frequency, but the effect is similar.

It is a little crude and the interaction with MIDI can be a little quirky, but it is only meant as a bit of fun.

There is also a new option to reverse the sense of the potentiometers.  Just uncomment the following line to do that (my synth shield, I’m afraid, as the pots hooked up the wrong way round, so this makes them make “more sense” – at least to me).

#define POT_REVERSE 1

Arduino Mozzi or Synth Shield Configuration

#define WAVT_PIN 0 // Wavetable
#define INTS_PIN 1 // FM intensity
#define RATE_PIN 2 // Modulation Rate
#define MODR_PIN 3 // Modulation Ratio
//#define AD_A_PIN 4 // ADSR Attack
//#define AD_D_PIN 5 // ADSR Delay
#define FREQ_PIN 4 // Optional Frequency Control

This maps the controls as follows:

Arduino Synth Shield - FM Synth

Arduino Mozzi Experimenter Shield - FM Synth

Find it on GitHub here.

Closing Thoughts

This is something I’ve been meaning to do for a while, since I saw the release of the Arduino Synth Shield and now having received some of my own Mozzi Experimenter shields back, this seemed like the ideal opportunity.

Kevin

Leave a comment