Arduino Nano Multi-pot FM and String Synthesis

Having now built my Arduino Nano Multi-tone or PWM PCB this project is by way of preparation for its use in my Lo-Fi Orchestra.  Specially, it will support the existing strings and an expanded woodwind section, utilising the following projects:

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

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

Parts list

The Circuit

This requires the PWM section of the Arduino Nano Multi-tone or PWM PCB only as shown below (note: these photos are missing the 68nF capacitors in the filter – they are on order!!).

IMG_6659

Arduino Multi Mozzi Sting Synth V2

IMG_6661

In this configuration, the Nano’s are all configured for their own MIDI channel and the RX jumpers are set for them to share the same MIDI IN signal as shown below.

IMG_6662

An alternative configuration would be to support four independent MIDI INs, but in this case I’ve replicated the functionality of Arduino Multi Mozzi String Synth – Part 2 which relied on a MIDI filter to filter out everything apart from the string channels, but then pass the MIDI onto all boards.

The Code

The code is exactly the same as used in Arduino Multi Mozzi String Synth – Part 2 and this should now be “Lo-Fi Orchestra ready”.

Arduino Multi-pot Mozzi FM Synthesis

IMG_6660

For this one I need to do something slightly different.  My Lo-Fi Orchestra supported FM synthesis as a “woodwind” style sound on MIDI channels 4 and 5.  I want to expand this to support four voices instead of just two, but I’d like to keep things largely backwards compatible with previous MIDI files that I’ve already made.  So what I’m aiming for is two voices on channel 4 and two on channel 5.

To do this, I have to do the following:

  • Update the code so that if a voice is already playing then it will pass an incoming Note message on to another board.
  • Configure the Nanos in “RX to TX” mode to daisy-chain them.  This means that the RX of one Nano is hooked up to the TX of the previous one.
  • BUT don’t connect Nano C to Nano B, instead leave Nano C configured for its own independent MIDI input.

IMG_6664

This gives me two pairs of Nanos, two (A and B) on channel 4 and two (C and D) on channel 5, but this does now require two MIDI IN signals – one on INPUT A for channel 4 and one on INPUT C for channel 5.

However, chewing things over a little, I realised that I could actually still have two pairs of Nanos from a single MIDI INPUT if I connected things up slightly differently.  What I need is the following:

  • MIDI IN -> Nano A RX
  • MIDI IN -> Nano B RX
  • Nano A TX -> Nano D RX
  • Nano B TX -> Nano C RX

And this is quite possible, assuming Nanos A and D are listening on channel 4 and Nanos B and C are listening on channel 5, but configuring the jumpers as shown below.

IMG_6663

Note the addition of a bridging jumper wire between Nano A TX (exposed via the RX mode jumpers for Nano B of course) and Nano D RX (exposed via Nano D’s RX mode jumpers).

In this configuration, Nanos A and B both receive all MIDI data, but A will only respond to channel 4 and B will only respond to channel 5.  When A gets more notes than it can play, it passes them on via its TX pin to Nano D.  When B gets more notes it passes them on via its TX to Nano C.

I suspect in the final configuration I’ll be using them with an external MIDI filter, so would probably use the two independent MIDI IN signals, but it was interesting to note that a single IN configuration was possible!

The Code

This requires a slight enhancement to the Arduino Multi-pot Mozzi FM Synthesis code to support an optional MIDI_PASS_THRU mode. The basic logic is as follows (this assumes the channel filtering has already been handled by the MIDI library, which it will have been):

HandleNoteOn:
    IF already playing a note THEN
        Send NoteOn out via MIDI
    ELSE
        Play the note ourselves

HandleNoteOff:
    IF NoteOff is for the note we're playing THEN
        Turn note off
    ELSE
        Send NoteOff out via MIDI

I’ve updated my original code to support this mode.  Just uncomment the following to enable MIDI_PASS_THRU mode (it is left disabled by default to be compatible with the original code).

#define MIDI_PASS_THRU 1

Find it on GitHub here.

Closing Thoughts

Once again I’m really pleased how these have allow me to expand my Lo-Fi Orchestra in a pretty neat and tidy manner. I’m looking forward to getting to use the extra voices these are going to allow.

Kevin

Leave a comment