Arduino MIDIUSB Volume & Expression

This is a DIY project that uses a normal analog volume pedal that you may already own and convert it to MIDI to use with the Mod Devices (and other devices as well).

This project is simple enough to allow any of you who do not have any experience with electronics to be able to tackle it and get some results.

Yes you will need to use a soldering iron but this is a great time to learn a new skill that will serve you over and over in the future.

I do not pretend this project will solve all problems discussed in other threads, and yes, there are readily available solutions on the market that can fit this bill but I know that some of us still like to thinker with stuff and build their own in the same manner that some prefer to write their own songs rater than play covers.

Although fully functional, this first version of the MIDI Volume and Expression pedal converter is very basic and uses minimal amount of parts. But future versions can (and will) expand it to suit many applications and special needs.

Let’s get into it:

You can find the documentation here: Arduino_MIDI_Volume_Expression.pdf

The source code is already included in the document above but here’s a link to download it separately if you wish: Arduino_Volume.ino

Use this discussion thread to ask any questions.

Note: I know this subject is sensitive for some and this is why I created a new thread, but I really hope that posts here will be kept to a civilized level.

Cheers !

16 Likes

Nice Tutorial Simon.

I might even have a stab at it this - I used the Notes and Volts for my stuff but its all MIDI output instead of USB.

I presume you went down the MID Nerd route, did you do the full course?

Hopefully people will give it a shot with the Dwarf .

Cheers for posting

:clap: :clap: :clap: :clap: :clap: !!

I wanted to use USB MIDI right away because one of the requirements stated in other discussion threads were to not have to carry an external power source for this.

But, there is not much to change in the code and hardware to use the DIN 5 pins connector (or even the 1/8" TRS jack of the Dwarf). I may just post here a new document with this as an alternative.

No, I have been a software developper for most of my life and I started to work with Arduinos a few years back to make all sorts of projects mostly not music related.

My goal here is to make it so simple that anybody can do it if you put a little heart into it.

I do not expect people to learn programming and this is why I supply the code and indicate what can be changed in the code to customize the projects to your needs.

Still if you want to learn, I try to document the code as much as possible so you will understand what is going on when the device runs.

If I can find a moment this week, I will release new code to introduce the switches (stomps). The Arduino Pro Micro used in this project has 12 digital pins on top of the 4 analog pins we are already using for volume and expression.

So, 4 expressions and 12 switches! This can make for a very nice floor MIDI controller all powered by the Mod Duo/DuoX/Dwarf USB port…

3 Likes

this is great. Really beginner friendly and I think pretty easy to do - even for people that never soldered before. The footswitch I built also uses the pro micro and it just works. As Simon said there are enough pins to do a lot of stuff.

@jon is there a separate Tutorials section? This might be handy to have those guides in one place.

6 Likes

Cool stuff; how do you program those buttons? (sorry, MIDI noob)
can you do that with plugins in the GUI and work with some kind of “channels”?

this is my prototype footswitch - so these are hardcoded CC 0-7 for the snapshots. Crunch and Lead also change the channel on my amp.
This was kind of an overnight build (except for the enclosure) because I wanted to use the dwarf at a show the next day. The next version will be using a teensy and https://github.com/neroroxxx/BMC for configuration. The Version after that will be ControlChain (hopefully when its is more sorted) and a few displays and encoders:

7 Likes

Wow nice emclosure :wink:

Thanks for the BMC link - very interesting indeed. Might h e to venture into the world of teensy soon.

Cheers

1 Like

Ok,

Version 1.1 of the code is here !

In this version, we now have “Stomps”. Up to 12 of them!

To keep the project as simple as possible and to avoid unnecessary soldering, we will use the Arduino built-in “Pull Up” resistors on the digital pins to keep the switches from possible random triggering.

The new document is found here: Arduino_MIDI_Volume-Expression_V1_1.pdf

And you can download the new code here: MIDI_VolumeV1_1.ino

As usual, I try to document the code as much as relevant but feel free to ask questions in this thread if you need help.

At this point, the hardware part is pretty much what it will remain. Future updates will most likely only be on the software side to add new features.

In the next version, I will implement sending “Notes”. Imagine using the foot pedal assembly of an old organ and use our 12 digital Arduino pins (and borrow one analog) to make a 13 notes foot MIDI keyboard (similar to a Moog Torus or a Roland PK-5) to go along with your favorite Mod generator plug-ins?

Also, I want to implement a way to configure the expression/volume/stomps without having to reprogram the Arduino every time you want to make a change.

But, for now, you have a fully functional MIDI controller you can already use with your Mod Devices.

Enjoy!

7 Likes

wow simon cheers for that.

Hard codes Cc 's arent too bad - as you midi learn on most hardware and software these days.

Maybe just a switch or footswitch to chose between pc and cc?

Or maybe 6 PC for favourite presets and 6 CC toggle stompbox behaviour?

I have an old set of bass pedals that need midifying.

Would there be some way of having octave up and down ?

And maybe expression pedal input too ; )

I know its a lot to ask but you never know

1 Like

Agreed but still, we shouldn’t have to reprogram the thing if you want to change your values.

Unless I misunderstood your remark, the code already allows you to determine the kind of MIDI message you want for each switch to send independently. So, you can have any combination of CC (momentary or latched) and PC as you like within the 12 switches currently available.

I believe so. As I mentioned in my previous post, most new feature added to this project is a matter of expanding the software. I’ll look into that since I want to implement sending notes in the next iteration of this code anyway.

This project already allows for up to 4 expressions. You can use a volume pedal you may already own (such as Ernie Ball) or use potentiometers screwed to the cover of a plastic box for desktop operations.

A future version of this will incorporate a “multiplexer” to add close to 16 more inputs. Imagine a table top MIDI controller with 16 potentiometers and/or switches assigned to controls in your Mod Dwarf/Duo/X plug-ins?.

Oh, believe me, I have plenty of ideas this project can be made into… :wink:

4 Likes

yeah Ive done the mux thing before with the notes and volts which worked fine.

Im looking to do the same with just USB without hairless etc. That way I don’t need the extra power but dont program so had no idea how to change it to teensy.

Also if I remember correctly the notes and volts was channel 16 only and I couldn’t see how to change the channel

1 Like

Thank you so much for sharing this in such detail and so well documented @Simon :slight_smile:

I present you version 1.2 of our little MIDI Controller project:

This version now supports all 4 expressions and 12 stomps that the Arduino Pro Micro has to offer.

What’s new?

  • Now supports CC, PC and Notes messages.
  • Configuration is now stored into the Arduino’s EEProm (non-volatile memory).
  • A configuration can now be sent to the Arduino using the Configuration Manager.

I did a fairly good amount of testing but if you find anything, please let me know and I will address the issue.

For now, I only had time to make a Windows version of the Configuration Manager. I will look into making one for the Mac when I have time.

As usual, all documentation and source code for both the Arduino and the Configuration Manager (in C#) are supplied here:

Arduino USB MIDI - V1.2 - Documentation

MIDI_VolumeV1_2.ino

Configuration Manager - Windows App

If you don’t want to compile the windows code for the Configuration Manager, you can find an already compiled executable in folder “bin\Debug” in the ZIP package above.

This project can certainly be further improved but as it is, it already does more than many products commercially available.

I hope you enjoyed this project :slight_smile:

11 Likes

Thanks a lot for your work! It looks easy to build one. Are you able to tell me what’s the sampling rate of expression pedal signal conversion to CC value? Would it be possible to have a long press function and led selection for each footswitch?

2 Likes

There is no sampling rate. The code runs in a loop and scans in sequence all switches and expressions for activity. When activity is found, the program sends the associated MIDI info and then resumes the loop.

It may be possible to add long press. It would require to memorize the moment at which the switch was depressed and then loop until the desired interval has been reached before acting.

As for LEDs, they can easily be implemented to follow the memorized state of a switch but you have to remember that this project flows the MIDI only in one direction. So the LEDs will not be updated if a change is made by a source external to the Arduino.

I did not put any LEDs in this project because the Arduino model I used would not have had enough pins to power them. A “Multiplexer” could be used to help with that but I wanted to keep this project simple to do for Arduino beginners.

3 Likes

Nice!

Is there any reason you write all the code yourself?

I have recently switched to Control Surface library - it does lots of stuff for you

Also try PlatformIO instead of the Arduino IDE.

3 Likes

Thanks !

Because I’m a masochist maybe? Lol !

But seriously, I do Arduino stuff in my limited spare time and I sometimes avoid spending too much on learning tools and focus more on writing my code. But, it is like a snake that eats its own tail because those tools may well save me some coding time…

I know of PlatformIO. I actually have it installed because I needed to recompile a 3D printer firmware but, as mentioned above, I never took the time to learn it.

As for the “Control Surface Library”, I was not aware of that one. Thanks !!

3 Likes