This is a short update, to demonstrate the MIDI version of my Arduino Slider PWM Waveform Generator.
- A future project shows a similar system using an R2R ladder.
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 projects for the main concepts used in this project:
- Arduino PWM Sound Output
- Arduino Multi-Slider MIDI Controller – Part 3
- Arduino PWM Output Filter Circuit
If you are new to Arduino, see the Getting Started pages.
Parts list
- Arduino Uno
- Multiplexed 16-pot slider/fader board as described here: Arduino Multi-Slider MIDI Controller – Part 3
- Arduino PWM Output Filter Circuit – optional but recommended
- Amplification and speaker
- MIDI In interface (such as one of the Ready-Made MIDI Modules)
- Breadboard and jumper wires
The Circuit
This is exactly the same circuit as used for the Arduino Slider PWM Waveform Generator but with the addition of one of the Ready-Made MIDI Modules connected up to the Arduino’s RX, 5V and GND.
Once again I’ve used the Arduino PWM Output Filter Circuit before plugging into an amp and speakers.
The Code
The code was already MIDI “ready to go”. To enable it, the serial output has to be disabled and the test tone turned off. Just commenting out the TEST definition at the top of the file will do it!
//#define TEST 1
Find the original on GitHub here.
Closing Thoughts
The MIDI handling is somewhat simplistic, but it generally works. There are a number of optimisations that I’m sure I could do. I inherited the “frequency updating” code from Arduino MIDI R2R Digital Audio which itself is still getting tweaked as I tinker with it. One day I need to sit down and properly decide how I want that to work.
I am still considering how to add some kind of display, but I don’t know if I’ll actually get around to doing that or not, as it doesn’t really change the core functionality. But it would be nice.
It might also be quite nice to do a version of this with an R2R output rather than PWM, but that might need me to make another R2R shield as my original one is still in the Lo-Fi Orchestra!
Kevin