MozziByte Output Board

I ordered myself a MozziByte board to make playing around with Mozzi a little simpler and it works really well.  This details the updates to the Arduino PWM MIDI Synthesis with Mozzi project required to use the new board.

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 compatible Pro Micro (5V, 16MHz version, available from Sparkfun among other places)
  • MozziByte board (available from the Mozzi Store)
  • MIDI Module (see: Arduino MIDI Interfaces)
  • Amplification or headphones
  • 2x 10uF non-polar capacitors (optional)
  • 3.5mm stereo jack and socket (optional)
  • stripboard (optional)

The Circuit

The MozziByte is designed to allow the 5V version of the Pro Micro to plug directly in as shown below.

2020-09-14 17.49.51

The MIDI input goes to the RX pin, which is the second pin in from the end (even though it is referred to as pin 0).  Be sure to link up the ground wires too to get a good signal.

Note the Pro Micro is a different board to the Arduino compatible Pro Mini, which is different to the official Arduino Micro and the official Arduino Mini!  It also comes in 5V and 3.3V versions – the MozziByte is designed for the 5V version.

Optional Advanced Bit…

One thing the Mozzibyte doesn’t seem to have as far as I can see is AC coupling on the output.  If you look at an oscilloscope trace you can see that the output signal is biased with a DC offset voltage, therefore showing a signal varying between 0 and around 4V.  So I built a simple AC coupling stage to add to the output using two non-polar 10uF capacitors as shown below.

Caveat: I am not an electronics person so this is a very naïve approach, but it kind of works for me!

Note that the circuit diagram shows normal (polar) electrolytic capacitors as that was all I could find to use, but this circuit requires non-polarised capacitors – so they can be used either way round (there is no + or – on this type of capacitor).

Once this is in place between the Mozzibyte and the amplification you get a nice +/- 2V signal but this is optional if you just want to play with the Mozzibyte with headphones.

The Code

This example used the Mozzi_MIDI_Input example but requires a few changes to support the Pro Micro as follows:

  • The Pro Micro is recognized as an Arduino Leonardo board by the IDE.
  • There is no separate built-in LED, but using pin 17 will reuse one of the serial port LEDs as an indicator.
  • The LED on IO pin 17 is “active low” so digitalWrite (17, HIGH) will turn it off and digitalWrite(17, LOW) will turn it on.
  • The RX/TX serial port is Serial1.  Serial refers to the USB link.

In order to make the board a little more responsive, and to ensure the correct serial port is used, I also added the following initialisation code for Mozzi (the same update I used in Arduino Multi Mozzi String Synth – Part 2).

// This is a piece of "magic" code that allows us to change the default behaviour of the MIDI library
struct MySettings : public MIDI_NAMESPACE::DefaultSettings {
  static const bool Use1ByteParsing = false; // Allow MIDI.read to handle all received data in one go
  static const long BaudRate = 31250; // Doesn't build without this...
};
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial1, MIDI, MySettings);

Note the use of Serial1 too.

Find it on GitHub here.

Closing Thoughts

The output board provides a nicely filtered headphones or speaker out so I’m hoping will make experimenting with Mozzi a bit simpler than my home-made efforts to date.

Kevin

Leave a comment