Arduino USB MIDI VS1053 Synth

This project builds on the Arduino MIDI VS1053 Synth but introduces a neat little module  from Hobbytronics.co.uk that lets you use a range of USB MIDI controllers with the Arduino.

2020-07-09 17.38.44

Warning! I strongly recommend using an old or second hand keyboard for your MIDI 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

This will use the Hobbytronics board linked up to power and the Arduino RX pin as shown below (I didn’t have a Fritzing part for the board, but you get the idea).  There is a potentiometer wired up across +5V, GND and A0 that will be used as a MIDI controller.

ArduinoUSBMIDISynth_bb

I wired this up on one of my proto shields as shown below.

2020-07-28 11.44.27

The USB shield supports a range of connections as it is a generic USB Host Shield, but to use the MIDI functionality you only need power, RX and TX.

It is possible to make a DIY MIDI Host Shield using a cheap USB host board and an Arduino Pro mini, which is something I might look into for the future, but for the price of the Hobbytronics board, having a simple “all in one” module that does it for you is great.

It has to be said though that it won’t support all USB MIDI controllers, it needs them to support the general USB MIDI class and also needs them not to have any kind of USB hub internally.  For my simple Korg microKey it works great.  For my Yamaha Portable Grand DGX-520 it doesn’t work at all so make sure you check before you buy.

The Code

The code is largely unchanged from the Arduino MIDI VS1053 Synth but I wanted a means to allow me to change the MIDI instrument selected so I decided to rig up a simple potentiometer to A0.  There is a small additional piece of code in the loop() that reads the potentiometer, scales it to a value between 0 and 127 (using a bit shift as I’ve described before) and if the instrument value has changed, then sends out the appropriate MIDI patch change command to the VS1053. It isn’t particularly accurate, so some fine adjusting is required if you were after a specific timbre.

Pretty much everything else is the same.  It is particularly pleasing that no additional code is required to use the USB MIDI Host device.  It is now completely interchangeable if I use the USB MIDI module or the MIDI Shield or my own MIDI receive module, which is great.

Find it on GitHub here.

Update: There is new code that has now been validated for both VS1003 and VS1053 support.  It also includes improvements to the MIDI support so is recommended over the above code.  See here for further details: Arduino MIDI VS1003 or VS1053 Synth.

Closing Thoughts

I did wonder about setting up a small digital 7-segment display to tell me the patch number.  I might also add some buttons as an “up/down” selection and possible the option to change banks, for example, to the percussion sounds.  Another option might be a small OLED display to actually show the names of the patches to choose from.

I’d like to see if there is a way of creating a USB MIDI interface that would work with my DGX-520 too, but as it appears to require a bespoke Windows driver from Yamaha, I’m not holding out much hope at present.

Kevin

Leave a comment